Skip to content

Commit

Permalink
fix: add missing datastore admin client files (#43)
Browse files Browse the repository at this point in the history
* fix: add missing datastore admin client files

* fix: remove commented line
  • Loading branch information
crwilcox committed Jul 13, 2020
1 parent 0a5e07c commit 0d40f87
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 8 deletions.
45 changes: 45 additions & 0 deletions google/cloud/datastore_admin_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion google/cloud/datastore_admin_v1/proto/index_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions google/cloud/datastore_admin_v1/types.py
Original file line number Diff line number Diff line change
@@ -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))
9 changes: 4 additions & 5 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down
6 changes: 5 additions & 1 deletion synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0d40f87

Please sign in to comment.