From 8edeeb98def3e35ef025f24732cba2b3ed5f163b Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Wed, 6 Jan 2016 16:51:08 -0800 Subject: [PATCH] Replacing auxiliary proto files with googleapis-common-protos. --- Makefile | 26 +- gcloud/bigtable/_generated/_annotations.proto | 29 - gcloud/bigtable/_generated/_any.proto | 87 --- gcloud/bigtable/_generated/_duration.proto | 78 --- gcloud/bigtable/_generated/_empty.proto | 34 -- gcloud/bigtable/_generated/_http.proto | 127 ---- gcloud/bigtable/_generated/_status.proto | 88 --- gcloud/bigtable/_generated/_timestamp.proto | 89 --- gcloud/bigtable/_generated/annotations_pb2.py | 50 -- gcloud/bigtable/_generated/any_pb2.py | 82 --- .../_generated/bigtable_cluster_data_pb2.py | 6 +- .../bigtable_cluster_service_messages_pb2.py | 2 +- .../bigtable_cluster_service_pb2.py | 38 +- .../_generated/bigtable_service_pb2.py | 20 +- .../_generated/bigtable_table_data_pb2.py | 4 +- .../_generated/bigtable_table_service_pb2.py | 52 +- gcloud/bigtable/_generated/duration_pb2.py | 82 --- gcloud/bigtable/_generated/empty_pb2.py | 68 --- gcloud/bigtable/_generated/http_pb2.py | 193 ------- .../_generated/operations_grpc_pb2.py | 205 +++++++ gcloud/bigtable/_generated/operations_pb2.py | 543 ------------------ gcloud/bigtable/_generated/status_pb2.py | 92 --- gcloud/bigtable/_generated/timestamp_pb2.py | 82 --- gcloud/bigtable/client.py | 4 +- gcloud/bigtable/cluster.py | 17 +- gcloud/bigtable/column_family.py | 9 +- gcloud/bigtable/table.py | 4 +- gcloud/bigtable/test_cluster.py | 34 +- gcloud/bigtable/test_column_family.py | 20 +- gcloud/bigtable/test_table.py | 4 +- scripts/make_operations_grpc.py | 116 ++++ scripts/rewrite_imports.py | 39 +- setup.py | 3 +- 33 files changed, 439 insertions(+), 1888 deletions(-) delete mode 100644 gcloud/bigtable/_generated/_annotations.proto delete mode 100644 gcloud/bigtable/_generated/_any.proto delete mode 100644 gcloud/bigtable/_generated/_duration.proto delete mode 100644 gcloud/bigtable/_generated/_empty.proto delete mode 100644 gcloud/bigtable/_generated/_http.proto delete mode 100644 gcloud/bigtable/_generated/_status.proto delete mode 100644 gcloud/bigtable/_generated/_timestamp.proto delete mode 100644 gcloud/bigtable/_generated/annotations_pb2.py delete mode 100644 gcloud/bigtable/_generated/any_pb2.py delete mode 100644 gcloud/bigtable/_generated/duration_pb2.py delete mode 100644 gcloud/bigtable/_generated/empty_pb2.py delete mode 100644 gcloud/bigtable/_generated/http_pb2.py create mode 100644 gcloud/bigtable/_generated/operations_grpc_pb2.py delete mode 100644 gcloud/bigtable/_generated/operations_pb2.py delete mode 100644 gcloud/bigtable/_generated/status_pb2.py delete mode 100644 gcloud/bigtable/_generated/timestamp_pb2.py create mode 100644 scripts/make_operations_grpc.py diff --git a/Makefile b/Makefile index 8ee3c4cbe32a7..4aac66837cf5c 100644 --- a/Makefile +++ b/Makefile @@ -23,38 +23,18 @@ generate: --grpc_out=$(GENERATED_DIR) \ $(PROTOS_DIR)/google/bigtable/v1/*.proto \ $(PROTOS_DIR)/google/bigtable/admin/cluster/v1/*.proto \ - $(PROTOS_DIR)/google/bigtable/admin/table/v1/*.proto \ - $(PROTOS_DIR)/google/api/*.proto \ - $(PROTOS_DIR)/google/protobuf/any.proto \ - $(PROTOS_DIR)/google/protobuf/duration.proto \ - $(PROTOS_DIR)/google/protobuf/empty.proto \ - $(PROTOS_DIR)/google/protobuf/timestamp.proto \ - $(PROTOS_DIR)/google/longrunning/operations.proto \ - $(PROTOS_DIR)/google/rpc/status.proto + $(PROTOS_DIR)/google/bigtable/admin/table/v1/*.proto # Move the newly generated *_pb2.py files into our library. mv $(GENERATED_DIR)/google/bigtable/v1/* $(FINAL_DIR) mv $(GENERATED_DIR)/google/bigtable/admin/cluster/v1/* $(FINAL_DIR) mv $(GENERATED_DIR)/google/bigtable/admin/table/v1/* $(FINAL_DIR) - mv $(GENERATED_DIR)/google/api/* $(FINAL_DIR) - mv $(GENERATED_DIR)/google/protobuf/any_pb2.py $(FINAL_DIR) - mv $(GENERATED_DIR)/google/protobuf/duration_pb2.py $(FINAL_DIR) - mv $(GENERATED_DIR)/google/protobuf/empty_pb2.py $(FINAL_DIR) - mv $(GENERATED_DIR)/google/protobuf/timestamp_pb2.py $(FINAL_DIR) - mv $(GENERATED_DIR)/google/longrunning/operations_pb2.py $(FINAL_DIR) - mv $(GENERATED_DIR)/google/rpc/status_pb2.py $(FINAL_DIR) # Remove all existing *.proto files before we replace rm -f $(FINAL_DIR)/*.proto # Copy over the *.proto files into our library. cp $(PROTOS_DIR)/google/bigtable/v1/*.proto $(FINAL_DIR) cp $(PROTOS_DIR)/google/bigtable/admin/cluster/v1/*.proto $(FINAL_DIR) cp $(PROTOS_DIR)/google/bigtable/admin/table/v1/*.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/api/*.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/protobuf/any.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/protobuf/duration.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/protobuf/empty.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/protobuf/timestamp.proto $(FINAL_DIR) cp $(PROTOS_DIR)/google/longrunning/operations.proto $(FINAL_DIR) - cp $(PROTOS_DIR)/google/rpc/status.proto $(FINAL_DIR) # Rename all *.proto files in our library with an # underscore and remove executable bit. cd $(FINAL_DIR) && \ @@ -62,6 +42,10 @@ generate: chmod -x $$filename ; \ mv $$filename _$$filename ; \ done + # Separate the gRPC parts of the operations service from the + # non-gRPC parts so that the protos from `googleapis-common-protos` + # can be used without gRPC. + python scripts/make_operations_grpc.py # Rewrite the imports in the generated *_pb2.py files. python scripts/rewrite_imports.py diff --git a/gcloud/bigtable/_generated/_annotations.proto b/gcloud/bigtable/_generated/_annotations.proto deleted file mode 100644 index cbd18b847f39e..0000000000000 --- a/gcloud/bigtable/_generated/_annotations.proto +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/gcloud/bigtable/_generated/_any.proto b/gcloud/bigtable/_generated/_any.proto deleted file mode 100644 index 7c79e57686029..0000000000000 --- a/gcloud/bigtable/_generated/_any.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.protobuf; - -option java_generate_equals_and_hash = true; -option java_multiple_files = true; -option java_outer_classname = "AnyProto"; -option java_package = "com.google.protobuf"; - - -// `Any` contains an arbitrary serialized message along with a URL -// that describes the type of the serialized message. -// -// The proto runtimes and/or compiler will eventually -// provide utilities to pack/unpack Any values (projected Q1/15). -// -// # JSON -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the the `@type` -// field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name whose content describes the type of the - // serialized message. - // - // For URLs which use the schema `http`, `https`, or no schema, the - // following restrictions and interpretations apply: - // - // * If no schema is provided, `https` is assumed. - // * The last segment of the URL's path must represent the fully - // qualified name of the type (as in `path/google.protobuf.Duration`). - // * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Schemas other than `http`, `https` (or the empty schema) might be - // used with implementation specific semantics. - // - // Types originating from the `google.*` package - // namespace should use `type.googleapis.com/full.type.name` (without - // schema and path). A type service will eventually become available which - // serves those URLs (projected Q2/15). - string type_url = 1; - - // Must be valid serialized data of the above specified type. - bytes value = 2; -} diff --git a/gcloud/bigtable/_generated/_duration.proto b/gcloud/bigtable/_generated/_duration.proto deleted file mode 100644 index 15e9d44d3b382..0000000000000 --- a/gcloud/bigtable/_generated/_duration.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.protobuf; - -option java_generate_equals_and_hash = true; -option java_multiple_files = true; -option java_outer_classname = "DurationProto"; -option java_package = "com.google.protobuf"; - - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (durations.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} diff --git a/gcloud/bigtable/_generated/_empty.proto b/gcloud/bigtable/_generated/_empty.proto deleted file mode 100644 index 43b06e87bd688..0000000000000 --- a/gcloud/bigtable/_generated/_empty.proto +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.protobuf; - -option java_multiple_files = true; -option java_outer_classname = "EmptyProto"; -option java_package = "com.google.protobuf"; - - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -message Empty { - -} diff --git a/gcloud/bigtable/_generated/_http.proto b/gcloud/bigtable/_generated/_http.proto deleted file mode 100644 index ce07aa14f54fe..0000000000000 --- a/gcloud/bigtable/_generated/_http.proto +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.api; - -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; - - -// `HttpRule` defines the mapping of an RPC method to one or more HTTP REST API -// methods. The mapping determines what portions of the request message are -// populated from the path, query parameters, or body of the HTTP request. The -// mapping is typically specified as an `google.api.http` annotation, see -// "google/api/annotations.proto" for details. -// -// The mapping consists of a mandatory field specifying a path template and an -// optional `body` field specifying what data is represented in the HTTP request -// body. The field name for the path indicates the HTTP method. Example: -// -// ``` -// package google.storage.v2; -// -// import "google/api/annotations.proto"; -// -// service Storage { -// rpc CreateObject(CreateObjectRequest) returns (Object) { -// option (google.api.http) { -// post: "/v2/{bucket_name=buckets/*}/objects" -// body: "object" -// }; -// }; -// } -// ``` -// -// Here `bucket_name` and `object` bind to fields of the request message -// `CreateObjectRequest`. -// -// The rules for mapping HTTP path, query parameters, and body fields -// to the request message are as follows: -// -// 1. The `body` field specifies either `*` or a field path, or is -// omitted. If omitted, it assumes there is no HTTP body. -// 2. Leaf fields (recursive expansion of nested messages in the -// request) can be classified into three types: -// (a) Matched in the URL template. -// (b) Covered by body (if body is `*`, everything except (a) fields; -// else everything under the body field) -// (c) All other fields. -// 3. URL query parameters found in the HTTP request are mapped to (c) fields. -// 4. Any body sent with an HTTP request can contain only (b) fields. -// -// The syntax of the path template is as follows: -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// `*` matches a single path component, `**` zero or more path components, and -// `LITERAL` a constant. A `Variable` can match an entire path as specified -// again by a template; this nested template must not contain further variables. -// If no template is given with a variable, it matches a single path component. -// The notation `{var}` is henceforth equivalent to `{var=*}`. -// -// Use CustomHttpPattern to specify any HTTP method that is not included in the -// pattern field, such as HEAD, or "*" to leave the HTTP method unspecified for -// a given URL path rule. The wild-card rule is useful for services that provide -// content to Web (HTML) clients. -message HttpRule { - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Used for listing and getting information about resources. - string get = 2; - - // Used for updating a resource. - string put = 3; - - // Used for creating a resource. - string post = 4; - - // Used for deleting a resource. - string delete = 5; - - // Used for updating a resource. - string patch = 6; - - // Custom pattern is used for defining custom verbs. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP body, or - // `*` for mapping all fields not captured by the path pattern to the HTTP - // body. - string body = 7; - - // Additional HTTP bindings for the selector. Nested bindings must not - // specify a selector and must not contain additional bindings. - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/gcloud/bigtable/_generated/_status.proto b/gcloud/bigtable/_generated/_status.proto deleted file mode 100644 index be97fa4eaeff3..0000000000000 --- a/gcloud/bigtable/_generated/_status.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.rpc; - -import "google/protobuf/any.proto"; - -option java_multiple_files = true; -option java_outer_classname = "StatusProto"; -option java_package = "com.google.rpc"; - - -// The `Status` defines a logical error model that is suitable for different -// programming environments, including REST APIs and RPC APIs. It is used by -// [gRPC](https://github.com/grpc). The error model is designed to be: -// -// - Simple to use and understand for most users. -// - Flexible enough to meet unexpected needs. -// -// # Overview -// The `Status` message contains 3 pieces of data: error code, error message, -// and error details. The error code should be an enum value of -// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The -// error message should be a developer-facing English message that helps -// developers *understand* and *resolve* the error. If a localized user-facing -// error message is needed, it can be sent in the error details or localized by -// the client. The optional error details may contain arbitrary information -// about the error. There is a predefined set of error detail types in the -// package `google.rpc` which can be used for common error conditions. -// -// # Language mapping -// The `Status` message is the logical representation of the error model, but it -// is not necessarily the actual wire format. When the `Status` message is -// exposed in different client libraries and different wire protocols, it can be -// mapped differently. For example, it will likely be mapped to some exceptions -// in Java, but more likely mapped to some error codes in C. -// -// # Other uses -// The error model and the `Status` message can be used in a variety of -// environments - either with or without APIs - to provide consistent developer -// experience across different environments. -// -// Example uses of this error model include: -// -// - Partial errors. If a service needs to return partial errors to the client, -// it may embed the `Status` in the normal response to indicate the partial -// errors. -// -// - Workflow errors. A typical workflow has multiple steps. Each step may -// have a `Status` message for error reporting purpose. -// -// - Batch operations. If a client uses batch request and batch response, the -// `Status` message should be used directly inside batch response, one for -// each error sub-response. -// -// - Asynchronous operations. If an API call embeds asynchronous operation -// results in its response, the status of those operations should be -// represented directly using the `Status` message. -// -// - Logging. If some API errors are stored in logs, the message `Status` could -// be used directly after any stripping needed for security/privacy reasons. -// -message Status { - // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - int32 code = 1; - - // A developer-facing error message, which should be in English. Any - // user-facing error message should be localized and sent in the - // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - string message = 2; - - // A list of messages that carry the error details. There will be a - // common set of message types for APIs to use. - repeated google.protobuf.Any details = 3; -} diff --git a/gcloud/bigtable/_generated/_timestamp.proto b/gcloud/bigtable/_generated/_timestamp.proto deleted file mode 100644 index b13585498795e..0000000000000 --- a/gcloud/bigtable/_generated/_timestamp.proto +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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.protobuf; - -option java_generate_equals_and_hash = true; -option java_multiple_files = true; -option java_outer_classname = "TimestampProto"; -option java_package = "com.google.protobuf"; - - -// A Timestamp represents a point in time independent of any time zone -// or calendar, represented as seconds and fractions of seconds at -// nanosecond resolution in UTC Epoch time. It is encoded using the -// Proleptic Gregorian Calendar which extends the Gregorian calendar -// backwards to year one. It is encoded assuming all minutes are 60 -// seconds long, i.e. leap seconds are "smeared" so that no leap second -// table is needed for interpretation. Range is from -// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. -// By restricting to that range, we ensure that we can convert to -// and from RFC 3339 date strings. -// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). -// -// Example 1: Compute Timestamp from POSIX `time()`. -// -// Timestamp timestamp; -// timestamp.set_seconds(time(NULL)); -// timestamp.set_nanos(0); -// -// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -// -// struct timeval tv; -// gettimeofday(&tv, NULL); -// -// Timestamp timestamp; -// timestamp.set_seconds(tv.tv_sec); -// timestamp.set_nanos(tv.tv_usec * 1000); -// -// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -// -// FILETIME ft; -// GetSystemTimeAsFileTime(&ft); -// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -// -// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -// Timestamp timestamp; -// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -// -// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -// -// long millis = System.currentTimeMillis(); -// -// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -// .setNanos((int) ((millis % 1000) * 1000000)).build(); -// -// Example 5: Compute Timestamp from Python `datetime.datetime`. -// -// now = datetime.datetime.utcnow() -// seconds = int(time.mktime(now.timetuple())) -// nanos = now.microsecond * 1000 -// timestamp = Timestamp(seconds=seconds, nanos=nanos) -// -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} diff --git a/gcloud/bigtable/_generated/annotations_pb2.py b/gcloud/bigtable/_generated/annotations_pb2.py deleted file mode 100644 index d6cf16a92a780..0000000000000 --- a/gcloud/bigtable/_generated/annotations_pb2.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/annotations.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from gcloud.bigtable._generated import http_pb2 as google_dot_api_dot_http__pb2 -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/api/annotations.proto', - package='google.api', - syntax='proto3', - serialized_pb=b'\n\x1cgoogle/api/annotations.proto\x12\ngoogle.api\x1a\x15google/api/http.proto\x1a google/protobuf/descriptor.proto:E\n\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0\xca\xbc\" \x01(\x0b\x32\x14.google.api.HttpRuleB$\n\x0e\x63om.google.apiB\x10\x41nnotationsProtoP\x01\x62\x06proto3' - , - dependencies=[google_dot_api_dot_http__pb2.DESCRIPTOR,google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -HTTP_FIELD_NUMBER = 72295728 -http = _descriptor.FieldDescriptor( - name='http', full_name='google.api.http', index=0, - number=72295728, 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=True, extension_scope=None, - options=None) - -DESCRIPTOR.extensions_by_name['http'] = http - -http.message_type = google_dot_api_dot_http__pb2._HTTPRULE -google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(http) - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\016com.google.apiB\020AnnotationsProtoP\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/any_pb2.py b/gcloud/bigtable/_generated/any_pb2.py deleted file mode 100644 index 862ab1e2d88ca..0000000000000 --- a/gcloud/bigtable/_generated/any_pb2.py +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/any.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/protobuf/any.proto', - package='google.protobuf', - syntax='proto3', - serialized_pb=b'\n\x19google/protobuf/any.proto\x12\x0fgoogle.protobuf\"&\n\x03\x41ny\x12\x10\n\x08type_url\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\x42$\n\x13\x63om.google.protobufB\x08\x41nyProtoP\x01\xa0\x01\x01\x62\x06proto3' -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_ANY = _descriptor.Descriptor( - name='Any', - full_name='google.protobuf.Any', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type_url', full_name='google.protobuf.Any.type_url', 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, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='google.protobuf.Any.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=46, - serialized_end=84, -) - -DESCRIPTOR.message_types_by_name['Any'] = _ANY - -Any = _reflection.GeneratedProtocolMessageType('Any', (_message.Message,), dict( - DESCRIPTOR = _ANY, - __module__ = 'google.protobuf.any_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Any) - )) -_sym_db.RegisterMessage(Any) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\023com.google.protobufB\010AnyProtoP\001\240\001\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/bigtable_cluster_data_pb2.py b/gcloud/bigtable/_generated/bigtable_cluster_data_pb2.py index f68c3c0661faa..cba895acf7b30 100644 --- a/gcloud/bigtable/_generated/bigtable_cluster_data_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_cluster_data_pb2.py @@ -12,9 +12,9 @@ _sym_db = _symbol_database.Default() -from gcloud.bigtable._generated import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from gcloud.bigtable._generated import operations_pb2 as google_dot_longrunning_dot_operations__pb2 -from gcloud.bigtable._generated import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 DESCRIPTOR = _descriptor.FileDescriptor( diff --git a/gcloud/bigtable/_generated/bigtable_cluster_service_messages_pb2.py b/gcloud/bigtable/_generated/bigtable_cluster_service_messages_pb2.py index c4af1b4b3b609..121e9bc7acefd 100644 --- a/gcloud/bigtable/_generated/bigtable_cluster_service_messages_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_cluster_service_messages_pb2.py @@ -12,7 +12,7 @@ from gcloud.bigtable._generated import bigtable_cluster_data_pb2 as google_dot_bigtable_dot_admin_dot_cluster_dot_v1_dot_bigtable__cluster__data__pb2 -from gcloud.bigtable._generated import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 DESCRIPTOR = _descriptor.FileDescriptor( diff --git a/gcloud/bigtable/_generated/bigtable_cluster_service_pb2.py b/gcloud/bigtable/_generated/bigtable_cluster_service_pb2.py index 86f3a071e372f..79ec4772038ff 100644 --- a/gcloud/bigtable/_generated/bigtable_cluster_service_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_cluster_service_pb2.py @@ -11,11 +11,11 @@ _sym_db = _symbol_database.Default() -from gcloud.bigtable._generated import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from gcloud.bigtable._generated import bigtable_cluster_data_pb2 as google_dot_bigtable_dot_admin_dot_cluster_dot_v1_dot_bigtable__cluster__data__pb2 from gcloud.bigtable._generated import bigtable_cluster_service_messages_pb2 as google_dot_bigtable_dot_admin_dot_cluster_dot_v1_dot_bigtable__cluster__service__messages__pb2 -from gcloud.bigtable._generated import operations_pb2 as google_dot_longrunning_dot_operations__pb2 -from gcloud.bigtable._generated import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -115,9 +115,9 @@ def early_adopter_create_BigtableClusterService_server(servicer, port, private_k import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.operations_pb2 + import google.longrunning.operations_pb2 method_service_descriptions = { "CreateCluster": alpha_utilities.unary_unary_service_description( servicer.CreateCluster, @@ -127,7 +127,7 @@ def early_adopter_create_BigtableClusterService_server(servicer, port, private_k "DeleteCluster": alpha_utilities.unary_unary_service_description( servicer.DeleteCluster, gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + google.protobuf.empty_pb2.Empty.SerializeToString, ), "GetCluster": alpha_utilities.unary_unary_service_description( servicer.GetCluster, @@ -147,7 +147,7 @@ def early_adopter_create_BigtableClusterService_server(servicer, port, private_k "UndeleteCluster": alpha_utilities.unary_unary_service_description( servicer.UndeleteCluster, gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.UndeleteClusterRequest.FromString, - gcloud.bigtable._generated.operations_pb2.Operation.SerializeToString, + google.longrunning.operations_pb2.Operation.SerializeToString, ), "UpdateCluster": alpha_utilities.unary_unary_service_description( servicer.UpdateCluster, @@ -168,9 +168,9 @@ def early_adopter_create_BigtableClusterService_stub(host, port, metadata_transf import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.operations_pb2 + import google.longrunning.operations_pb2 method_invocation_descriptions = { "CreateCluster": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.CreateClusterRequest.SerializeToString, @@ -178,7 +178,7 @@ def early_adopter_create_BigtableClusterService_stub(host, port, metadata_transf ), "DeleteCluster": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, + google.protobuf.empty_pb2.Empty.FromString, ), "GetCluster": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.GetClusterRequest.SerializeToString, @@ -194,7 +194,7 @@ def early_adopter_create_BigtableClusterService_stub(host, port, metadata_transf ), "UndeleteCluster": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.UndeleteClusterRequest.SerializeToString, - gcloud.bigtable._generated.operations_pb2.Operation.FromString, + google.longrunning.operations_pb2.Operation.FromString, ), "UpdateCluster": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, @@ -272,9 +272,9 @@ def beta_create_BigtableClusterService_server(servicer, pool=None, pool_size=Non import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.operations_pb2 + import google.longrunning.operations_pb2 request_deserializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.CreateClusterRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.FromString, @@ -286,11 +286,11 @@ def beta_create_BigtableClusterService_server(servicer, pool=None, pool_size=Non } response_serializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, - ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'GetCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListClusters'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersResponse.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListZones'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesResponse.SerializeToString, - ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): gcloud.bigtable._generated.operations_pb2.Operation.SerializeToString, + ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): google.longrunning.operations_pb2.Operation.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UpdateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, } method_implementations = { @@ -317,9 +317,9 @@ def beta_create_BigtableClusterService_stub(channel, host=None, metadata_transfo import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 - import gcloud.bigtable._generated.operations_pb2 + import google.longrunning.operations_pb2 request_serializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.CreateClusterRequest.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.SerializeToString, @@ -331,11 +331,11 @@ def beta_create_BigtableClusterService_stub(channel, host=None, metadata_transfo } response_deserializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString, - ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, + ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): google.protobuf.empty_pb2.Empty.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'GetCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListClusters'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersResponse.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListZones'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesResponse.FromString, - ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): gcloud.bigtable._generated.operations_pb2.Operation.FromString, + ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): google.longrunning.operations_pb2.Operation.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UpdateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString, } cardinalities = { diff --git a/gcloud/bigtable/_generated/bigtable_service_pb2.py b/gcloud/bigtable/_generated/bigtable_service_pb2.py index 5809900398528..395bcc9282e4c 100644 --- a/gcloud/bigtable/_generated/bigtable_service_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_service_pb2.py @@ -11,10 +11,10 @@ _sym_db = _symbol_database.Default() -from gcloud.bigtable._generated import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from gcloud.bigtable._generated import bigtable_data_pb2 as google_dot_bigtable_dot_v1_dot_bigtable__data__pb2 from gcloud.bigtable._generated import bigtable_service_messages_pb2 as google_dot_bigtable_dot_v1_dot_bigtable__service__messages__pb2 -from gcloud.bigtable._generated import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -94,7 +94,7 @@ def early_adopter_create_BigtableService_server(servicer, port, private_key=None import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 @@ -108,7 +108,7 @@ def early_adopter_create_BigtableService_server(servicer, port, private_key=None "MutateRow": alpha_utilities.unary_unary_service_description( servicer.MutateRow, gcloud.bigtable._generated.bigtable_service_messages_pb2.MutateRowRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + google.protobuf.empty_pb2.Empty.SerializeToString, ), "ReadModifyWriteRow": alpha_utilities.unary_unary_service_description( servicer.ReadModifyWriteRow, @@ -133,7 +133,7 @@ def early_adopter_create_BigtableService_stub(host, port, metadata_transformer=N import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 @@ -145,7 +145,7 @@ def early_adopter_create_BigtableService_stub(host, port, metadata_transformer=N ), "MutateRow": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_service_messages_pb2.MutateRowRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, + google.protobuf.empty_pb2.Empty.FromString, ), "ReadModifyWriteRow": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadModifyWriteRowRequest.SerializeToString, @@ -209,7 +209,7 @@ def beta_create_BigtableService_server(servicer, pool=None, pool_size=None, defa import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 @@ -223,7 +223,7 @@ def beta_create_BigtableService_server(servicer, pool=None, pool_size=None, defa } response_serializers = { ('google.bigtable.v1.BigtableService', 'CheckAndMutateRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowResponse.SerializeToString, - ('google.bigtable.v1.BigtableService', 'MutateRow'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + ('google.bigtable.v1.BigtableService', 'MutateRow'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.v1.BigtableService', 'ReadModifyWriteRow'): gcloud.bigtable._generated.bigtable_data_pb2.Row.SerializeToString, ('google.bigtable.v1.BigtableService', 'ReadRows'): gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsResponse.SerializeToString, ('google.bigtable.v1.BigtableService', 'SampleRowKeys'): gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysResponse.SerializeToString, @@ -244,7 +244,7 @@ def beta_create_BigtableService_stub(channel, host=None, metadata_transformer=No import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 @@ -258,7 +258,7 @@ def beta_create_BigtableService_stub(channel, host=None, metadata_transformer=No } response_deserializers = { ('google.bigtable.v1.BigtableService', 'CheckAndMutateRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowResponse.FromString, - ('google.bigtable.v1.BigtableService', 'MutateRow'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, + ('google.bigtable.v1.BigtableService', 'MutateRow'): google.protobuf.empty_pb2.Empty.FromString, ('google.bigtable.v1.BigtableService', 'ReadModifyWriteRow'): gcloud.bigtable._generated.bigtable_data_pb2.Row.FromString, ('google.bigtable.v1.BigtableService', 'ReadRows'): gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsResponse.FromString, ('google.bigtable.v1.BigtableService', 'SampleRowKeys'): gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysResponse.FromString, diff --git a/gcloud/bigtable/_generated/bigtable_table_data_pb2.py b/gcloud/bigtable/_generated/bigtable_table_data_pb2.py index b3620b186a1a4..37274ca2358a7 100644 --- a/gcloud/bigtable/_generated/bigtable_table_data_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_table_data_pb2.py @@ -11,8 +11,8 @@ _sym_db = _symbol_database.Default() -from gcloud.bigtable._generated import operations_pb2 as google_dot_longrunning_dot_operations__pb2 -from gcloud.bigtable._generated import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 DESCRIPTOR = _descriptor.FileDescriptor( diff --git a/gcloud/bigtable/_generated/bigtable_table_service_pb2.py b/gcloud/bigtable/_generated/bigtable_table_service_pb2.py index 84f4f56115a02..55f912746936f 100644 --- a/gcloud/bigtable/_generated/bigtable_table_service_pb2.py +++ b/gcloud/bigtable/_generated/bigtable_table_service_pb2.py @@ -11,10 +11,10 @@ _sym_db = _symbol_database.Default() -from gcloud.bigtable._generated import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from gcloud.bigtable._generated import bigtable_table_data_pb2 as google_dot_bigtable_dot_admin_dot_table_dot_v1_dot_bigtable__table__data__pb2 from gcloud.bigtable._generated import bigtable_table_service_messages_pb2 as google_dot_bigtable_dot_admin_dot_table_dot_v1_dot_bigtable__table__service__messages__pb2 -from gcloud.bigtable._generated import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -117,15 +117,15 @@ def early_adopter_create_BigtableTableService_server(servicer, port, private_key import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 method_service_descriptions = { "CreateColumnFamily": alpha_utilities.unary_unary_service_description( servicer.CreateColumnFamily, @@ -140,12 +140,12 @@ def early_adopter_create_BigtableTableService_server(servicer, port, private_key "DeleteColumnFamily": alpha_utilities.unary_unary_service_description( servicer.DeleteColumnFamily, gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteColumnFamilyRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + google.protobuf.empty_pb2.Empty.SerializeToString, ), "DeleteTable": alpha_utilities.unary_unary_service_description( servicer.DeleteTable, gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteTableRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + google.protobuf.empty_pb2.Empty.SerializeToString, ), "GetTable": alpha_utilities.unary_unary_service_description( servicer.GetTable, @@ -160,7 +160,7 @@ def early_adopter_create_BigtableTableService_server(servicer, port, private_key "RenameTable": alpha_utilities.unary_unary_service_description( servicer.RenameTable, gcloud.bigtable._generated.bigtable_table_service_messages_pb2.RenameTableRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + google.protobuf.empty_pb2.Empty.SerializeToString, ), "UpdateColumnFamily": alpha_utilities.unary_unary_service_description( servicer.UpdateColumnFamily, @@ -177,15 +177,15 @@ def early_adopter_create_BigtableTableService_stub(host, port, metadata_transfor import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 method_invocation_descriptions = { "CreateColumnFamily": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateColumnFamilyRequest.SerializeToString, @@ -197,11 +197,11 @@ def early_adopter_create_BigtableTableService_stub(host, port, metadata_transfor ), "DeleteColumnFamily": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteColumnFamilyRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, + google.protobuf.empty_pb2.Empty.FromString, ), "DeleteTable": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteTableRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, + google.protobuf.empty_pb2.Empty.FromString, ), "GetTable": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_service_messages_pb2.GetTableRequest.SerializeToString, @@ -213,7 +213,7 @@ def early_adopter_create_BigtableTableService_stub(host, port, metadata_transfor ), "RenameTable": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_service_messages_pb2.RenameTableRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, + google.protobuf.empty_pb2.Empty.FromString, ), "UpdateColumnFamily": alpha_utilities.unary_unary_invocation_description( gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.SerializeToString, @@ -294,15 +294,15 @@ def beta_create_BigtableTableService_server(servicer, pool=None, pool_size=None, import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 request_deserializers = { ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateColumnFamily'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateColumnFamilyRequest.FromString, ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateTable'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateTableRequest.FromString, @@ -316,11 +316,11 @@ def beta_create_BigtableTableService_server(servicer, pool=None, pool_size=None, response_serializers = { ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateColumnFamily'): gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.SerializeToString, ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateTable'): gcloud.bigtable._generated.bigtable_table_data_pb2.Table.SerializeToString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteColumnFamily'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteTable'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteColumnFamily'): google.protobuf.empty_pb2.Empty.SerializeToString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteTable'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.admin.table.v1.BigtableTableService', 'GetTable'): gcloud.bigtable._generated.bigtable_table_data_pb2.Table.SerializeToString, ('google.bigtable.admin.table.v1.BigtableTableService', 'ListTables'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.ListTablesResponse.SerializeToString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'RenameTable'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'RenameTable'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.admin.table.v1.BigtableTableService', 'UpdateColumnFamily'): gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.SerializeToString, } method_implementations = { @@ -344,15 +344,15 @@ def beta_create_BigtableTableService_stub(channel, host=None, metadata_transform import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_data_pb2 import gcloud.bigtable._generated.bigtable_table_service_messages_pb2 - import gcloud.bigtable._generated.empty_pb2 + import google.protobuf.empty_pb2 request_serializers = { ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateColumnFamily'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateColumnFamilyRequest.SerializeToString, ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateTable'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateTableRequest.SerializeToString, @@ -366,11 +366,11 @@ def beta_create_BigtableTableService_stub(channel, host=None, metadata_transform response_deserializers = { ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateColumnFamily'): gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.FromString, ('google.bigtable.admin.table.v1.BigtableTableService', 'CreateTable'): gcloud.bigtable._generated.bigtable_table_data_pb2.Table.FromString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteColumnFamily'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteTable'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteColumnFamily'): google.protobuf.empty_pb2.Empty.FromString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'DeleteTable'): google.protobuf.empty_pb2.Empty.FromString, ('google.bigtable.admin.table.v1.BigtableTableService', 'GetTable'): gcloud.bigtable._generated.bigtable_table_data_pb2.Table.FromString, ('google.bigtable.admin.table.v1.BigtableTableService', 'ListTables'): gcloud.bigtable._generated.bigtable_table_service_messages_pb2.ListTablesResponse.FromString, - ('google.bigtable.admin.table.v1.BigtableTableService', 'RenameTable'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, + ('google.bigtable.admin.table.v1.BigtableTableService', 'RenameTable'): google.protobuf.empty_pb2.Empty.FromString, ('google.bigtable.admin.table.v1.BigtableTableService', 'UpdateColumnFamily'): gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.FromString, } cardinalities = { diff --git a/gcloud/bigtable/_generated/duration_pb2.py b/gcloud/bigtable/_generated/duration_pb2.py deleted file mode 100644 index ddb81a757a58a..0000000000000 --- a/gcloud/bigtable/_generated/duration_pb2.py +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/duration.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/protobuf/duration.proto', - package='google.protobuf', - syntax='proto3', - serialized_pb=b'\n\x1egoogle/protobuf/duration.proto\x12\x0fgoogle.protobuf\"*\n\x08\x44uration\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x42)\n\x13\x63om.google.protobufB\rDurationProtoP\x01\xa0\x01\x01\x62\x06proto3' -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_DURATION = _descriptor.Descriptor( - name='Duration', - full_name='google.protobuf.Duration', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='seconds', full_name='google.protobuf.Duration.seconds', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='nanos', full_name='google.protobuf.Duration.nanos', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=51, - serialized_end=93, -) - -DESCRIPTOR.message_types_by_name['Duration'] = _DURATION - -Duration = _reflection.GeneratedProtocolMessageType('Duration', (_message.Message,), dict( - DESCRIPTOR = _DURATION, - __module__ = 'google.protobuf.duration_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Duration) - )) -_sym_db.RegisterMessage(Duration) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\023com.google.protobufB\rDurationProtoP\001\240\001\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/empty_pb2.py b/gcloud/bigtable/_generated/empty_pb2.py deleted file mode 100644 index 701a9a62d1863..0000000000000 --- a/gcloud/bigtable/_generated/empty_pb2.py +++ /dev/null @@ -1,68 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/empty.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/protobuf/empty.proto', - package='google.protobuf', - syntax='proto3', - serialized_pb=b'\n\x1bgoogle/protobuf/empty.proto\x12\x0fgoogle.protobuf\"\x07\n\x05\x45mptyB#\n\x13\x63om.google.protobufB\nEmptyProtoP\x01\x62\x06proto3' -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='google.protobuf.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=48, - serialized_end=55, -) - -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict( - DESCRIPTOR = _EMPTY, - __module__ = 'google.protobuf.empty_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Empty) - )) -_sym_db.RegisterMessage(Empty) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\023com.google.protobufB\nEmptyProtoP\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/http_pb2.py b/gcloud/bigtable/_generated/http_pb2.py deleted file mode 100644 index 44885b8595cce..0000000000000 --- a/gcloud/bigtable/_generated/http_pb2.py +++ /dev/null @@ -1,193 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/http.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/api/http.proto', - package='google.api', - syntax='proto3', - serialized_pb=b'\n\x15google/api/http.proto\x12\ngoogle.api\"\xd8\x01\n\x08HttpRule\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tB\x1d\n\x0e\x63om.google.apiB\tHttpProtoP\x01\x62\x06proto3' -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_HTTPRULE = _descriptor.Descriptor( - name='HttpRule', - full_name='google.api.HttpRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='get', full_name='google.api.HttpRule.get', index=0, - 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, - options=None), - _descriptor.FieldDescriptor( - name='put', full_name='google.api.HttpRule.put', index=1, - 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, - options=None), - _descriptor.FieldDescriptor( - name='post', full_name='google.api.HttpRule.post', index=2, - 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, - options=None), - _descriptor.FieldDescriptor( - name='delete', full_name='google.api.HttpRule.delete', index=3, - 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, - options=None), - _descriptor.FieldDescriptor( - name='patch', full_name='google.api.HttpRule.patch', index=4, - number=6, 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, - options=None), - _descriptor.FieldDescriptor( - name='custom', full_name='google.api.HttpRule.custom', index=5, - number=8, 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, - options=None), - _descriptor.FieldDescriptor( - name='body', full_name='google.api.HttpRule.body', index=6, - number=7, 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, - options=None), - _descriptor.FieldDescriptor( - name='additional_bindings', full_name='google.api.HttpRule.additional_bindings', index=7, - number=11, 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='pattern', full_name='google.api.HttpRule.pattern', - index=0, containing_type=None, fields=[]), - ], - serialized_start=38, - serialized_end=254, -) - - -_CUSTOMHTTPPATTERN = _descriptor.Descriptor( - name='CustomHttpPattern', - full_name='google.api.CustomHttpPattern', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='kind', full_name='google.api.CustomHttpPattern.kind', 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, - options=None), - _descriptor.FieldDescriptor( - name='path', full_name='google.api.CustomHttpPattern.path', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=256, - serialized_end=303, -) - -_HTTPRULE.fields_by_name['custom'].message_type = _CUSTOMHTTPPATTERN -_HTTPRULE.fields_by_name['additional_bindings'].message_type = _HTTPRULE -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['get']) -_HTTPRULE.fields_by_name['get'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['put']) -_HTTPRULE.fields_by_name['put'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['post']) -_HTTPRULE.fields_by_name['post'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['delete']) -_HTTPRULE.fields_by_name['delete'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['patch']) -_HTTPRULE.fields_by_name['patch'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['custom']) -_HTTPRULE.fields_by_name['custom'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -DESCRIPTOR.message_types_by_name['HttpRule'] = _HTTPRULE -DESCRIPTOR.message_types_by_name['CustomHttpPattern'] = _CUSTOMHTTPPATTERN - -HttpRule = _reflection.GeneratedProtocolMessageType('HttpRule', (_message.Message,), dict( - DESCRIPTOR = _HTTPRULE, - __module__ = 'google.api.http_pb2' - # @@protoc_insertion_point(class_scope:google.api.HttpRule) - )) -_sym_db.RegisterMessage(HttpRule) - -CustomHttpPattern = _reflection.GeneratedProtocolMessageType('CustomHttpPattern', (_message.Message,), dict( - DESCRIPTOR = _CUSTOMHTTPPATTERN, - __module__ = 'google.api.http_pb2' - # @@protoc_insertion_point(class_scope:google.api.CustomHttpPattern) - )) -_sym_db.RegisterMessage(CustomHttpPattern) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\016com.google.apiB\tHttpProtoP\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/operations_grpc_pb2.py b/gcloud/bigtable/_generated/operations_grpc_pb2.py new file mode 100644 index 0000000000000..998d244790f1f --- /dev/null +++ b/gcloud/bigtable/_generated/operations_grpc_pb2.py @@ -0,0 +1,205 @@ +import abc +from grpc.beta import implementations as beta_implementations +from grpc.early_adopter import implementations as early_adopter_implementations +from grpc.framework.alpha import utilities as alpha_utilities +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities +class EarlyAdopterOperationsServicer(object): + """""" + __metaclass__ = abc.ABCMeta + @abc.abstractmethod + def GetOperation(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def ListOperations(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def CancelOperation(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def DeleteOperation(self, request, context): + raise NotImplementedError() +class EarlyAdopterOperationsServer(object): + """""" + __metaclass__ = abc.ABCMeta + @abc.abstractmethod + def start(self): + raise NotImplementedError() + @abc.abstractmethod + def stop(self): + raise NotImplementedError() +class EarlyAdopterOperationsStub(object): + """""" + __metaclass__ = abc.ABCMeta + @abc.abstractmethod + def GetOperation(self, request): + raise NotImplementedError() + GetOperation.async = None + @abc.abstractmethod + def ListOperations(self, request): + raise NotImplementedError() + ListOperations.async = None + @abc.abstractmethod + def CancelOperation(self, request): + raise NotImplementedError() + CancelOperation.async = None + @abc.abstractmethod + def DeleteOperation(self, request): + raise NotImplementedError() + DeleteOperation.async = None +def early_adopter_create_Operations_server(servicer, port, private_key=None, certificate_chain=None): + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + method_service_descriptions = { + "CancelOperation": alpha_utilities.unary_unary_service_description( + servicer.CancelOperation, + google.longrunning.operations_pb2.CancelOperationRequest.FromString, + google.protobuf.empty_pb2.Empty.SerializeToString, + ), + "DeleteOperation": alpha_utilities.unary_unary_service_description( + servicer.DeleteOperation, + google.longrunning.operations_pb2.DeleteOperationRequest.FromString, + google.protobuf.empty_pb2.Empty.SerializeToString, + ), + "GetOperation": alpha_utilities.unary_unary_service_description( + servicer.GetOperation, + google.longrunning.operations_pb2.GetOperationRequest.FromString, + google.longrunning.operations_pb2.Operation.SerializeToString, + ), + "ListOperations": alpha_utilities.unary_unary_service_description( + servicer.ListOperations, + google.longrunning.operations_pb2.ListOperationsRequest.FromString, + google.longrunning.operations_pb2.ListOperationsResponse.SerializeToString, + ), + } + return early_adopter_implementations.server("google.longrunning.Operations", method_service_descriptions, port, private_key=private_key, certificate_chain=certificate_chain) +def early_adopter_create_Operations_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None): + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + method_invocation_descriptions = { + "CancelOperation": alpha_utilities.unary_unary_invocation_description( + google.longrunning.operations_pb2.CancelOperationRequest.SerializeToString, + google.protobuf.empty_pb2.Empty.FromString, + ), + "DeleteOperation": alpha_utilities.unary_unary_invocation_description( + google.longrunning.operations_pb2.DeleteOperationRequest.SerializeToString, + google.protobuf.empty_pb2.Empty.FromString, + ), + "GetOperation": alpha_utilities.unary_unary_invocation_description( + google.longrunning.operations_pb2.GetOperationRequest.SerializeToString, + google.longrunning.operations_pb2.Operation.FromString, + ), + "ListOperations": alpha_utilities.unary_unary_invocation_description( + google.longrunning.operations_pb2.ListOperationsRequest.SerializeToString, + google.longrunning.operations_pb2.ListOperationsResponse.FromString, + ), + } + return early_adopter_implementations.stub("google.longrunning.Operations", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override) + +class BetaOperationsServicer(object): + """""" + __metaclass__ = abc.ABCMeta + @abc.abstractmethod + def GetOperation(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def ListOperations(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def CancelOperation(self, request, context): + raise NotImplementedError() + @abc.abstractmethod + def DeleteOperation(self, request, context): + raise NotImplementedError() + +class BetaOperationsStub(object): + """The interface to which stubs will conform.""" + __metaclass__ = abc.ABCMeta + @abc.abstractmethod + def GetOperation(self, request, timeout): + raise NotImplementedError() + GetOperation.future = None + @abc.abstractmethod + def ListOperations(self, request, timeout): + raise NotImplementedError() + ListOperations.future = None + @abc.abstractmethod + def CancelOperation(self, request, timeout): + raise NotImplementedError() + CancelOperation.future = None + @abc.abstractmethod + def DeleteOperation(self, request, timeout): + raise NotImplementedError() + DeleteOperation.future = None + +def beta_create_Operations_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + request_deserializers = { + ('google.longrunning.Operations', 'CancelOperation'): google.longrunning.operations_pb2.CancelOperationRequest.FromString, + ('google.longrunning.Operations', 'DeleteOperation'): google.longrunning.operations_pb2.DeleteOperationRequest.FromString, + ('google.longrunning.Operations', 'GetOperation'): google.longrunning.operations_pb2.GetOperationRequest.FromString, + ('google.longrunning.Operations', 'ListOperations'): google.longrunning.operations_pb2.ListOperationsRequest.FromString, + } + response_serializers = { + ('google.longrunning.Operations', 'CancelOperation'): google.protobuf.empty_pb2.Empty.SerializeToString, + ('google.longrunning.Operations', 'DeleteOperation'): google.protobuf.empty_pb2.Empty.SerializeToString, + ('google.longrunning.Operations', 'GetOperation'): google.longrunning.operations_pb2.Operation.SerializeToString, + ('google.longrunning.Operations', 'ListOperations'): google.longrunning.operations_pb2.ListOperationsResponse.SerializeToString, + } + method_implementations = { + ('google.longrunning.Operations', 'CancelOperation'): face_utilities.unary_unary_inline(servicer.CancelOperation), + ('google.longrunning.Operations', 'DeleteOperation'): face_utilities.unary_unary_inline(servicer.DeleteOperation), + ('google.longrunning.Operations', 'GetOperation'): face_utilities.unary_unary_inline(servicer.GetOperation), + ('google.longrunning.Operations', 'ListOperations'): face_utilities.unary_unary_inline(servicer.ListOperations), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + +def beta_create_Operations_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + import google.longrunning.operations_pb2 + import google.protobuf.empty_pb2 + request_serializers = { + ('google.longrunning.Operations', 'CancelOperation'): google.longrunning.operations_pb2.CancelOperationRequest.SerializeToString, + ('google.longrunning.Operations', 'DeleteOperation'): google.longrunning.operations_pb2.DeleteOperationRequest.SerializeToString, + ('google.longrunning.Operations', 'GetOperation'): google.longrunning.operations_pb2.GetOperationRequest.SerializeToString, + ('google.longrunning.Operations', 'ListOperations'): google.longrunning.operations_pb2.ListOperationsRequest.SerializeToString, + } + response_deserializers = { + ('google.longrunning.Operations', 'CancelOperation'): google.protobuf.empty_pb2.Empty.FromString, + ('google.longrunning.Operations', 'DeleteOperation'): google.protobuf.empty_pb2.Empty.FromString, + ('google.longrunning.Operations', 'GetOperation'): google.longrunning.operations_pb2.Operation.FromString, + ('google.longrunning.Operations', 'ListOperations'): google.longrunning.operations_pb2.ListOperationsResponse.FromString, + } + cardinalities = { + 'CancelOperation': cardinality.Cardinality.UNARY_UNARY, + 'DeleteOperation': cardinality.Cardinality.UNARY_UNARY, + 'GetOperation': cardinality.Cardinality.UNARY_UNARY, + 'ListOperations': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.longrunning.Operations', cardinalities, options=stub_options) diff --git a/gcloud/bigtable/_generated/operations_pb2.py b/gcloud/bigtable/_generated/operations_pb2.py deleted file mode 100644 index e2a95a7614f7d..0000000000000 --- a/gcloud/bigtable/_generated/operations_pb2.py +++ /dev/null @@ -1,543 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/longrunning/operations.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from gcloud.bigtable._generated import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from gcloud.bigtable._generated import any_pb2 as google_dot_protobuf_dot_any__pb2 -from gcloud.bigtable._generated import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from gcloud.bigtable._generated import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/longrunning/operations.proto', - package='google.longrunning', - syntax='proto3', - serialized_pb=b'\n#google/longrunning/operations.proto\x12\x12google.longrunning\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/protobuf/any.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(\t2\x8c\x04\n\nOperations\x12x\n\x0cGetOperation\x12\'.google.longrunning.GetOperationRequest\x1a\x1d.google.longrunning.Operation\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=operations/**}\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}\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*\x12w\n\x0f\x44\x65leteOperation\x12*.google.longrunning.DeleteOperationRequest\x1a\x16.google.protobuf.Empty\" \x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=operations/**}B+\n\x16\x63om.google.longrunningB\x0fOperationsProtoP\x01\x62\x06proto3' - , - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_OPERATION = _descriptor.Descriptor( - name='Operation', - full_name='google.longrunning.Operation', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='google.longrunning.Operation.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, - options=None), - _descriptor.FieldDescriptor( - name='metadata', full_name='google.longrunning.Operation.metadata', 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, - options=None), - _descriptor.FieldDescriptor( - name='done', full_name='google.longrunning.Operation.done', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='error', full_name='google.longrunning.Operation.error', index=3, - number=4, 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, - options=None), - _descriptor.FieldDescriptor( - name='response', full_name='google.longrunning.Operation.response', index=4, - number=5, 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='result', full_name='google.longrunning.Operation.result', - index=0, containing_type=None, fields=[]), - ], - serialized_start=171, - serialized_end=339, -) - - -_GETOPERATIONREQUEST = _descriptor.Descriptor( - name='GetOperationRequest', - full_name='google.longrunning.GetOperationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='google.longrunning.GetOperationRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=341, - serialized_end=376, -) - - -_LISTOPERATIONSREQUEST = _descriptor.Descriptor( - name='ListOperationsRequest', - full_name='google.longrunning.ListOperationsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='google.longrunning.ListOperationsRequest.name', index=0, - 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, - options=None), - _descriptor.FieldDescriptor( - name='filter', full_name='google.longrunning.ListOperationsRequest.filter', index=1, - 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, - options=None), - _descriptor.FieldDescriptor( - name='page_size', full_name='google.longrunning.ListOperationsRequest.page_size', index=2, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='page_token', full_name='google.longrunning.ListOperationsRequest.page_token', index=3, - 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=378, - serialized_end=470, -) - - -_LISTOPERATIONSRESPONSE = _descriptor.Descriptor( - name='ListOperationsResponse', - full_name='google.longrunning.ListOperationsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='operations', full_name='google.longrunning.ListOperationsResponse.operations', 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, - options=None), - _descriptor.FieldDescriptor( - name='next_page_token', full_name='google.longrunning.ListOperationsResponse.next_page_token', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=472, - serialized_end=572, -) - - -_CANCELOPERATIONREQUEST = _descriptor.Descriptor( - name='CancelOperationRequest', - full_name='google.longrunning.CancelOperationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='google.longrunning.CancelOperationRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=574, - serialized_end=612, -) - - -_DELETEOPERATIONREQUEST = _descriptor.Descriptor( - name='DeleteOperationRequest', - full_name='google.longrunning.DeleteOperationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='google.longrunning.DeleteOperationRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=614, - serialized_end=652, -) - -_OPERATION.fields_by_name['metadata'].message_type = google_dot_protobuf_dot_any__pb2._ANY -_OPERATION.fields_by_name['error'].message_type = google_dot_rpc_dot_status__pb2._STATUS -_OPERATION.fields_by_name['response'].message_type = google_dot_protobuf_dot_any__pb2._ANY -_OPERATION.oneofs_by_name['result'].fields.append( - _OPERATION.fields_by_name['error']) -_OPERATION.fields_by_name['error'].containing_oneof = _OPERATION.oneofs_by_name['result'] -_OPERATION.oneofs_by_name['result'].fields.append( - _OPERATION.fields_by_name['response']) -_OPERATION.fields_by_name['response'].containing_oneof = _OPERATION.oneofs_by_name['result'] -_LISTOPERATIONSRESPONSE.fields_by_name['operations'].message_type = _OPERATION -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 - -Operation = _reflection.GeneratedProtocolMessageType('Operation', (_message.Message,), dict( - DESCRIPTOR = _OPERATION, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.Operation) - )) -_sym_db.RegisterMessage(Operation) - -GetOperationRequest = _reflection.GeneratedProtocolMessageType('GetOperationRequest', (_message.Message,), dict( - DESCRIPTOR = _GETOPERATIONREQUEST, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.GetOperationRequest) - )) -_sym_db.RegisterMessage(GetOperationRequest) - -ListOperationsRequest = _reflection.GeneratedProtocolMessageType('ListOperationsRequest', (_message.Message,), dict( - DESCRIPTOR = _LISTOPERATIONSREQUEST, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.ListOperationsRequest) - )) -_sym_db.RegisterMessage(ListOperationsRequest) - -ListOperationsResponse = _reflection.GeneratedProtocolMessageType('ListOperationsResponse', (_message.Message,), dict( - DESCRIPTOR = _LISTOPERATIONSRESPONSE, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.ListOperationsResponse) - )) -_sym_db.RegisterMessage(ListOperationsResponse) - -CancelOperationRequest = _reflection.GeneratedProtocolMessageType('CancelOperationRequest', (_message.Message,), dict( - DESCRIPTOR = _CANCELOPERATIONREQUEST, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.CancelOperationRequest) - )) -_sym_db.RegisterMessage(CancelOperationRequest) - -DeleteOperationRequest = _reflection.GeneratedProtocolMessageType('DeleteOperationRequest', (_message.Message,), dict( - DESCRIPTOR = _DELETEOPERATIONREQUEST, - __module__ = 'google.longrunning.operations_pb2' - # @@protoc_insertion_point(class_scope:google.longrunning.DeleteOperationRequest) - )) -_sym_db.RegisterMessage(DeleteOperationRequest) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\026com.google.longrunningB\017OperationsProtoP\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -class EarlyAdopterOperationsServicer(object): - """""" - __metaclass__ = abc.ABCMeta - @abc.abstractmethod - def GetOperation(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def ListOperations(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def CancelOperation(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def DeleteOperation(self, request, context): - raise NotImplementedError() -class EarlyAdopterOperationsServer(object): - """""" - __metaclass__ = abc.ABCMeta - @abc.abstractmethod - def start(self): - raise NotImplementedError() - @abc.abstractmethod - def stop(self): - raise NotImplementedError() -class EarlyAdopterOperationsStub(object): - """""" - __metaclass__ = abc.ABCMeta - @abc.abstractmethod - def GetOperation(self, request): - raise NotImplementedError() - GetOperation.async = None - @abc.abstractmethod - def ListOperations(self, request): - raise NotImplementedError() - ListOperations.async = None - @abc.abstractmethod - def CancelOperation(self, request): - raise NotImplementedError() - CancelOperation.async = None - @abc.abstractmethod - def DeleteOperation(self, request): - raise NotImplementedError() - DeleteOperation.async = None -def early_adopter_create_Operations_server(servicer, port, private_key=None, certificate_chain=None): - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - method_service_descriptions = { - "CancelOperation": alpha_utilities.unary_unary_service_description( - servicer.CancelOperation, - gcloud.bigtable._generated.operations_pb2.CancelOperationRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, - ), - "DeleteOperation": alpha_utilities.unary_unary_service_description( - servicer.DeleteOperation, - gcloud.bigtable._generated.operations_pb2.DeleteOperationRequest.FromString, - gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, - ), - "GetOperation": alpha_utilities.unary_unary_service_description( - servicer.GetOperation, - gcloud.bigtable._generated.operations_pb2.GetOperationRequest.FromString, - gcloud.bigtable._generated.operations_pb2.Operation.SerializeToString, - ), - "ListOperations": alpha_utilities.unary_unary_service_description( - servicer.ListOperations, - gcloud.bigtable._generated.operations_pb2.ListOperationsRequest.FromString, - gcloud.bigtable._generated.operations_pb2.ListOperationsResponse.SerializeToString, - ), - } - return early_adopter_implementations.server("google.longrunning.Operations", method_service_descriptions, port, private_key=private_key, certificate_chain=certificate_chain) -def early_adopter_create_Operations_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None): - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - method_invocation_descriptions = { - "CancelOperation": alpha_utilities.unary_unary_invocation_description( - gcloud.bigtable._generated.operations_pb2.CancelOperationRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, - ), - "DeleteOperation": alpha_utilities.unary_unary_invocation_description( - gcloud.bigtable._generated.operations_pb2.DeleteOperationRequest.SerializeToString, - gcloud.bigtable._generated.empty_pb2.Empty.FromString, - ), - "GetOperation": alpha_utilities.unary_unary_invocation_description( - gcloud.bigtable._generated.operations_pb2.GetOperationRequest.SerializeToString, - gcloud.bigtable._generated.operations_pb2.Operation.FromString, - ), - "ListOperations": alpha_utilities.unary_unary_invocation_description( - gcloud.bigtable._generated.operations_pb2.ListOperationsRequest.SerializeToString, - gcloud.bigtable._generated.operations_pb2.ListOperationsResponse.FromString, - ), - } - return early_adopter_implementations.stub("google.longrunning.Operations", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override) - -class BetaOperationsServicer(object): - """""" - __metaclass__ = abc.ABCMeta - @abc.abstractmethod - def GetOperation(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def ListOperations(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def CancelOperation(self, request, context): - raise NotImplementedError() - @abc.abstractmethod - def DeleteOperation(self, request, context): - raise NotImplementedError() - -class BetaOperationsStub(object): - """The interface to which stubs will conform.""" - __metaclass__ = abc.ABCMeta - @abc.abstractmethod - def GetOperation(self, request, timeout): - raise NotImplementedError() - GetOperation.future = None - @abc.abstractmethod - def ListOperations(self, request, timeout): - raise NotImplementedError() - ListOperations.future = None - @abc.abstractmethod - def CancelOperation(self, request, timeout): - raise NotImplementedError() - CancelOperation.future = None - @abc.abstractmethod - def DeleteOperation(self, request, timeout): - raise NotImplementedError() - DeleteOperation.future = None - -def beta_create_Operations_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - request_deserializers = { - ('google.longrunning.Operations', 'CancelOperation'): gcloud.bigtable._generated.operations_pb2.CancelOperationRequest.FromString, - ('google.longrunning.Operations', 'DeleteOperation'): gcloud.bigtable._generated.operations_pb2.DeleteOperationRequest.FromString, - ('google.longrunning.Operations', 'GetOperation'): gcloud.bigtable._generated.operations_pb2.GetOperationRequest.FromString, - ('google.longrunning.Operations', 'ListOperations'): gcloud.bigtable._generated.operations_pb2.ListOperationsRequest.FromString, - } - response_serializers = { - ('google.longrunning.Operations', 'CancelOperation'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, - ('google.longrunning.Operations', 'DeleteOperation'): gcloud.bigtable._generated.empty_pb2.Empty.SerializeToString, - ('google.longrunning.Operations', 'GetOperation'): gcloud.bigtable._generated.operations_pb2.Operation.SerializeToString, - ('google.longrunning.Operations', 'ListOperations'): gcloud.bigtable._generated.operations_pb2.ListOperationsResponse.SerializeToString, - } - method_implementations = { - ('google.longrunning.Operations', 'CancelOperation'): face_utilities.unary_unary_inline(servicer.CancelOperation), - ('google.longrunning.Operations', 'DeleteOperation'): face_utilities.unary_unary_inline(servicer.DeleteOperation), - ('google.longrunning.Operations', 'GetOperation'): face_utilities.unary_unary_inline(servicer.GetOperation), - ('google.longrunning.Operations', 'ListOperations'): face_utilities.unary_unary_inline(servicer.ListOperations), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_Operations_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - import gcloud.bigtable._generated.operations_pb2 - import gcloud.bigtable._generated.empty_pb2 - request_serializers = { - ('google.longrunning.Operations', 'CancelOperation'): gcloud.bigtable._generated.operations_pb2.CancelOperationRequest.SerializeToString, - ('google.longrunning.Operations', 'DeleteOperation'): gcloud.bigtable._generated.operations_pb2.DeleteOperationRequest.SerializeToString, - ('google.longrunning.Operations', 'GetOperation'): gcloud.bigtable._generated.operations_pb2.GetOperationRequest.SerializeToString, - ('google.longrunning.Operations', 'ListOperations'): gcloud.bigtable._generated.operations_pb2.ListOperationsRequest.SerializeToString, - } - response_deserializers = { - ('google.longrunning.Operations', 'CancelOperation'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, - ('google.longrunning.Operations', 'DeleteOperation'): gcloud.bigtable._generated.empty_pb2.Empty.FromString, - ('google.longrunning.Operations', 'GetOperation'): gcloud.bigtable._generated.operations_pb2.Operation.FromString, - ('google.longrunning.Operations', 'ListOperations'): gcloud.bigtable._generated.operations_pb2.ListOperationsResponse.FromString, - } - cardinalities = { - 'CancelOperation': cardinality.Cardinality.UNARY_UNARY, - 'DeleteOperation': cardinality.Cardinality.UNARY_UNARY, - 'GetOperation': cardinality.Cardinality.UNARY_UNARY, - 'ListOperations': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'google.longrunning.Operations', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/status_pb2.py b/gcloud/bigtable/_generated/status_pb2.py deleted file mode 100644 index 541439e01b018..0000000000000 --- a/gcloud/bigtable/_generated/status_pb2.py +++ /dev/null @@ -1,92 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/rpc/status.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from gcloud.bigtable._generated import any_pb2 as google_dot_protobuf_dot_any__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/rpc/status.proto', - package='google.rpc', - syntax='proto3', - serialized_pb=b'\n\x17google/rpc/status.proto\x12\ngoogle.rpc\x1a\x19google/protobuf/any.proto\"N\n\x06Status\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12%\n\x07\x64\x65tails\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyB\x1f\n\x0e\x63om.google.rpcB\x0bStatusProtoP\x01\x62\x06proto3' - , - dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_STATUS = _descriptor.Descriptor( - name='Status', - full_name='google.rpc.Status', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='code', full_name='google.rpc.Status.code', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='message', full_name='google.rpc.Status.message', 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, - options=None), - _descriptor.FieldDescriptor( - name='details', full_name='google.rpc.Status.details', index=2, - number=3, 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=66, - serialized_end=144, -) - -_STATUS.fields_by_name['details'].message_type = google_dot_protobuf_dot_any__pb2._ANY -DESCRIPTOR.message_types_by_name['Status'] = _STATUS - -Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), dict( - DESCRIPTOR = _STATUS, - __module__ = 'google.rpc.status_pb2' - # @@protoc_insertion_point(class_scope:google.rpc.Status) - )) -_sym_db.RegisterMessage(Status) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\016com.google.rpcB\013StatusProtoP\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/_generated/timestamp_pb2.py b/gcloud/bigtable/_generated/timestamp_pb2.py deleted file mode 100644 index 66a6cf6ce42b9..0000000000000 --- a/gcloud/bigtable/_generated/timestamp_pb2.py +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/protobuf/timestamp.proto - -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 -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/protobuf/timestamp.proto', - package='google.protobuf', - syntax='proto3', - serialized_pb=b'\n\x1fgoogle/protobuf/timestamp.proto\x12\x0fgoogle.protobuf\"+\n\tTimestamp\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x42*\n\x13\x63om.google.protobufB\x0eTimestampProtoP\x01\xa0\x01\x01\x62\x06proto3' -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_TIMESTAMP = _descriptor.Descriptor( - name='Timestamp', - full_name='google.protobuf.Timestamp', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='seconds', full_name='google.protobuf.Timestamp.seconds', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='nanos', full_name='google.protobuf.Timestamp.nanos', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=52, - serialized_end=95, -) - -DESCRIPTOR.message_types_by_name['Timestamp'] = _TIMESTAMP - -Timestamp = _reflection.GeneratedProtocolMessageType('Timestamp', (_message.Message,), dict( - DESCRIPTOR = _TIMESTAMP, - __module__ = 'google.protobuf.timestamp_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Timestamp) - )) -_sym_db.RegisterMessage(Timestamp) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\023com.google.protobufB\016TimestampProtoP\001\240\001\001') -import abc -from grpc.beta import implementations as beta_implementations -from grpc.early_adopter import implementations as early_adopter_implementations -from grpc.framework.alpha import utilities as alpha_utilities -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/gcloud/bigtable/client.py b/gcloud/bigtable/client.py index 669cd468922c3..56d46352c0722 100644 --- a/gcloud/bigtable/client.py +++ b/gcloud/bigtable/client.py @@ -35,7 +35,7 @@ bigtable_cluster_service_messages_pb2 as messages_pb2) from gcloud.bigtable._generated import bigtable_service_pb2 from gcloud.bigtable._generated import bigtable_table_service_pb2 -from gcloud.bigtable._generated import operations_pb2 +from gcloud.bigtable._generated import operations_grpc_pb2 from gcloud.bigtable._helpers import make_stub from gcloud.bigtable.cluster import Cluster from gcloud.client import _ClientFactoryMixin @@ -63,7 +63,7 @@ DATA_API_PORT = 443 """Data API request port.""" -OPERATIONS_STUB_FACTORY = operations_pb2.beta_create_Operations_stub +OPERATIONS_STUB_FACTORY = operations_grpc_pb2.beta_create_Operations_stub ADMIN_SCOPE = 'https://www.googleapis.com/auth/cloud-bigtable.admin' """Scope for interacting with the Cluster Admin and Table Admin APIs.""" diff --git a/gcloud/bigtable/cluster.py b/gcloud/bigtable/cluster.py index c015a9a4b4855..f087658d58d12 100644 --- a/gcloud/bigtable/cluster.py +++ b/gcloud/bigtable/cluster.py @@ -18,13 +18,14 @@ import datetime import re +from google.longrunning import operations_pb2 + from gcloud._helpers import _EPOCH from gcloud.bigtable._generated import bigtable_cluster_data_pb2 as data_pb2 from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) from gcloud.bigtable._generated import ( bigtable_table_service_messages_pb2 as table_messages_pb2) -from gcloud.bigtable._generated import operations_pb2 from gcloud.bigtable.table import Table @@ -95,7 +96,7 @@ def _prepare_create_request(cluster): def _pb_timestamp_to_datetime(timestamp): """Convert a Timestamp protobuf to a datetime object. - :type timestamp: :class:`._generated.timestamp_pb2.Timestamp` + :type timestamp: :class:`google.protobuf.timestamp_pb2.Timestamp` :param timestamp: A Google returned timestamp protobuf. :rtype: :class:`datetime.datetime` @@ -113,7 +114,7 @@ def _pb_timestamp_to_datetime(timestamp): def _parse_pb_any_to_native(any_val, expected_type=None): """Convert a serialized "google.protobuf.Any" value to actual type. - :type any_val: :class:`gcloud.bigtable._generated.any_pb2.Any` + :type any_val: :class:`google.protobuf.any_pb2.Any` :param any_val: A serialized protobuf value container. :type expected_type: str @@ -135,7 +136,7 @@ def _parse_pb_any_to_native(any_val, expected_type=None): def _process_operation(operation_pb): """Processes a create protobuf response. - :type operation_pb: :class:`operations_pb2.Operation` + :type operation_pb: :class:`google.longrunning.operations_pb2.Operation` :param operation_pb: The long-running operation response from a Create/Update/Undelete cluster request. @@ -213,7 +214,7 @@ def finished(self): operation_name = ('operations/' + self._cluster.name + '/operations/%d' % (self.op_id,)) request_pb = operations_pb2.GetOperationRequest(name=operation_name) - # We expect a `._generated.operations_pb2.Operation`. + # We expect a `google.longrunning.operations_pb2.Operation`. operation_pb = self._cluster._client._operations_stub.GetOperation( request_pb, self._cluster._client.timeout_seconds) @@ -394,7 +395,7 @@ def create(self): create operation. """ request_pb = _prepare_create_request(self) - # We expect an `operations_pb2.Operation`. + # We expect a `google.longrunning.operations_pb2.Operation`. cluster_pb = self._client._cluster_stub.CreateCluster( request_pb, self._client.timeout_seconds) @@ -458,7 +459,7 @@ def delete(self): permanently deleted. """ request_pb = messages_pb2.DeleteClusterRequest(name=self.name) - # We expect a `._generated.empty_pb2.Empty` + # We expect a `google.protobuf.empty_pb2.Empty` self._client._cluster_stub.DeleteCluster( request_pb, self._client.timeout_seconds) @@ -488,7 +489,7 @@ def undelete(self): undelete operation. """ request_pb = messages_pb2.UndeleteClusterRequest(name=self.name) - # We expect a `._generated.operations_pb2.Operation` + # We expect a `google.longrunning.operations_pb2.Operation`. operation_pb2 = self._client._cluster_stub.UndeleteCluster( request_pb, self._client.timeout_seconds) diff --git a/gcloud/bigtable/column_family.py b/gcloud/bigtable/column_family.py index e8ffd9654f50d..0d3aeda8c5086 100644 --- a/gcloud/bigtable/column_family.py +++ b/gcloud/bigtable/column_family.py @@ -17,11 +17,12 @@ import datetime +from google.protobuf import duration_pb2 + from gcloud._helpers import _total_seconds from gcloud.bigtable._generated import bigtable_table_data_pb2 as data_pb2 from gcloud.bigtable._generated import ( bigtable_table_service_messages_pb2 as messages_pb2) -from gcloud.bigtable._generated import duration_pb2 def _timedelta_to_duration_pb(timedelta_val): @@ -35,7 +36,7 @@ def _timedelta_to_duration_pb(timedelta_val): :type timedelta_val: :class:`datetime.timedelta` :param timedelta_val: A timedelta object. - :rtype: :class:`.duration_pb2.Duration` + :rtype: :class:`google.protobuf.duration_pb2.Duration` :returns: A duration object equivalent to the time delta. """ seconds_decimal = _total_seconds(timedelta_val) @@ -58,7 +59,7 @@ def _duration_pb_to_timedelta(duration_pb): The Python timedelta has a granularity of microseconds while the protobuf duration type has a duration of nanoseconds. - :type duration_pb: :class:`.duration_pb2.Duration` + :type duration_pb: :class:`google.protobuf.duration_pb2.Duration` :param duration_pb: A protobuf duration object. :rtype: :class:`datetime.timedelta` @@ -287,7 +288,7 @@ def delete(self): """Delete this column family.""" request_pb = messages_pb2.DeleteColumnFamilyRequest(name=self.name) client = self._table._cluster._client - # We expect a `._generated.empty_pb2.Empty` + # We expect a `google.protobuf.empty_pb2.Empty` client._table_stub.DeleteColumnFamily(request_pb, client.timeout_seconds) diff --git a/gcloud/bigtable/table.py b/gcloud/bigtable/table.py index 8edcd6f8e9921..00e71ca35d2fd 100644 --- a/gcloud/bigtable/table.py +++ b/gcloud/bigtable/table.py @@ -177,7 +177,7 @@ def rename(self, new_table_id): new_id=new_table_id, ) client = self._cluster._client - # We expect a `._generated.empty_pb2.Empty` + # We expect a `google.protobuf.empty_pb2.Empty` client._table_stub.RenameTable(request_pb, client.timeout_seconds) self.table_id = new_table_id @@ -186,7 +186,7 @@ def delete(self): """Delete this table.""" request_pb = messages_pb2.DeleteTableRequest(name=self.name) client = self._cluster._client - # We expect a `._generated.empty_pb2.Empty` + # We expect a `google.protobuf.empty_pb2.Empty` client._table_stub.DeleteTable(request_pb, client.timeout_seconds) def list_column_families(self): diff --git a/gcloud/bigtable/test_cluster.py b/gcloud/bigtable/test_cluster.py index 0d5efb00affd5..74fbce7a146cb 100644 --- a/gcloud/bigtable/test_cluster.py +++ b/gcloud/bigtable/test_cluster.py @@ -84,7 +84,7 @@ def test_finished_without_operation(self): def _finished_helper(self, done): import datetime - from gcloud.bigtable._generated import operations_pb2 + from google.longrunning import operations_pb2 from gcloud.bigtable._testing import _FakeStub from gcloud.bigtable.cluster import Cluster @@ -353,10 +353,10 @@ def test_reload(self): self.assertEqual(cluster.display_name, display_name) def test_create(self): + from google.longrunning import operations_pb2 from gcloud._testing import _Monkey from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) - from gcloud.bigtable._generated import operations_pb2 from gcloud.bigtable._testing import _FakeStub from gcloud.bigtable import cluster as MUT @@ -415,10 +415,10 @@ def mock_process_operation(operation_pb): self.assertEqual(process_operation_called, [current_op]) def test_update(self): + from google.longrunning import operations_pb2 from gcloud._testing import _Monkey from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) - from gcloud.bigtable._generated import operations_pb2 from gcloud.bigtable._testing import _FakeStub from gcloud.bigtable import cluster as MUT @@ -476,9 +476,9 @@ def mock_process_operation(operation_pb): self.assertEqual(process_operation_called, [current_op]) def test_delete(self): + from google.protobuf import empty_pb2 from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import empty_pb2 from gcloud.bigtable._testing import _FakeStub project = 'PROJECT' @@ -514,10 +514,10 @@ def test_delete(self): )]) def test_undelete(self): + from google.longrunning import operations_pb2 from gcloud._testing import _Monkey from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import operations_pb2 from gcloud.bigtable._testing import _FakeStub from gcloud.bigtable import cluster as MUT @@ -694,8 +694,8 @@ def _callFUT(self, timestamp): def test_it(self): import datetime + from google.protobuf.timestamp_pb2 import Timestamp from gcloud._helpers import UTC - from gcloud.bigtable._generated.timestamp_pb2 import Timestamp # Epoch is midnight on January 1, 1970 ... dt_stamp = datetime.datetime(1970, month=1, day=1, hour=0, @@ -714,8 +714,8 @@ def _callFUT(self, any_val, expected_type=None): return _parse_pb_any_to_native(any_val, expected_type=expected_type) def test_with_known_type_url(self): + from google.protobuf import any_pb2 from gcloud._testing import _Monkey - from gcloud.bigtable._generated import any_pb2 from gcloud.bigtable._generated import bigtable_data_pb2 as data_pb2 from gcloud.bigtable import cluster as MUT @@ -736,12 +736,12 @@ def test_with_known_type_url(self): self.assertEqual(result, cell) def test_with_create_cluster_metadata(self): - from gcloud.bigtable._generated import any_pb2 + from google.protobuf import any_pb2 + from google.protobuf.timestamp_pb2 import Timestamp from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated.timestamp_pb2 import Timestamp type_url = ('type.googleapis.com/' + messages_pb2._CREATECLUSTERMETADATA.full_name) @@ -766,12 +766,12 @@ def test_with_create_cluster_metadata(self): self.assertEqual(result, metadata) def test_with_update_cluster_metadata(self): - from gcloud.bigtable._generated import any_pb2 + from google.protobuf import any_pb2 + from google.protobuf.timestamp_pb2 import Timestamp from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated.timestamp_pb2 import Timestamp type_url = ('type.googleapis.com/' + messages_pb2._UPDATECLUSTERMETADATA.full_name) @@ -793,12 +793,12 @@ def test_with_update_cluster_metadata(self): self.assertEqual(result, metadata) def test_with_undelete_cluster_metadata(self): - from gcloud.bigtable._generated import any_pb2 + from google.protobuf import any_pb2 + from google.protobuf.timestamp_pb2 import Timestamp from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated.timestamp_pb2 import Timestamp type_url = ('type.googleapis.com/' + messages_pb2._UNDELETECLUSTERMETADATA.full_name) @@ -815,8 +815,8 @@ def test_with_undelete_cluster_metadata(self): self.assertEqual(result, metadata) def test_unknown_type_url(self): + from google.protobuf import any_pb2 from gcloud._testing import _Monkey - from gcloud.bigtable._generated import any_pb2 from gcloud.bigtable import cluster as MUT fake_type_url_map = {} @@ -826,8 +826,8 @@ def test_unknown_type_url(self): self._callFUT(any_val) def test_disagreeing_type_url(self): + from google.protobuf import any_pb2 from gcloud._testing import _Monkey - from gcloud.bigtable._generated import any_pb2 from gcloud.bigtable import cluster as MUT type_url1 = 'foo' @@ -846,10 +846,10 @@ def _callFUT(self, operation_pb): return _process_operation(operation_pb) def test_it(self): + from google.longrunning import operations_pb2 from gcloud._testing import _Monkey from gcloud.bigtable._generated import ( bigtable_cluster_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import operations_pb2 from gcloud.bigtable import cluster as MUT project = 'PROJECT' @@ -891,9 +891,9 @@ def mock_pb_timestamp_to_datetime(timestamp): self.assertEqual(ts_to_dt_called, [request_metadata.request_time]) def test_op_name_parsing_failure(self): + from google.longrunning import operations_pb2 from gcloud.bigtable._generated import ( bigtable_cluster_data_pb2 as data_pb2) - from gcloud.bigtable._generated import operations_pb2 current_op = operations_pb2.Operation(name='invalid') cluster = data_pb2.Cluster(current_operation=current_op) diff --git a/gcloud/bigtable/test_column_family.py b/gcloud/bigtable/test_column_family.py index 2c151c7a5f90a..139a959e0a7bd 100644 --- a/gcloud/bigtable/test_column_family.py +++ b/gcloud/bigtable/test_column_family.py @@ -24,7 +24,7 @@ def _callFUT(self, *args, **kwargs): def test_it(self): import datetime - from gcloud.bigtable._generated import duration_pb2 + from google.protobuf import duration_pb2 seconds = microseconds = 1 timedelta_val = datetime.timedelta(seconds=seconds, @@ -36,7 +36,7 @@ def test_it(self): def test_with_negative_microseconds(self): import datetime - from gcloud.bigtable._generated import duration_pb2 + from google.protobuf import duration_pb2 seconds = 1 microseconds = -5 @@ -49,7 +49,7 @@ def test_with_negative_microseconds(self): def test_with_negative_seconds(self): import datetime - from gcloud.bigtable._generated import duration_pb2 + from google.protobuf import duration_pb2 seconds = -1 microseconds = 5 @@ -69,7 +69,7 @@ def _callFUT(self, *args, **kwargs): def test_it(self): import datetime - from gcloud.bigtable._generated import duration_pb2 + from google.protobuf import duration_pb2 seconds = microseconds = 1 duration_pb = duration_pb2.Duration(seconds=seconds, @@ -146,9 +146,9 @@ def test___ne__same_value(self): def test_to_pb(self): import datetime + from google.protobuf import duration_pb2 from gcloud.bigtable._generated import ( bigtable_table_data_pb2 as data_pb2) - from gcloud.bigtable._generated import duration_pb2 max_age = datetime.timedelta(seconds=1) duration = duration_pb2.Duration(seconds=1) @@ -192,9 +192,9 @@ def test___ne__same_value(self): def test_to_pb(self): import datetime + from google.protobuf import duration_pb2 from gcloud.bigtable._generated import ( bigtable_table_data_pb2 as data_pb2) - from gcloud.bigtable._generated import duration_pb2 from gcloud.bigtable.column_family import MaxAgeGCRule from gcloud.bigtable.column_family import MaxVersionsGCRule @@ -215,9 +215,9 @@ def test_to_pb(self): def test_to_pb_nested(self): import datetime + from google.protobuf import duration_pb2 from gcloud.bigtable._generated import ( bigtable_table_data_pb2 as data_pb2) - from gcloud.bigtable._generated import duration_pb2 from gcloud.bigtable.column_family import MaxAgeGCRule from gcloud.bigtable.column_family import MaxVersionsGCRule @@ -280,9 +280,9 @@ def test___ne__same_value(self): def test_to_pb(self): import datetime + from google.protobuf import duration_pb2 from gcloud.bigtable._generated import ( bigtable_table_data_pb2 as data_pb2) - from gcloud.bigtable._generated import duration_pb2 from gcloud.bigtable.column_family import MaxAgeGCRule from gcloud.bigtable.column_family import MaxVersionsGCRule @@ -304,9 +304,9 @@ def test_to_pb(self): def test_to_pb_nested(self): import datetime + from google.protobuf import duration_pb2 from gcloud.bigtable._generated import ( bigtable_table_data_pb2 as data_pb2) - from gcloud.bigtable._generated import duration_pb2 from gcloud.bigtable.column_family import MaxAgeGCRule from gcloud.bigtable.column_family import MaxVersionsGCRule @@ -511,9 +511,9 @@ def test_update_with_gc_rule(self): self._update_test_helper(gc_rule=gc_rule) def test_delete(self): + from google.protobuf import empty_pb2 from gcloud.bigtable._generated import ( bigtable_table_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import empty_pb2 from gcloud.bigtable._testing import _FakeStub project_id = 'project-id' diff --git a/gcloud/bigtable/test_table.py b/gcloud/bigtable/test_table.py index d6c66b220d400..a84a67061359b 100644 --- a/gcloud/bigtable/test_table.py +++ b/gcloud/bigtable/test_table.py @@ -148,9 +148,9 @@ def test_create_with_split_keys(self): self._create_test_helper(initial_split_keys) def test_rename(self): + from google.protobuf import empty_pb2 from gcloud.bigtable._generated import ( bigtable_table_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import empty_pb2 from gcloud.bigtable._testing import _FakeStub project_id = 'project-id' @@ -252,9 +252,9 @@ def test_list_column_families_failure(self): column_family_name=column_family_name) def test_delete(self): + from google.protobuf import empty_pb2 from gcloud.bigtable._generated import ( bigtable_table_service_messages_pb2 as messages_pb2) - from gcloud.bigtable._generated import empty_pb2 from gcloud.bigtable._testing import _FakeStub project_id = 'project-id' diff --git a/scripts/make_operations_grpc.py b/scripts/make_operations_grpc.py new file mode 100644 index 0000000000000..522f2e3a71366 --- /dev/null +++ b/scripts/make_operations_grpc.py @@ -0,0 +1,116 @@ +# Copyright 2015 Google Inc. All rights reserved. +# +# 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. + +"""Get the inserted gRPC lines for datastore pb2 file.""" + +import os +import shutil +import subprocess +import tempfile + + +ROOT_DIR = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..')) +PROTOS_DIR = os.path.join(ROOT_DIR, 'cloud-bigtable-client', + 'bigtable-protos', 'src', 'main', 'proto') +PROTO_PATH = os.path.join(PROTOS_DIR, 'google', 'longrunning', + 'operations.proto') +GRPC_ONLY_FILE = os.path.join(ROOT_DIR, 'gcloud', 'bigtable', + '_generated', 'operations_grpc_pb2.py') +PROTOC_CMD = 'protoc' +GRPC_PLUGIN = 'grpc_python_plugin' + + +def get_pb2_contents_with_grpc(): + """Get pb2 lines generated by protoc with gRPC plugin. + + :rtype: list + :returns: A list of lines in the generated file. + """ + temp_dir = tempfile.mkdtemp() + generated_path = os.path.join(temp_dir, 'google', 'longrunning', + 'operations_pb2.py') + try: + subprocess.check_output([ + PROTOC_CMD, + '--proto_path', + PROTOS_DIR, + '--python_out', + temp_dir, + '--plugin', + 'protoc-gen-grpc=' + GRPC_PLUGIN, + '--grpc_out', + temp_dir, + PROTO_PATH, + ]) + with open(generated_path, 'rb') as file_obj: + return file_obj.readlines() + finally: + shutil.rmtree(temp_dir, ignore_errors=True) + + +def get_pb2_contents_without_grpc(): + """Get pb2 lines generated by protoc without gRPC plugin. + + :rtype: list + :returns: A list of lines in the generated file. + """ + temp_dir = tempfile.mkdtemp() + generated_path = os.path.join(temp_dir, 'google', 'longrunning', + 'operations_pb2.py') + try: + subprocess.check_output([ + PROTOC_CMD, + '--proto_path', + PROTOS_DIR, + '--python_out', + temp_dir, + PROTO_PATH, + ]) + with open(generated_path, 'rb') as file_obj: + return file_obj.readlines() + finally: + shutil.rmtree(temp_dir, ignore_errors=True) + + +def get_pb2_grpc_only(): + """Get pb2 lines that are only in gRPC. + + :rtype: list + :returns: A list of lines that are only in the pb2 file + generated with the gRPC plugin. + """ + grpc_contents = get_pb2_contents_with_grpc() + non_grpc_contents = get_pb2_contents_without_grpc() + + grpc_only_lines = [] + curr_non_grpc_line = 0 + for line in grpc_contents: + if line == non_grpc_contents[curr_non_grpc_line]: + curr_non_grpc_line += 1 + else: + grpc_only_lines.append(line) + + return grpc_only_lines + + +def main(): + """Write gRPC-only lines to custom module.""" + grpc_only_lines = get_pb2_grpc_only() + with open(GRPC_ONLY_FILE, 'wb') as file_obj: + file_obj.write(''.join(grpc_only_lines)) + + +if __name__ == '__main__': + main() diff --git a/scripts/rewrite_imports.py b/scripts/rewrite_imports.py index 0ed8a310d0efe..4af5ec9a89fd5 100644 --- a/scripts/rewrite_imports.py +++ b/scripts/rewrite_imports.py @@ -23,22 +23,11 @@ IMPORT_TEMPLATE = 'import %s' IMPORT_FROM_TEMPLATE = 'from %s import ' -PROTOBUF_IMPORT_TEMPLATE = 'from google.protobuf import %s ' -REPLACE_PROTOBUF_IMPORT_TEMPLATE = 'from gcloud.bigtable._generated import %s ' REPLACEMENTS = { - 'google.api': 'gcloud.bigtable._generated', 'google.bigtable.admin.cluster.v1': 'gcloud.bigtable._generated', 'google.bigtable.admin.table.v1': 'gcloud.bigtable._generated', 'google.bigtable.v1': 'gcloud.bigtable._generated', - 'google.longrunning': 'gcloud.bigtable._generated', - 'google.rpc': 'gcloud.bigtable._generated', } -GOOGLE_PROTOBUF_CUSTOM = ( - 'any_pb2', - 'duration_pb2', - 'empty_pb2', - 'timestamp_pb2', -) def transform_old_to_new(line, old_module, new_module, @@ -107,11 +96,9 @@ def transform_old_to_new(line, old_module, new_module, def transform_line(line): """Transforms an import line in a PB2 module. - If the line is not an import of one of the packages in - ``REPLACEMENTS`` or ``GOOGLE_PROTOBUF_CUSTOM``, does nothing and returns - the original. Otherwise it replaces the package matched with our local - package or directly rewrites the custom ``google.protobuf`` import - statement. + If the line is not an import of one of the packages in ``REPLACEMENTS``, + does nothing and returns the original. Otherwise it replaces the package + matched with our local package. :type line: str :param line: The line to be transformed. @@ -124,26 +111,6 @@ def transform_line(line): if result is not None: return result - for custom_protobuf_module in GOOGLE_PROTOBUF_CUSTOM: - # We don't use the "from * import" check in transform_old_to_new - # because part of `google.protobuf` comes from the installed - # `protobuf` library. - import_from_statement = PROTOBUF_IMPORT_TEMPLATE % ( - custom_protobuf_module,) - if line.startswith(import_from_statement): - new_import_from_statement = REPLACE_PROTOBUF_IMPORT_TEMPLATE % ( - custom_protobuf_module,) - # Only replace the first instance of the import statement. - return line.replace(import_from_statement, - new_import_from_statement, 1) - - old_module = 'google.protobuf.' + custom_protobuf_module - new_module = 'gcloud.bigtable._generated.' + custom_protobuf_module - result = transform_old_to_new(line, old_module, new_module, - ignore_import_from=True) - if result is not None: - return result - # If no matches, there is nothing to transform. return line diff --git a/setup.py b/setup.py index 8be33426642a7..1d04fc6b9ade8 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,9 @@ REQUIREMENTS = [ 'httplib2 >= 0.9.1', + 'googleapis-common-protos', 'oauth2client >= 1.4.6', - 'protobuf == 3.0.0a3', + 'protobuf >= 3.0.0b2', 'pycrypto', 'six', ]