diff --git a/google/cloud/datastore_admin_v1/__init__.py b/google/cloud/datastore_admin_v1/__init__.py new file mode 100644 index 00000000..a588c3e0 --- /dev/null +++ b/google/cloud/datastore_admin_v1/__init__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://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. + + +from __future__ import absolute_import +import sys +import warnings + +from google.cloud.datastore_admin_v1 import types +from google.cloud.datastore_admin_v1.gapic import datastore_admin_client +from google.cloud.datastore_admin_v1.gapic import enums + + +if sys.version_info[:2] == (2, 7): + message = ( + "A future version of this library will drop support for Python 2.7. " + "More details about Python 2 support for Google Cloud Client Libraries " + "can be found at https://cloud.google.com/python/docs/python2-sunset/" + ) + warnings.warn(message, DeprecationWarning) + + +class DatastoreAdminClient(datastore_admin_client.DatastoreAdminClient): + __doc__ = datastore_admin_client.DatastoreAdminClient.__doc__ + enums = enums + + +__all__ = ( + "enums", + "types", + "DatastoreAdminClient", +) diff --git a/google/cloud/datastore_admin_v1/proto/datastore_admin_pb2.py b/google/cloud/datastore_admin_v1/proto/datastore_admin_pb2.py index f16463bb..f7c8d82e 100644 --- a/google/cloud/datastore_admin_v1/proto/datastore_admin_pb2.py +++ b/google/cloud/datastore_admin_v1/proto/datastore_admin_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/datastore_admin_v1/proto/datastore_admin.proto -"""Generated protocol buffer code.""" + from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/google/cloud/datastore_admin_v1/proto/index_pb2.py b/google/cloud/datastore_admin_v1/proto/index_pb2.py index c1ccb034..41f17a3f 100644 --- a/google/cloud/datastore_admin_v1/proto/index_pb2.py +++ b/google/cloud/datastore_admin_v1/proto/index_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/datastore_admin_v1/proto/index.proto -"""Generated protocol buffer code.""" + from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection diff --git a/google/cloud/datastore_admin_v1/types.py b/google/cloud/datastore_admin_v1/types.py new file mode 100644 index 00000000..17ae2d27 --- /dev/null +++ b/google/cloud/datastore_admin_v1/types.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://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. + + +from __future__ import absolute_import +import sys + +from google.api_core.protobuf_helpers import get_messages + +from google.cloud.datastore_admin_v1.proto import datastore_admin_pb2 +from google.cloud.datastore_admin_v1.proto import index_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import timestamp_pb2 +from google.rpc import status_pb2 + + +_shared_modules = [ + operations_pb2, + any_pb2, + timestamp_pb2, + status_pb2, +] + +_local_modules = [ + datastore_admin_pb2, + index_pb2, +] + +names = [] + +for module in _shared_modules: # pragma: NO COVER + for name, message in get_messages(module).items(): + setattr(sys.modules[__name__], name, message) + names.append(name) +for module in _local_modules: + for name, message in get_messages(module).items(): + message.__module__ = "google.cloud.datastore_admin_v1.types" + setattr(sys.modules[__name__], name, message) + names.append(name) + + +__all__ = tuple(sorted(names)) diff --git a/synth.metadata b/synth.metadata index 865b99bc..133453f2 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,23 +3,22 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/python-datastore", - "sha": "f822b98873c829d4ae01d3de1b0d58e0076948fd" + "sha": "0a5e07c0394709a4a4e79d937a281bec824415c3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5202cfe3e5c2907a1a21a4c6d4bd0812029b6aa3", - "internalRef": "319247865" + "sha": "59f97e6044a1275f83427ab7962a154c00d915b5", + "internalRef": "321058159" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" } } ], diff --git a/synth.py b/synth.py index 36b5150a..792c159f 100644 --- a/synth.py +++ b/synth.py @@ -42,8 +42,12 @@ include_protos=True, ) +s.move( + library / "datastore-admin-v1-py/google/cloud/datastore_admin_v1", + "google/cloud/datastore_admin_v1" +) + s.move(library / "google/cloud/datastore_admin_v1/proto") -s.move(library / "google/cloud/datastore_admin_v1/gapic") # TODO(busunkim): Remove during the microgenerator transition. # This re-orders the parameters to avoid breaking existing code.