diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml new file mode 100644 index 0000000..fc281c0 --- /dev/null +++ b/.github/header-checker-lint.yml @@ -0,0 +1,15 @@ +{"allowedCopyrightHolders": ["Google LLC"], + "allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"], + "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"], + "sourceFileExtensions": [ + "ts", + "js", + "java", + "sh", + "Dockerfile", + "yaml", + "py", + "html", + "txt" + ] +} \ No newline at end of file diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 393d06f..205b10b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -40,6 +40,16 @@ python3 -m pip uninstall --yes --quiet nox-automation python3 -m pip install --upgrade --quiet nox python3 -m nox --version +# If this is a continuous build, send the test log to the FlakyBot. +# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + $KOKORO_GFILE_DIR/linux_amd64/flakybot + } + trap cleanup EXIT HUP +fi + # If NOX_SESSION is set, it only runs the specified session, # otherwise run all the sessions. if [[ -n "${NOX_SESSION:-}" ]]; then diff --git a/google/api/client.proto b/google/api/client.proto index c6846e2..2102623 100644 --- a/google/api/client.proto +++ b/google/api/client.proto @@ -1,10 +1,10 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -24,43 +24,6 @@ option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; - -extend google.protobuf.ServiceOptions { - // The hostname for this service. - // This should be specified with no prefix or protocol. - // - // Example: - // - // service Foo { - // option (google.api.default_host) = "foo.googleapi.com"; - // ... - // } - string default_host = 1049; - - // OAuth scopes needed for the client. - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform"; - // ... - // } - // - // If there is more than one scope, use a comma-separated string: - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform," - // "https://www.googleapis.com/auth/monitoring"; - // ... - // } - string oauth_scopes = 1050; -} - - extend google.protobuf.MethodOptions { // A definition of a client library method signature. // @@ -99,3 +62,38 @@ extend google.protobuf.MethodOptions { // change. repeated string method_signature = 1051; } + +extend google.protobuf.ServiceOptions { + // The hostname for this service. + // This should be specified with no prefix or protocol. + // + // Example: + // + // service Foo { + // option (google.api.default_host) = "foo.googleapi.com"; + // ... + // } + string default_host = 1049; + + // OAuth scopes needed for the client. + // + // Example: + // + // service Foo { + // option (google.api.oauth_scopes) = \ + // "https://www.googleapis.com/auth/cloud-platform"; + // ... + // } + // + // If there is more than one scope, use a comma-separated string: + // + // Example: + // + // service Foo { + // option (google.api.oauth_scopes) = \ + // "https://www.googleapis.com/auth/cloud-platform," + // "https://www.googleapis.com/auth/monitoring"; + // ... + // } + string oauth_scopes = 1050; +} diff --git a/google/api/client_pb2.py b/google/api/client_pb2.py index 80196f5..9254082 100644 --- a/google/api/client_pb2.py +++ b/google/api/client_pb2.py @@ -36,22 +36,22 @@ syntax="proto3", serialized_options=b"\n\016com.google.apiB\013ClientProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI", create_key=_descriptor._internal_create_key, - serialized_pb=b"\n\x17google/api/client.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto: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:9\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\tBi\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3", + serialized_pb=b"\n\x17google/api/client.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto: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", dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR], ) -DEFAULT_HOST_FIELD_NUMBER = 1049 -default_host = _descriptor.FieldDescriptor( - name="default_host", - full_name="google.api.default_host", +METHOD_SIGNATURE_FIELD_NUMBER = 1051 +method_signature = _descriptor.FieldDescriptor( + name="method_signature", + full_name="google.api.method_signature", index=0, - number=1049, + number=1051, type=9, cpp_type=9, - label=1, + label=3, has_default_value=False, - default_value=b"".decode("utf-8"), + default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -61,12 +61,12 @@ file=DESCRIPTOR, create_key=_descriptor._internal_create_key, ) -OAUTH_SCOPES_FIELD_NUMBER = 1050 -oauth_scopes = _descriptor.FieldDescriptor( - name="oauth_scopes", - full_name="google.api.oauth_scopes", +DEFAULT_HOST_FIELD_NUMBER = 1049 +default_host = _descriptor.FieldDescriptor( + name="default_host", + full_name="google.api.default_host", index=1, - number=1050, + number=1049, type=9, cpp_type=9, label=1, @@ -81,17 +81,17 @@ file=DESCRIPTOR, create_key=_descriptor._internal_create_key, ) -METHOD_SIGNATURE_FIELD_NUMBER = 1051 -method_signature = _descriptor.FieldDescriptor( - name="method_signature", - full_name="google.api.method_signature", +OAUTH_SCOPES_FIELD_NUMBER = 1050 +oauth_scopes = _descriptor.FieldDescriptor( + name="oauth_scopes", + full_name="google.api.oauth_scopes", index=2, - number=1051, + number=1050, type=9, cpp_type=9, - label=3, + label=1, has_default_value=False, - default_value=[], + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -102,16 +102,16 @@ create_key=_descriptor._internal_create_key, ) +DESCRIPTOR.extensions_by_name["method_signature"] = method_signature DESCRIPTOR.extensions_by_name["default_host"] = default_host DESCRIPTOR.extensions_by_name["oauth_scopes"] = oauth_scopes -DESCRIPTOR.extensions_by_name["method_signature"] = method_signature _sym_db.RegisterFileDescriptor(DESCRIPTOR) -google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(default_host) -google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(oauth_scopes) google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension( method_signature ) +google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(default_host) +google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(oauth_scopes) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope) diff --git a/google/api/field_behavior.proto b/google/api/field_behavior.proto index 7883849..6866679 100644 --- a/google/api/field_behavior.proto +++ b/google/api/field_behavior.proto @@ -1,10 +1,10 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -24,6 +24,21 @@ option java_outer_classname = "FieldBehaviorProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). @@ -60,21 +75,10 @@ enum FieldBehavior { // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. IMMUTABLE = 5; -} - -extend google.protobuf.FieldOptions { - // A designation of a specific field behavior (required, output only, etc.) - // in protobuf messages. - // - // Examples: - // - // string name = 1 [(google.api.field_behavior) = REQUIRED]; - // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // google.protobuf.Duration ttl = 1 - // [(google.api.field_behavior) = INPUT_ONLY]; - // google.protobuf.Timestamp expire_time = 1 - // [(google.api.field_behavior) = OUTPUT_ONLY, - // (google.api.field_behavior) = IMMUTABLE]; - repeated FieldBehavior field_behavior = 1052; + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; } diff --git a/google/api/field_behavior_pb2.py b/google/api/field_behavior_pb2.py index 2074d3c..e6d7acc 100644 --- a/google/api/field_behavior_pb2.py +++ b/google/api/field_behavior_pb2.py @@ -37,7 +37,7 @@ syntax="proto3", serialized_options=b"\n\016com.google.apiB\022FieldBehaviorProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI", create_key=_descriptor._internal_create_key, - serialized_pb=b"\n\x1fgoogle/api/field_behavior.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto*{\n\rFieldBehavior\x12\x1e\n\x1a\x46IELD_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPTIONAL\x10\x01\x12\x0c\n\x08REQUIRED\x10\x02\x12\x0f\n\x0bOUTPUT_ONLY\x10\x03\x12\x0e\n\nINPUT_ONLY\x10\x04\x12\r\n\tIMMUTABLE\x10\x05:Q\n\x0e\x66ield_behavior\x12\x1d.google.protobuf.FieldOptions\x18\x9c\x08 \x03(\x0e\x32\x19.google.api.FieldBehaviorBp\n\x0e\x63om.google.apiB\x12\x46ieldBehaviorProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3", + serialized_pb=b"\n\x1fgoogle/api/field_behavior.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto*\x8f\x01\n\rFieldBehavior\x12\x1e\n\x1a\x46IELD_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPTIONAL\x10\x01\x12\x0c\n\x08REQUIRED\x10\x02\x12\x0f\n\x0bOUTPUT_ONLY\x10\x03\x12\x0e\n\nINPUT_ONLY\x10\x04\x12\r\n\tIMMUTABLE\x10\x05\x12\x12\n\x0eUNORDERED_LIST\x10\x06:Q\n\x0e\x66ield_behavior\x12\x1d.google.protobuf.FieldOptions\x18\x9c\x08 \x03(\x0e\x32\x19.google.api.FieldBehaviorBp\n\x0e\x63om.google.apiB\x12\x46ieldBehaviorProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3", dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR], ) @@ -96,11 +96,19 @@ type=None, create_key=_descriptor._internal_create_key, ), + _descriptor.EnumValueDescriptor( + name="UNORDERED_LIST", + index=6, + number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, + ), ], containing_type=None, serialized_options=None, - serialized_start=81, - serialized_end=204, + serialized_start=82, + serialized_end=225, ) _sym_db.RegisterEnumDescriptor(_FIELDBEHAVIOR) @@ -111,6 +119,7 @@ OUTPUT_ONLY = 3 INPUT_ONLY = 4 IMMUTABLE = 5 +UNORDERED_LIST = 6 FIELD_BEHAVIOR_FIELD_NUMBER = 1052 field_behavior = _descriptor.FieldDescriptor( diff --git a/google/gapic/metadata/__init__.py b/google/gapic/metadata/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/google/gapic/metadata/gapic_metadata.proto b/google/gapic/metadata/gapic_metadata.proto new file mode 100644 index 0000000..16090ed --- /dev/null +++ b/google/gapic/metadata/gapic_metadata.proto @@ -0,0 +1,92 @@ +// Copyright 2020 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.gapic.metadata; + +option csharp_namespace = "Google.Gapic.Metadata"; +option go_package = "google.golang.org/genproto/googleapis/gapic/metadata;metadata"; +option java_multiple_files = true; +option java_outer_classname = "GapicMetadataProto"; +option java_package = "com.google.gapic.metadata"; +option php_namespace = "Google\\Gapic\\Metadata"; +option ruby_package = "Google::Gapic::Metadata"; + +// Metadata about a GAPIC library for a specific combination of API, version, and +// computer language. +message GapicMetadata { + // Schema version of this proto. Current value: 1.0 + string schema = 1; + + // Any human-readable comments to be included in this file. + string comment = 2; + + // Computer language of this generated language. This must be + // spelled out as it spoken in English, with no capitalization or + // separators (e.g. "csharp", "nodejs"). + string language = 3; + + // The proto package containing the API definition for which this + // GAPIC library was generated. + string proto_package = 4; + + // The language-specific library package for this GAPIC library. + string library_package = 5; + + // A map from each proto-defined service to ServiceForTransports, + // which allows listing information about transport-specific + // implementations of the service. + // + // The key is the name of the service as it appears in the .proto + // file. + map services = 6; + + // A map from a transport name to ServiceAsClient, which allows + // listing information about the client objects that implement the + // parent RPC service for the specified transport. + // + // The key name is the transport, lower-cased with no separators + // (e.g. "grpc", "rest"). + message ServiceForTransport { + map clients = 1; + } + + // Information about a specific client implementing a proto-defined service. + message ServiceAsClient { + // The name of the library client formatted as it appears in the source code + string library_client = 1; + + // A mapping from each proto-defined RPC name to the the list of + // methods in library_client that implement it. There can be more + // than one library_client method for each RPC. RPCs with no + // library_client methods need not be included. + // + // The key name is the name of the RPC as defined and formated in + // the proto file. + map rpcs = 2; + } + + // List of GAPIC client methods implementing the proto-defined RPC + // for the transport and service specified in the containing + // structures. + message MethodList { + // List of methods for a specific proto-service client in the + // GAPIC. These names should be formatted as they appear in the + // source code. + repeated string methods = 1; + } + +} diff --git a/google/gapic/metadata/gapic_metadata_pb2.py b/google/gapic/metadata/gapic_metadata_pb2.py new file mode 100644 index 0000000..d4f587c --- /dev/null +++ b/google/gapic/metadata/gapic_metadata_pb2.py @@ -0,0 +1,601 @@ +# -*- coding: utf-8 -*- + +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/gapic/metadata/gapic_metadata.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/gapic/metadata/gapic_metadata.proto", + package="google.gapic.metadata", + syntax="proto3", + serialized_options=b"\n\031com.google.gapic.metadataB\022GapicMetadataProtoP\001Z=google.golang.org/genproto/googleapis/gapic/metadata;metadata\252\002\025Google.Gapic.Metadata\312\002\025Google\\Gapic\\Metadata\352\002\027Google::Gapic::Metadata", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n*google/gapic/metadata/gapic_metadata.proto\x12\x15google.gapic.metadata"\xf0\x05\n\rGapicMetadata\x12\x0e\n\x06schema\x18\x01 \x01(\t\x12\x0f\n\x07\x63omment\x18\x02 \x01(\t\x12\x10\n\x08language\x18\x03 \x01(\t\x12\x15\n\rproto_package\x18\x04 \x01(\t\x12\x17\n\x0flibrary_package\x18\x05 \x01(\t\x12\x44\n\x08services\x18\x06 \x03(\x0b\x32\x32.google.gapic.metadata.GapicMetadata.ServicesEntry\x1ai\n\rServicesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.gapic.metadata.GapicMetadata.ServiceForTransport:\x02\x38\x01\x1a\xd3\x01\n\x13ServiceForTransport\x12V\n\x07\x63lients\x18\x01 \x03(\x0b\x32\x45.google.gapic.metadata.GapicMetadata.ServiceForTransport.ClientsEntry\x1a\x64\n\x0c\x43lientsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x43\n\x05value\x18\x02 \x01(\x0b\x32\x34.google.gapic.metadata.GapicMetadata.ServiceAsClient:\x02\x38\x01\x1a\xd5\x01\n\x0fServiceAsClient\x12\x16\n\x0elibrary_client\x18\x01 \x01(\t\x12L\n\x04rpcs\x18\x02 \x03(\x0b\x32>.google.gapic.metadata.GapicMetadata.ServiceAsClient.RpcsEntry\x1a\\\n\tRpcsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12>\n\x05value\x18\x02 \x01(\x0b\x32/.google.gapic.metadata.GapicMetadata.MethodList:\x02\x38\x01\x1a\x1d\n\nMethodList\x12\x0f\n\x07methods\x18\x01 \x03(\tB\xba\x01\n\x19\x63om.google.gapic.metadataB\x12GapicMetadataProtoP\x01Z=google.golang.org/genproto/googleapis/gapic/metadata;metadata\xaa\x02\x15Google.Gapic.Metadata\xca\x02\x15Google\\Gapic\\Metadata\xea\x02\x17Google::Gapic::Metadatab\x06proto3', +) + + +_GAPICMETADATA_SERVICESENTRY = _descriptor.Descriptor( + name="ServicesEntry", + full_name="google.gapic.metadata.GapicMetadata.ServicesEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.gapic.metadata.GapicMetadata.ServicesEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.gapic.metadata.GapicMetadata.ServicesEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=256, + serialized_end=361, +) + +_GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY = _descriptor.Descriptor( + name="ClientsEntry", + full_name="google.gapic.metadata.GapicMetadata.ServiceForTransport.ClientsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.gapic.metadata.GapicMetadata.ServiceForTransport.ClientsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.gapic.metadata.GapicMetadata.ServiceForTransport.ClientsEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=475, + serialized_end=575, +) + +_GAPICMETADATA_SERVICEFORTRANSPORT = _descriptor.Descriptor( + name="ServiceForTransport", + full_name="google.gapic.metadata.GapicMetadata.ServiceForTransport", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="clients", + full_name="google.gapic.metadata.GapicMetadata.ServiceForTransport.clients", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ) + ], + extensions=[], + nested_types=[_GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=364, + serialized_end=575, +) + +_GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY = _descriptor.Descriptor( + name="RpcsEntry", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient.RpcsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient.RpcsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient.RpcsEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=699, + serialized_end=791, +) + +_GAPICMETADATA_SERVICEASCLIENT = _descriptor.Descriptor( + name="ServiceAsClient", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="library_client", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient.library_client", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="rpcs", + full_name="google.gapic.metadata.GapicMetadata.ServiceAsClient.rpcs", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[_GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=578, + serialized_end=791, +) + +_GAPICMETADATA_METHODLIST = _descriptor.Descriptor( + name="MethodList", + full_name="google.gapic.metadata.GapicMetadata.MethodList", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="methods", + full_name="google.gapic.metadata.GapicMetadata.MethodList.methods", + index=0, + number=1, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=793, + serialized_end=822, +) + +_GAPICMETADATA = _descriptor.Descriptor( + name="GapicMetadata", + full_name="google.gapic.metadata.GapicMetadata", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="schema", + full_name="google.gapic.metadata.GapicMetadata.schema", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="comment", + full_name="google.gapic.metadata.GapicMetadata.comment", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="language", + full_name="google.gapic.metadata.GapicMetadata.language", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="proto_package", + full_name="google.gapic.metadata.GapicMetadata.proto_package", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="library_package", + full_name="google.gapic.metadata.GapicMetadata.library_package", + index=4, + number=5, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="services", + full_name="google.gapic.metadata.GapicMetadata.services", + index=5, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _GAPICMETADATA_SERVICESENTRY, + _GAPICMETADATA_SERVICEFORTRANSPORT, + _GAPICMETADATA_SERVICEASCLIENT, + _GAPICMETADATA_METHODLIST, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=70, + serialized_end=822, +) + +_GAPICMETADATA_SERVICESENTRY.fields_by_name[ + "value" +].message_type = _GAPICMETADATA_SERVICEFORTRANSPORT +_GAPICMETADATA_SERVICESENTRY.containing_type = _GAPICMETADATA +_GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY.fields_by_name[ + "value" +].message_type = _GAPICMETADATA_SERVICEASCLIENT +_GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY.containing_type = ( + _GAPICMETADATA_SERVICEFORTRANSPORT +) +_GAPICMETADATA_SERVICEFORTRANSPORT.fields_by_name[ + "clients" +].message_type = _GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY +_GAPICMETADATA_SERVICEFORTRANSPORT.containing_type = _GAPICMETADATA +_GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY.fields_by_name[ + "value" +].message_type = _GAPICMETADATA_METHODLIST +_GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY.containing_type = ( + _GAPICMETADATA_SERVICEASCLIENT +) +_GAPICMETADATA_SERVICEASCLIENT.fields_by_name[ + "rpcs" +].message_type = _GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY +_GAPICMETADATA_SERVICEASCLIENT.containing_type = _GAPICMETADATA +_GAPICMETADATA_METHODLIST.containing_type = _GAPICMETADATA +_GAPICMETADATA.fields_by_name["services"].message_type = _GAPICMETADATA_SERVICESENTRY +DESCRIPTOR.message_types_by_name["GapicMetadata"] = _GAPICMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +GapicMetadata = _reflection.GeneratedProtocolMessageType( + "GapicMetadata", + (_message.Message,), + { + "ServicesEntry": _reflection.GeneratedProtocolMessageType( + "ServicesEntry", + (_message.Message,), + { + "DESCRIPTOR": _GAPICMETADATA_SERVICESENTRY, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.ServicesEntry) + }, + ), + "ServiceForTransport": _reflection.GeneratedProtocolMessageType( + "ServiceForTransport", + (_message.Message,), + { + "ClientsEntry": _reflection.GeneratedProtocolMessageType( + "ClientsEntry", + (_message.Message,), + { + "DESCRIPTOR": _GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.ServiceForTransport.ClientsEntry) + }, + ), + "DESCRIPTOR": _GAPICMETADATA_SERVICEFORTRANSPORT, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.ServiceForTransport) + }, + ), + "ServiceAsClient": _reflection.GeneratedProtocolMessageType( + "ServiceAsClient", + (_message.Message,), + { + "RpcsEntry": _reflection.GeneratedProtocolMessageType( + "RpcsEntry", + (_message.Message,), + { + "DESCRIPTOR": _GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.ServiceAsClient.RpcsEntry) + }, + ), + "DESCRIPTOR": _GAPICMETADATA_SERVICEASCLIENT, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.ServiceAsClient) + }, + ), + "MethodList": _reflection.GeneratedProtocolMessageType( + "MethodList", + (_message.Message,), + { + "DESCRIPTOR": _GAPICMETADATA_METHODLIST, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata.MethodList) + }, + ), + "DESCRIPTOR": _GAPICMETADATA, + "__module__": "google.gapic.metadata.gapic_metadata_pb2" + # @@protoc_insertion_point(class_scope:google.gapic.metadata.GapicMetadata) + }, +) +_sym_db.RegisterMessage(GapicMetadata) +_sym_db.RegisterMessage(GapicMetadata.ServicesEntry) +_sym_db.RegisterMessage(GapicMetadata.ServiceForTransport) +_sym_db.RegisterMessage(GapicMetadata.ServiceForTransport.ClientsEntry) +_sym_db.RegisterMessage(GapicMetadata.ServiceAsClient) +_sym_db.RegisterMessage(GapicMetadata.ServiceAsClient.RpcsEntry) +_sym_db.RegisterMessage(GapicMetadata.MethodList) + + +DESCRIPTOR._options = None +_GAPICMETADATA_SERVICESENTRY._options = None +_GAPICMETADATA_SERVICEFORTRANSPORT_CLIENTSENTRY._options = None +_GAPICMETADATA_SERVICEASCLIENT_RPCSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/longrunning/operations.proto b/google/longrunning/operations.proto index c12a369..299eefb 100644 --- a/google/longrunning/operations.proto +++ b/google/longrunning/operations.proto @@ -1,10 +1,10 @@ -// Copyright 2016 Google Inc. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -17,11 +17,14 @@ syntax = "proto3"; package google.longrunning; import "google/api/annotations.proto"; +import "google/api/client.proto"; import "google/protobuf/any.proto"; -import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/rpc/status.proto"; +import "google/protobuf/descriptor.proto"; +option cc_enable_arenas = true; option csharp_namespace = "Google.LongRunning"; option go_package = "google.golang.org/genproto/googleapis/longrunning;longrunning"; option java_multiple_files = true; @@ -29,6 +32,15 @@ option java_outer_classname = "OperationsProto"; option java_package = "com.google.longrunning"; option php_namespace = "Google\\LongRunning"; +extend google.protobuf.MethodOptions { + // Additional information regarding long-running operations. + // In particular, this specifies the types that are returned from + // long-running operations. + // + // Required for methods that return `google.longrunning.Operation`; invalid + // otherwise. + google.longrunning.OperationInfo operation_info = 1049; +} // Manages long-running operations with an API service. // @@ -40,20 +52,33 @@ option php_namespace = "Google\\LongRunning"; // returns long-running operations should implement the `Operations` interface // so developers can have a consistent client experience. service Operations { + option (google.api.default_host) = "longrunning.googleapis.com"; + // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // - // NOTE: the `name` binding below allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. + // NOTE: the `name` binding allows API services to override the binding + // to use different resource name schemes, such as `users/*/operations`. To + // override the binding, API services can add a binding such as + // `"/v1/{name=users/*}/operations"` to their service configuration. + // For backwards compatibility, the default name includes the operations + // collection id, however overriding users must ensure the name binding + // is the parent resource, without the operations collection id. rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { get: "/v1/{name=operations}" }; + option (google.api.http) = { + get: "/v1/{name=operations}" + }; + option (google.api.method_signature) = "name,filter"; } // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { get: "/v1/{name=operations/**}" }; + option (google.api.http) = { + get: "/v1/{name=operations/**}" + }; + option (google.api.method_signature) = "name"; } // Deletes a long-running operation. This method indicates that the client is @@ -61,7 +86,10 @@ service Operations { // operation. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. rpc DeleteOperation(DeleteOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v1/{name=operations/**}" }; + option (google.api.http) = { + delete: "/v1/{name=operations/**}" + }; + option (google.api.method_signature) = "name"; } // Starts asynchronous cancellation on a long-running operation. The server @@ -75,7 +103,23 @@ service Operations { // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { post: "/v1/{name=operations/**}:cancel" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=operations/**}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Waits for the specified long-running operation until it is done or reaches + // at most a specified timeout, returning the latest state. If the operation + // is already done, the latest state is immediately returned. If the timeout + // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + // timeout is used. If the server does not support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + // Note that this method is on a best-effort basis. It may return the latest + // state before the specified timeout (including immediately), meaning even an + // immediate response is no guarantee that the operation is done. + rpc WaitOperation(WaitOperationRequest) returns (Operation) { } } @@ -84,7 +128,7 @@ service Operations { message Operation { // The server-assigned name, which is only unique within the same service that // originally returns it. If you use the default HTTP mapping, the - // `name` should have the format of `operations/some/unique/name`. + // `name` should be a resource name ending with `operations/{unique_id}`. string name = 1; // Service-specific metadata associated with the operation. It typically @@ -94,7 +138,7 @@ message Operation { google.protobuf.Any metadata = 2; // If the value is `false`, it means the operation is still in progress. - // If true, the operation is completed, and either `error` or `response` is + // If `true`, the operation is completed, and either `error` or `response` is // available. bool done = 3; @@ -125,7 +169,7 @@ message GetOperationRequest { // The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. message ListOperationsRequest { - // The name of the operation collection. + // The name of the operation's parent resource. string name = 4; // The standard list filter. @@ -159,6 +203,17 @@ message DeleteOperationRequest { string name = 1; } +// The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. +message WaitOperationRequest { + // The name of the operation resource to wait on. + string name = 1; + + // The maximum duration to wait before timing out. If left blank, the wait + // will be at most the time permitted by the underlying HTTP/RPC protocol. + // If RPC context deadline is also specified, the shorter one will be used. + google.protobuf.Duration timeout = 2; +} + // A message representing the message types used by a long-running operation. // // Example: @@ -190,13 +245,3 @@ message OperationInfo { // Note: Altering this value constitutes a breaking change. string metadata_type = 2; } - -extend google.protobuf.MethodOptions { - // Additional information regarding long-running operations. - // In particular, this specifies the types that are returned from - // long-running operations. - // - // Required for methods that return `google.longrunning.Operation`; invalid - // otherwise. - OperationInfo operation_info = 1049; -} diff --git a/google/longrunning/operations_pb2_grpc.py b/google/longrunning/operations_pb2_grpc.py index 9e8fb60..5d010a3 100644 --- a/google/longrunning/operations_pb2_grpc.py +++ b/google/longrunning/operations_pb2_grpc.py @@ -1,17 +1,3 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # Copyright 2020 Google LLC # @@ -29,7 +15,6 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! - """Client and server classes corresponding to protobuf-defined services.""" import grpc @@ -77,6 +62,11 @@ def __init__(self, channel): request_serializer=google_dot_longrunning_dot_operations__pb2.CancelOperationRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) + self.WaitOperation = channel.unary_unary( + "/google.longrunning.Operations/WaitOperation", + request_serializer=google_dot_longrunning_dot_operations__pb2.WaitOperationRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) class OperationsServicer(object): @@ -95,8 +85,13 @@ def ListOperations(self, request, context): """Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. - NOTE: the `name` binding below allows API services to override the binding - to use different resource name schemes, such as `users/*/operations`. + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") @@ -137,6 +132,21 @@ def CancelOperation(self, request, context): context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") + def WaitOperation(self, request, context): + """Waits for the specified long-running operation until it is done or reaches + at most a specified timeout, returning the latest state. If the operation + is already done, the latest state is immediately returned. If the timeout + specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + timeout is used. If the server does not support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + Note that this method is on a best-effort basis. It may return the latest + state before the specified timeout (including immediately), meaning even an + immediate response is no guarantee that the operation is done. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + def add_OperationsServicer_to_server(servicer, server): rpc_method_handlers = { @@ -160,6 +170,11 @@ def add_OperationsServicer_to_server(servicer, server): request_deserializer=google_dot_longrunning_dot_operations__pb2.CancelOperationRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + "WaitOperation": grpc.unary_unary_rpc_method_handler( + servicer.WaitOperation, + request_deserializer=google_dot_longrunning_dot_operations__pb2.WaitOperationRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( "google.longrunning.Operations", rpc_method_handlers @@ -295,3 +310,32 @@ def CancelOperation( timeout, metadata, ) + + @staticmethod + def WaitOperation( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.longrunning.Operations/WaitOperation", + google_dot_longrunning_dot_operations__pb2.WaitOperationRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/google/longrunning/operations_proto_pb2.py b/google/longrunning/operations_proto_pb2.py index 080038f..d22ee0e 100644 --- a/google/longrunning/operations_proto_pb2.py +++ b/google/longrunning/operations_proto_pb2.py @@ -28,25 +28,29 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name="google/longrunning/operations.proto", package="google.longrunning", syntax="proto3", - serialized_options=b"\n\026com.google.longrunningB\017OperationsProtoP\001Z=google.golang.org/genproto/googleapis/longrunning;longrunning\252\002\022Google.LongRunning\312\002\022Google\\LongRunning", + serialized_options=b"\n\026com.google.longrunningB\017OperationsProtoP\001Z=google.golang.org/genproto/googleapis/longrunning;longrunning\370\001\001\252\002\022Google.LongRunning\312\002\022Google\\LongRunning", create_key=_descriptor._internal_create_key, - serialized_pb=b'\n#google/longrunning/operations.proto\x12\x12google.longrunning\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/protobuf/any.proto\x1a google/protobuf/descriptor.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto"\xa8\x01\n\tOperation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x08metadata\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04\x64one\x18\x03 \x01(\x08\x12#\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12(\n\x08response\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x08\n\x06result"#\n\x13GetOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\\\n\x15ListOperationsRequest\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"d\n\x16ListOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"&\n\x16\x43\x61ncelOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16\x44\x65leteOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"=\n\rOperationInfo\x12\x15\n\rresponse_type\x18\x01 \x01(\t\x12\x15\n\rmetadata_type\x18\x02 \x01(\t2\x8c\x04\n\nOperations\x12\x86\x01\n\x0eListOperations\x12).google.longrunning.ListOperationsRequest\x1a*.google.longrunning.ListOperationsResponse"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=operations}\x12x\n\x0cGetOperation\x12\'.google.longrunning.GetOperationRequest\x1a\x1d.google.longrunning.Operation" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=operations/**}\x12w\n\x0f\x44\x65leteOperation\x12*.google.longrunning.DeleteOperationRequest\x1a\x16.google.protobuf.Empty" \x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=operations/**}\x12\x81\x01\n\x0f\x43\x61ncelOperation\x12*.google.longrunning.CancelOperationRequest\x1a\x16.google.protobuf.Empty"*\x82\xd3\xe4\x93\x02$"\x1f/v1/{name=operations/**}:cancel:\x01*:Z\n\x0eoperation_info\x12\x1e.google.protobuf.MethodOptions\x18\x99\x08 \x01(\x0b\x32!.google.longrunning.OperationInfoB\x94\x01\n\x16\x63om.google.longrunningB\x0fOperationsProtoP\x01Z=google.golang.org/genproto/googleapis/longrunning;longrunning\xaa\x02\x12Google.LongRunning\xca\x02\x12Google\\LongRunningb\x06proto3', + serialized_pb=b'\n#google/longrunning/operations.proto\x12\x12google.longrunning\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a google/protobuf/descriptor.proto"\xa8\x01\n\tOperation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x08metadata\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04\x64one\x18\x03 \x01(\x08\x12#\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12(\n\x08response\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x08\n\x06result"#\n\x13GetOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\\\n\x15ListOperationsRequest\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"d\n\x16ListOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"&\n\x16\x43\x61ncelOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16\x44\x65leteOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"P\n\x14WaitOperationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x07timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"=\n\rOperationInfo\x12\x15\n\rresponse_type\x18\x01 \x01(\t\x12\x15\n\rmetadata_type\x18\x02 \x01(\t2\xaa\x05\n\nOperations\x12\x94\x01\n\x0eListOperations\x12).google.longrunning.ListOperationsRequest\x1a*.google.longrunning.ListOperationsResponse"+\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=operations}\xda\x41\x0bname,filter\x12\x7f\n\x0cGetOperation\x12\'.google.longrunning.GetOperationRequest\x1a\x1d.google.longrunning.Operation"\'\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=operations/**}\xda\x41\x04name\x12~\n\x0f\x44\x65leteOperation\x12*.google.longrunning.DeleteOperationRequest\x1a\x16.google.protobuf.Empty"\'\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=operations/**}\xda\x41\x04name\x12\x88\x01\n\x0f\x43\x61ncelOperation\x12*.google.longrunning.CancelOperationRequest\x1a\x16.google.protobuf.Empty"1\x82\xd3\xe4\x93\x02$"\x1f/v1/{name=operations/**}:cancel:\x01*\xda\x41\x04name\x12Z\n\rWaitOperation\x12(.google.longrunning.WaitOperationRequest\x1a\x1d.google.longrunning.Operation"\x00\x1a\x1d\xca\x41\x1alongrunning.googleapis.com:Z\n\x0eoperation_info\x12\x1e.google.protobuf.MethodOptions\x18\x99\x08 \x01(\x0b\x32!.google.longrunning.OperationInfoB\x97\x01\n\x16\x63om.google.longrunningB\x0fOperationsProtoP\x01Z=google.golang.org/genproto/googleapis/longrunning;longrunning\xf8\x01\x01\xaa\x02\x12Google.LongRunning\xca\x02\x12Google\\LongRunningb\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR, + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, google_dot_rpc_dot_status__pb2.DESCRIPTOR, + google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR, ], ) @@ -194,8 +198,8 @@ fields=[], ) ], - serialized_start=205, - serialized_end=373, + serialized_start=262, + serialized_end=430, ) @@ -235,8 +239,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=375, - serialized_end=410, + serialized_start=432, + serialized_end=467, ) @@ -333,8 +337,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=412, - serialized_end=504, + serialized_start=469, + serialized_end=561, ) @@ -393,8 +397,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=506, - serialized_end=606, + serialized_start=563, + serialized_end=663, ) @@ -434,8 +438,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=608, - serialized_end=646, + serialized_start=665, + serialized_end=703, ) @@ -475,8 +479,68 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=648, - serialized_end=686, + serialized_start=705, + serialized_end=743, +) + + +_WAITOPERATIONREQUEST = _descriptor.Descriptor( + name="WaitOperationRequest", + full_name="google.longrunning.WaitOperationRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.longrunning.WaitOperationRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="timeout", + full_name="google.longrunning.WaitOperationRequest.timeout", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=745, + serialized_end=825, ) @@ -535,8 +599,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=688, - serialized_end=749, + serialized_start=827, + serialized_end=888, ) _OPERATION.fields_by_name[ @@ -555,12 +619,16 @@ "result" ] _LISTOPERATIONSRESPONSE.fields_by_name["operations"].message_type = _OPERATION +_WAITOPERATIONREQUEST.fields_by_name[ + "timeout" +].message_type = google_dot_protobuf_dot_duration__pb2._DURATION DESCRIPTOR.message_types_by_name["Operation"] = _OPERATION DESCRIPTOR.message_types_by_name["GetOperationRequest"] = _GETOPERATIONREQUEST DESCRIPTOR.message_types_by_name["ListOperationsRequest"] = _LISTOPERATIONSREQUEST DESCRIPTOR.message_types_by_name["ListOperationsResponse"] = _LISTOPERATIONSRESPONSE DESCRIPTOR.message_types_by_name["CancelOperationRequest"] = _CANCELOPERATIONREQUEST DESCRIPTOR.message_types_by_name["DeleteOperationRequest"] = _DELETEOPERATIONREQUEST +DESCRIPTOR.message_types_by_name["WaitOperationRequest"] = _WAITOPERATIONREQUEST DESCRIPTOR.message_types_by_name["OperationInfo"] = _OPERATIONINFO DESCRIPTOR.extensions_by_name["operation_info"] = operation_info _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -631,6 +699,17 @@ ) _sym_db.RegisterMessage(DeleteOperationRequest) +WaitOperationRequest = _reflection.GeneratedProtocolMessageType( + "WaitOperationRequest", + (_message.Message,), + { + "DESCRIPTOR": _WAITOPERATIONREQUEST, + "__module__": "google.longrunning.operations_pb2" + # @@protoc_insertion_point(class_scope:google.longrunning.WaitOperationRequest) + }, +) +_sym_db.RegisterMessage(WaitOperationRequest) + OperationInfo = _reflection.GeneratedProtocolMessageType( "OperationInfo", (_message.Message,), @@ -652,10 +731,10 @@ full_name="google.longrunning.Operations", file=DESCRIPTOR, index=0, - serialized_options=None, + serialized_options=b"\312A\032longrunning.googleapis.com", create_key=_descriptor._internal_create_key, - serialized_start=752, - serialized_end=1276, + serialized_start=891, + serialized_end=1573, methods=[ _descriptor.MethodDescriptor( name="ListOperations", @@ -664,7 +743,7 @@ containing_service=None, input_type=_LISTOPERATIONSREQUEST, output_type=_LISTOPERATIONSRESPONSE, - serialized_options=b"\202\323\344\223\002\027\022\025/v1/{name=operations}", + serialized_options=b"\202\323\344\223\002\027\022\025/v1/{name=operations}\332A\013name,filter", create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( @@ -674,7 +753,7 @@ containing_service=None, input_type=_GETOPERATIONREQUEST, output_type=_OPERATION, - serialized_options=b"\202\323\344\223\002\032\022\030/v1/{name=operations/**}", + serialized_options=b"\202\323\344\223\002\032\022\030/v1/{name=operations/**}\332A\004name", create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( @@ -684,7 +763,7 @@ containing_service=None, input_type=_DELETEOPERATIONREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=b"\202\323\344\223\002\032*\030/v1/{name=operations/**}", + serialized_options=b"\202\323\344\223\002\032*\030/v1/{name=operations/**}\332A\004name", create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( @@ -694,7 +773,17 @@ containing_service=None, input_type=_CANCELOPERATIONREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=b'\202\323\344\223\002$"\037/v1/{name=operations/**}:cancel:\001*', + serialized_options=b'\202\323\344\223\002$"\037/v1/{name=operations/**}:cancel:\001*\332A\004name', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="WaitOperation", + full_name="google.longrunning.Operations.WaitOperation", + index=4, + containing_service=None, + input_type=_WAITOPERATIONREQUEST, + output_type=_OPERATION, + serialized_options=None, create_key=_descriptor._internal_create_key, ), ], diff --git a/google/type/latlng.proto b/google/type/latlng.proto index 473856f..a90b7c2 100644 --- a/google/type/latlng.proto +++ b/google/type/latlng.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -24,8 +23,8 @@ option java_outer_classname = "LatLngProto"; option java_package = "com.google.type"; option objc_class_prefix = "GTP"; -// An object representing a latitude/longitude pair. This is expressed as a pair -// of doubles representing degrees latitude and degrees longitude. Unless +// An object that represents a latitude/longitude pair. This is expressed as a +// pair of doubles to represent degrees latitude and degrees longitude. Unless // specified otherwise, this must conform to the // WGS84 // standard. Values must be within normalized ranges. diff --git a/setup.py b/setup.py index b8046e6..ea4dfb9 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,11 @@ import os import setuptools -from setuptools import setup, find_packages + name = "googleapis-common-protos" description = "Common protobufs used in Google APIs" -version = "1.53.0.dev1" +version = "1.53.0" release_status = "Development Status :: 5 - Production/Stable" dependencies = ["protobuf >= 3.12.0"] @@ -32,6 +32,11 @@ with io.open(readme_filename, encoding="utf-8") as readme_file: readme = readme_file.read() +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] setuptools.setup( name=name, @@ -56,7 +61,7 @@ install_requires=dependencies, extras_require=extras_require, license="Apache-2.0", - packages=find_packages(), + packages=packages, package_data={"": ["*.proto"]}, python_requires=">=3.6", namespace_packages=["google", "google.logging"], diff --git a/synth.metadata b/synth.metadata index e9f40ac..95afa65 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,125 +3,38 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/python-api-common-protos.git", - "sha": "d7a3099cb04ac1d27e9fc04bb920d2025498b95e" + "remote": "git@github.com:googleapis/python-api-common-protos", + "sha": "05910ad3b74e59b27351d6dc2dea173639daea1c" } }, { "git": { "name": "api-common-protos", "remote": "https://github.com/googleapis/api-common-protos.git", - "sha": "0fcae75a2c20a140137e3a9c48a87d15ceffabd7" + "sha": "f37c0ecc55f19b1675448e4bad70fd45c93f5b8f" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2a9e7295e6fe864d0a748ff5a7c44d2da6e6d15a", + "internalRef": "359531616" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b259489b06b25f399768b74b8baa943991f38ea7" + "sha": "0199c79b8324fba66476300824aa931788c47e2d" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b259489b06b25f399768b74b8baa943991f38ea7" + "sha": "0199c79b8324fba66476300824aa931788c47e2d" } } - ], - "generatedFiles": [ - ".github/CONTRIBUTING.md", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/snippet-bot.yml", - ".kokoro/build.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/continuous.cfg", - ".kokoro/docker/docs/Dockerfile", - ".kokoro/docker/docs/fetch_gpg_keys.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/presubmit.cfg", - ".kokoro/release.sh", - ".kokoro/release/common.cfg", - ".kokoro/release/release.cfg", - ".kokoro/samples/lint/common.cfg", - ".kokoro/samples/lint/continuous.cfg", - ".kokoro/samples/lint/periodic.cfg", - ".kokoro/samples/lint/presubmit.cfg", - ".kokoro/samples/python3.6/common.cfg", - ".kokoro/samples/python3.6/continuous.cfg", - ".kokoro/samples/python3.6/periodic.cfg", - ".kokoro/samples/python3.6/presubmit.cfg", - ".kokoro/samples/python3.7/common.cfg", - ".kokoro/samples/python3.7/continuous.cfg", - ".kokoro/samples/python3.7/periodic.cfg", - ".kokoro/samples/python3.7/presubmit.cfg", - ".kokoro/samples/python3.8/common.cfg", - ".kokoro/samples/python3.8/continuous.cfg", - ".kokoro/samples/python3.8/periodic.cfg", - ".kokoro/samples/python3.8/presubmit.cfg", - ".kokoro/test-samples.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - "LICENSE", - "google/api/README.md", - "google/api/annotations.proto", - "google/api/auth.proto", - "google/api/backend.proto", - "google/api/billing.proto", - "google/api/client.proto", - "google/api/config_change.proto", - "google/api/consumer.proto", - "google/api/context.proto", - "google/api/control.proto", - "google/api/distribution.proto", - "google/api/documentation.proto", - "google/api/endpoint.proto", - "google/api/field_behavior.proto", - "google/api/http.proto", - "google/api/httpbody.proto", - "google/api/label.proto", - "google/api/launch_stage.proto", - "google/api/log.proto", - "google/api/logging.proto", - "google/api/metric.proto", - "google/api/monitored_resource.proto", - "google/api/monitoring.proto", - "google/api/quota.proto", - "google/api/resource.proto", - "google/api/service.proto", - "google/api/source_info.proto", - "google/api/system_parameter.proto", - "google/api/usage.proto", - "google/logging/type/README.md", - "google/logging/type/http_request.proto", - "google/logging/type/log_severity.proto", - "google/longrunning/README.md", - "google/longrunning/operations.proto", - "google/longrunning/operations_pb2_grpc.py", - "google/rpc/README.md", - "google/rpc/code.proto", - "google/rpc/context/attribute_context.proto", - "google/rpc/error_details.proto", - "google/rpc/status.proto", - "google/type/README.md", - "google/type/calendar_period.proto", - "google/type/color.proto", - "google/type/date.proto", - "google/type/datetime.proto", - "google/type/dayofweek.proto", - "google/type/expr.proto", - "google/type/fraction.proto", - "google/type/latlng.proto", - "google/type/money.proto", - "google/type/month.proto", - "google/type/postal_address.proto", - "google/type/quaternion.proto", - "google/type/timeofday.proto", - "setup.cfg" ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 329f493..9faecc1 100644 --- a/synth.py +++ b/synth.py @@ -21,21 +21,34 @@ from synthtool.sources import git API_COMMON_PROTOS_REPO = "googleapis/api-common-protos" +GOOGLEAPIS_REPO = "googleapis/googleapis" # ---------------------------------------------------------------------------- # Get api-common-protos # ---------------------------------------------------------------------------- # Use api-common-protos as a proper synthtool git source api_common_protos_url = git.make_repo_clone_url(API_COMMON_PROTOS_REPO) -api_common_protos = git.clone(api_common_protos_url) / "google" - +api_common_protos = git.clone(api_common_protos_url) excludes = [ # Exclude iam protos (they are released in a separate package) "iam/**/*", "**/BUILD.bazel", ] -s.copy(api_common_protos, excludes=excludes) +s.copy(api_common_protos / "google", excludes=excludes) + +# ---------------------------------------------------------------------------- +# Get gapic metadata proto from googleapis +# ---------------------------------------------------------------------------- + +# Use googleapis as a proper synthtool git source +googleapis_url = git.make_repo_clone_url(GOOGLEAPIS_REPO) +googleapis_protos = git.clone(googleapis_url) + +# Gapic metadata proto needed by gapic-generator-python +# Desired import is "from google.gapic.metadata import gapic_metadata_pb2" +s.copy(googleapis_protos / "gapic", "google/gapic", excludes=["lang/", "packaging/", "**/BUILD.bazel"],) + # ---------------------------------------------------------------------------- # Add templated files