Skip to content

Commit

Permalink
feat: add api_version to google/api/client.proto (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] committed Mar 8, 2024
1 parent 0ac430d commit 6f9c4d2
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 39 deletions.
20 changes: 20 additions & 0 deletions google/api/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ extend google.protobuf.ServiceOptions {
// ...
// }
string oauth_scopes = 1050;

// The API version of this service, which should be sent by version-aware
// clients to the service. This allows services to abide by the schema and
// behavior of the service at the time this API version was deployed.
// The format of the API version must be treated as opaque by clients.
// Services may use a format with an apparent structure, but clients must
// not rely on this to determine components within an API version, or attempt
// to construct other valid API versions. Note that this is for upcoming
// functionality and may not be implemented for all services.
//
// Example:
//
// service Foo {
// option (google.api.api_version) = "v1_20230821_preview";
// }
string api_version = 525000001;
}

// Required information for every language.
Expand Down Expand Up @@ -192,6 +208,10 @@ message Publishing {
// Optional link to proto reference documentation. Example:
// https://cloud.google.com/pubsub/lite/docs/reference/rpc
string proto_reference_documentation_uri = 110;

// Optional link to REST reference documentation. Example:
// https://cloud.google.com/pubsub/lite/docs/reference/rest
string rest_reference_documentation_uri = 111;
}

// Settings for Java client libraries.
Expand Down
69 changes: 37 additions & 32 deletions google/api/client_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
b'\n\x17google/api/client.proto\x12\ngoogle.api\x1a\x1dgoogle/api/launch_stage.proto\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto"t\n\x16\x43ommonLanguageSettings\x12\x1e\n\x12reference_docs_uri\x18\x01 \x01(\tB\x02\x18\x01\x12:\n\x0c\x64\x65stinations\x18\x02 \x03(\x0e\x32$.google.api.ClientLibraryDestination"\xfb\x03\n\x15\x43lientLibrarySettings\x12\x0f\n\x07version\x18\x01 \x01(\t\x12-\n\x0claunch_stage\x18\x02 \x01(\x0e\x32\x17.google.api.LaunchStage\x12\x1a\n\x12rest_numeric_enums\x18\x03 \x01(\x08\x12/\n\rjava_settings\x18\x15 \x01(\x0b\x32\x18.google.api.JavaSettings\x12-\n\x0c\x63pp_settings\x18\x16 \x01(\x0b\x32\x17.google.api.CppSettings\x12-\n\x0cphp_settings\x18\x17 \x01(\x0b\x32\x17.google.api.PhpSettings\x12\x33\n\x0fpython_settings\x18\x18 \x01(\x0b\x32\x1a.google.api.PythonSettings\x12/\n\rnode_settings\x18\x19 \x01(\x0b\x32\x18.google.api.NodeSettings\x12\x33\n\x0f\x64otnet_settings\x18\x1a \x01(\x0b\x32\x1a.google.api.DotnetSettings\x12/\n\rruby_settings\x18\x1b \x01(\x0b\x32\x18.google.api.RubySettings\x12+\n\x0bgo_settings\x18\x1c \x01(\x0b\x32\x16.google.api.GoSettings"\xfe\x02\n\nPublishing\x12\x33\n\x0fmethod_settings\x18\x02 \x03(\x0b\x32\x1a.google.api.MethodSettings\x12\x15\n\rnew_issue_uri\x18\x65 \x01(\t\x12\x19\n\x11\x64ocumentation_uri\x18\x66 \x01(\t\x12\x16\n\x0e\x61pi_short_name\x18g \x01(\t\x12\x14\n\x0cgithub_label\x18h \x01(\t\x12\x1e\n\x16\x63odeowner_github_teams\x18i \x03(\t\x12\x16\n\x0e\x64oc_tag_prefix\x18j \x01(\t\x12;\n\x0corganization\x18k \x01(\x0e\x32%.google.api.ClientLibraryOrganization\x12;\n\x10library_settings\x18m \x03(\x0b\x32!.google.api.ClientLibrarySettings\x12)\n!proto_reference_documentation_uri\x18n \x01(\t"\xe3\x01\n\x0cJavaSettings\x12\x17\n\x0flibrary_package\x18\x01 \x01(\t\x12L\n\x13service_class_names\x18\x02 \x03(\x0b\x32/.google.api.JavaSettings.ServiceClassNamesEntry\x12\x32\n\x06\x63ommon\x18\x03 \x01(\x0b\x32".google.api.CommonLanguageSettings\x1a\x38\n\x16ServiceClassNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"A\n\x0b\x43ppSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"A\n\x0bPhpSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"D\n\x0ePythonSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"B\n\x0cNodeSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"\xaa\x03\n\x0e\x44otnetSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings\x12I\n\x10renamed_services\x18\x02 \x03(\x0b\x32/.google.api.DotnetSettings.RenamedServicesEntry\x12K\n\x11renamed_resources\x18\x03 \x03(\x0b\x32\x30.google.api.DotnetSettings.RenamedResourcesEntry\x12\x19\n\x11ignored_resources\x18\x04 \x03(\t\x12 \n\x18\x66orced_namespace_aliases\x18\x05 \x03(\t\x12\x1e\n\x16handwritten_signatures\x18\x06 \x03(\t\x1a\x36\n\x14RenamedServicesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x37\n\x15RenamedResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"B\n\x0cRubySettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"@\n\nGoSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"\xcf\x02\n\x0eMethodSettings\x12\x10\n\x08selector\x18\x01 \x01(\t\x12<\n\x0clong_running\x18\x02 \x01(\x0b\x32&.google.api.MethodSettings.LongRunning\x12\x1d\n\x15\x61uto_populated_fields\x18\x03 \x03(\t\x1a\xcd\x01\n\x0bLongRunning\x12\x35\n\x12initial_poll_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1d\n\x15poll_delay_multiplier\x18\x02 \x01(\x02\x12\x31\n\x0emax_poll_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12total_poll_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration*\xa3\x01\n\x19\x43lientLibraryOrganization\x12+\n\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\x10\x00\x12\t\n\x05\x43LOUD\x10\x01\x12\x07\n\x03\x41\x44S\x10\x02\x12\n\n\x06PHOTOS\x10\x03\x12\x0f\n\x0bSTREET_VIEW\x10\x04\x12\x0c\n\x08SHOPPING\x10\x05\x12\x07\n\x03GEO\x10\x06\x12\x11\n\rGENERATIVE_AI\x10\x07*g\n\x18\x43lientLibraryDestination\x12*\n&CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\x10\x00\x12\n\n\x06GITHUB\x10\n\x12\x13\n\x0fPACKAGE_MANAGER\x10\x14:9\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\t:6\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\t:6\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\tBi\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3'
b'\n\x17google/api/client.proto\x12\ngoogle.api\x1a\x1dgoogle/api/launch_stage.proto\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto"t\n\x16\x43ommonLanguageSettings\x12\x1e\n\x12reference_docs_uri\x18\x01 \x01(\tB\x02\x18\x01\x12:\n\x0c\x64\x65stinations\x18\x02 \x03(\x0e\x32$.google.api.ClientLibraryDestination"\xfb\x03\n\x15\x43lientLibrarySettings\x12\x0f\n\x07version\x18\x01 \x01(\t\x12-\n\x0claunch_stage\x18\x02 \x01(\x0e\x32\x17.google.api.LaunchStage\x12\x1a\n\x12rest_numeric_enums\x18\x03 \x01(\x08\x12/\n\rjava_settings\x18\x15 \x01(\x0b\x32\x18.google.api.JavaSettings\x12-\n\x0c\x63pp_settings\x18\x16 \x01(\x0b\x32\x17.google.api.CppSettings\x12-\n\x0cphp_settings\x18\x17 \x01(\x0b\x32\x17.google.api.PhpSettings\x12\x33\n\x0fpython_settings\x18\x18 \x01(\x0b\x32\x1a.google.api.PythonSettings\x12/\n\rnode_settings\x18\x19 \x01(\x0b\x32\x18.google.api.NodeSettings\x12\x33\n\x0f\x64otnet_settings\x18\x1a \x01(\x0b\x32\x1a.google.api.DotnetSettings\x12/\n\rruby_settings\x18\x1b \x01(\x0b\x32\x18.google.api.RubySettings\x12+\n\x0bgo_settings\x18\x1c \x01(\x0b\x32\x16.google.api.GoSettings"\xa8\x03\n\nPublishing\x12\x33\n\x0fmethod_settings\x18\x02 \x03(\x0b\x32\x1a.google.api.MethodSettings\x12\x15\n\rnew_issue_uri\x18\x65 \x01(\t\x12\x19\n\x11\x64ocumentation_uri\x18\x66 \x01(\t\x12\x16\n\x0e\x61pi_short_name\x18g \x01(\t\x12\x14\n\x0cgithub_label\x18h \x01(\t\x12\x1e\n\x16\x63odeowner_github_teams\x18i \x03(\t\x12\x16\n\x0e\x64oc_tag_prefix\x18j \x01(\t\x12;\n\x0corganization\x18k \x01(\x0e\x32%.google.api.ClientLibraryOrganization\x12;\n\x10library_settings\x18m \x03(\x0b\x32!.google.api.ClientLibrarySettings\x12)\n!proto_reference_documentation_uri\x18n \x01(\t\x12(\n rest_reference_documentation_uri\x18o \x01(\t"\xe3\x01\n\x0cJavaSettings\x12\x17\n\x0flibrary_package\x18\x01 \x01(\t\x12L\n\x13service_class_names\x18\x02 \x03(\x0b\x32/.google.api.JavaSettings.ServiceClassNamesEntry\x12\x32\n\x06\x63ommon\x18\x03 \x01(\x0b\x32".google.api.CommonLanguageSettings\x1a\x38\n\x16ServiceClassNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"A\n\x0b\x43ppSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"A\n\x0bPhpSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"D\n\x0ePythonSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"B\n\x0cNodeSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"\xaa\x03\n\x0e\x44otnetSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings\x12I\n\x10renamed_services\x18\x02 \x03(\x0b\x32/.google.api.DotnetSettings.RenamedServicesEntry\x12K\n\x11renamed_resources\x18\x03 \x03(\x0b\x32\x30.google.api.DotnetSettings.RenamedResourcesEntry\x12\x19\n\x11ignored_resources\x18\x04 \x03(\t\x12 \n\x18\x66orced_namespace_aliases\x18\x05 \x03(\t\x12\x1e\n\x16handwritten_signatures\x18\x06 \x03(\t\x1a\x36\n\x14RenamedServicesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x37\n\x15RenamedResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"B\n\x0cRubySettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"@\n\nGoSettings\x12\x32\n\x06\x63ommon\x18\x01 \x01(\x0b\x32".google.api.CommonLanguageSettings"\xcf\x02\n\x0eMethodSettings\x12\x10\n\x08selector\x18\x01 \x01(\t\x12<\n\x0clong_running\x18\x02 \x01(\x0b\x32&.google.api.MethodSettings.LongRunning\x12\x1d\n\x15\x61uto_populated_fields\x18\x03 \x03(\t\x1a\xcd\x01\n\x0bLongRunning\x12\x35\n\x12initial_poll_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1d\n\x15poll_delay_multiplier\x18\x02 \x01(\x02\x12\x31\n\x0emax_poll_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12total_poll_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration*\xa3\x01\n\x19\x43lientLibraryOrganization\x12+\n\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\x10\x00\x12\t\n\x05\x43LOUD\x10\x01\x12\x07\n\x03\x41\x44S\x10\x02\x12\n\n\x06PHOTOS\x10\x03\x12\x0f\n\x0bSTREET_VIEW\x10\x04\x12\x0c\n\x08SHOPPING\x10\x05\x12\x07\n\x03GEO\x10\x06\x12\x11\n\rGENERATIVE_AI\x10\x07*g\n\x18\x43lientLibraryDestination\x12*\n&CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\x10\x00\x12\n\n\x06GITHUB\x10\n\x12\x13\n\x0fPACKAGE_MANAGER\x10\x14:9\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\t:6\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\t:6\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\t:8\n\x0b\x61pi_version\x12\x1f.google.protobuf.ServiceOptions\x18\xc1\xba\xab\xfa\x01 \x01(\tBi\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3'
)

_CLIENTLIBRARYORGANIZATION = DESCRIPTOR.enum_types_by_name["ClientLibraryOrganization"]
Expand All @@ -62,6 +62,8 @@
default_host = DESCRIPTOR.extensions_by_name["default_host"]
OAUTH_SCOPES_FIELD_NUMBER = 1050
oauth_scopes = DESCRIPTOR.extensions_by_name["oauth_scopes"]
API_VERSION_FIELD_NUMBER = 525000001
api_version = DESCRIPTOR.extensions_by_name["api_version"]

_COMMONLANGUAGESETTINGS = DESCRIPTOR.message_types_by_name["CommonLanguageSettings"]
_CLIENTLIBRARYSETTINGS = DESCRIPTOR.message_types_by_name["ClientLibrarySettings"]
Expand Down Expand Up @@ -267,6 +269,9 @@
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(
oauth_scopes
)
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(
api_version
)

DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b"\n\016com.google.apiB\013ClientProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI"
Expand All @@ -280,40 +285,40 @@
_DOTNETSETTINGS_RENAMEDSERVICESENTRY._serialized_options = b"8\001"
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._options = None
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._serialized_options = b"8\001"
_CLIENTLIBRARYORGANIZATION._serialized_start = 2553
_CLIENTLIBRARYORGANIZATION._serialized_end = 2716
_CLIENTLIBRARYDESTINATION._serialized_start = 2718
_CLIENTLIBRARYDESTINATION._serialized_end = 2821
_CLIENTLIBRARYORGANIZATION._serialized_start = 2595
_CLIENTLIBRARYORGANIZATION._serialized_end = 2758
_CLIENTLIBRARYDESTINATION._serialized_start = 2760
_CLIENTLIBRARYDESTINATION._serialized_end = 2863
_COMMONLANGUAGESETTINGS._serialized_start = 136
_COMMONLANGUAGESETTINGS._serialized_end = 252
_CLIENTLIBRARYSETTINGS._serialized_start = 255
_CLIENTLIBRARYSETTINGS._serialized_end = 762
_PUBLISHING._serialized_start = 765
_PUBLISHING._serialized_end = 1147
_JAVASETTINGS._serialized_start = 1150
_JAVASETTINGS._serialized_end = 1377
_JAVASETTINGS_SERVICECLASSNAMESENTRY._serialized_start = 1321
_JAVASETTINGS_SERVICECLASSNAMESENTRY._serialized_end = 1377
_CPPSETTINGS._serialized_start = 1379
_CPPSETTINGS._serialized_end = 1444
_PHPSETTINGS._serialized_start = 1446
_PHPSETTINGS._serialized_end = 1511
_PYTHONSETTINGS._serialized_start = 1513
_PYTHONSETTINGS._serialized_end = 1581
_NODESETTINGS._serialized_start = 1583
_NODESETTINGS._serialized_end = 1649
_DOTNETSETTINGS._serialized_start = 1652
_DOTNETSETTINGS._serialized_end = 2078
_DOTNETSETTINGS_RENAMEDSERVICESENTRY._serialized_start = 1967
_DOTNETSETTINGS_RENAMEDSERVICESENTRY._serialized_end = 2021
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._serialized_start = 2023
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._serialized_end = 2078
_RUBYSETTINGS._serialized_start = 2080
_RUBYSETTINGS._serialized_end = 2146
_GOSETTINGS._serialized_start = 2148
_GOSETTINGS._serialized_end = 2212
_METHODSETTINGS._serialized_start = 2215
_METHODSETTINGS._serialized_end = 2550
_METHODSETTINGS_LONGRUNNING._serialized_start = 2345
_METHODSETTINGS_LONGRUNNING._serialized_end = 2550
_PUBLISHING._serialized_end = 1189
_JAVASETTINGS._serialized_start = 1192
_JAVASETTINGS._serialized_end = 1419
_JAVASETTINGS_SERVICECLASSNAMESENTRY._serialized_start = 1363
_JAVASETTINGS_SERVICECLASSNAMESENTRY._serialized_end = 1419
_CPPSETTINGS._serialized_start = 1421
_CPPSETTINGS._serialized_end = 1486
_PHPSETTINGS._serialized_start = 1488
_PHPSETTINGS._serialized_end = 1553
_PYTHONSETTINGS._serialized_start = 1555
_PYTHONSETTINGS._serialized_end = 1623
_NODESETTINGS._serialized_start = 1625
_NODESETTINGS._serialized_end = 1691
_DOTNETSETTINGS._serialized_start = 1694
_DOTNETSETTINGS._serialized_end = 2120
_DOTNETSETTINGS_RENAMEDSERVICESENTRY._serialized_start = 2009
_DOTNETSETTINGS_RENAMEDSERVICESENTRY._serialized_end = 2063
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._serialized_start = 2065
_DOTNETSETTINGS_RENAMEDRESOURCESENTRY._serialized_end = 2120
_RUBYSETTINGS._serialized_start = 2122
_RUBYSETTINGS._serialized_end = 2188
_GOSETTINGS._serialized_start = 2190
_GOSETTINGS._serialized_end = 2254
_METHODSETTINGS._serialized_start = 2257
_METHODSETTINGS._serialized_end = 2592
_METHODSETTINGS_LONGRUNNING._serialized_start = 2387
_METHODSETTINGS_LONGRUNNING._serialized_end = 2592
# @@protoc_insertion_point(module_scope)
2 changes: 1 addition & 1 deletion google/api/documentation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ option objc_class_prefix = "GAPI";
// content: &#40;== include google/foo/overview.md ==&#41;
// - name: Tutorial
// content: &#40;== include google/foo/tutorial.md ==&#41;
// subpages;
// subpages:
// - name: Java
// content: &#40;== include google/foo/tutorial_java.md ==&#41;
// rules:
Expand Down
19 changes: 19 additions & 0 deletions google/api/error_reason.proto
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,23 @@ enum ErrorReason {
//
// This response indicates the associated GCP account has been suspended.
GCP_SUSPENDED = 30;

// The request violates the location policies when creating resources in
// the restricted region.
//
// Example of an ErrorInfo when creating the Cloud Storage Bucket by
// "projects/123" for service storage.googleapis.com:
//
// { "reason": "LOCATION_POLICY_VIOLATED",
// "domain": "googleapis.com",
// "metadata": {
// "consumer": "projects/123",
// "service": "storage.googleapis.com",
// }
// }
//
// This response indicates creating the Cloud Storage Bucket in
// "locations/asia-northeast3" violates at least one location policy.
// The troubleshooting guidance is provided in the Help links.
LOCATION_POLICY_VIOLATED = 31;
}
Loading

0 comments on commit 6f9c4d2

Please sign in to comment.