Skip to content

Commit 0d40f87

Browse files
authored
fix: add missing datastore admin client files (#43)
* fix: add missing datastore admin client files * fix: remove commented line
1 parent 0a5e07c commit 0d40f87

File tree

6 files changed

+112
-8
lines changed

6 files changed

+112
-8
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
from __future__ import absolute_import
19+
import sys
20+
import warnings
21+
22+
from google.cloud.datastore_admin_v1 import types
23+
from google.cloud.datastore_admin_v1.gapic import datastore_admin_client
24+
from google.cloud.datastore_admin_v1.gapic import enums
25+
26+
27+
if sys.version_info[:2] == (2, 7):
28+
message = (
29+
"A future version of this library will drop support for Python 2.7. "
30+
"More details about Python 2 support for Google Cloud Client Libraries "
31+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
32+
)
33+
warnings.warn(message, DeprecationWarning)
34+
35+
36+
class DatastoreAdminClient(datastore_admin_client.DatastoreAdminClient):
37+
__doc__ = datastore_admin_client.DatastoreAdminClient.__doc__
38+
enums = enums
39+
40+
41+
__all__ = (
42+
"enums",
43+
"types",
44+
"DatastoreAdminClient",
45+
)

google/cloud/datastore_admin_v1/proto/datastore_admin_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

google/cloud/datastore_admin_v1/proto/index_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
from __future__ import absolute_import
19+
import sys
20+
21+
from google.api_core.protobuf_helpers import get_messages
22+
23+
from google.cloud.datastore_admin_v1.proto import datastore_admin_pb2
24+
from google.cloud.datastore_admin_v1.proto import index_pb2
25+
from google.longrunning import operations_pb2
26+
from google.protobuf import any_pb2
27+
from google.protobuf import timestamp_pb2
28+
from google.rpc import status_pb2
29+
30+
31+
_shared_modules = [
32+
operations_pb2,
33+
any_pb2,
34+
timestamp_pb2,
35+
status_pb2,
36+
]
37+
38+
_local_modules = [
39+
datastore_admin_pb2,
40+
index_pb2,
41+
]
42+
43+
names = []
44+
45+
for module in _shared_modules: # pragma: NO COVER
46+
for name, message in get_messages(module).items():
47+
setattr(sys.modules[__name__], name, message)
48+
names.append(name)
49+
for module in _local_modules:
50+
for name, message in get_messages(module).items():
51+
message.__module__ = "google.cloud.datastore_admin_v1.types"
52+
setattr(sys.modules[__name__], name, message)
53+
names.append(name)
54+
55+
56+
__all__ = tuple(sorted(names))

synth.metadata

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "git@github.com:googleapis/python-datastore",
7-
"sha": "f822b98873c829d4ae01d3de1b0d58e0076948fd"
6+
"sha": "0a5e07c0394709a4a4e79d937a281bec824415c3"
87
}
98
},
109
{
1110
"git": {
1211
"name": "googleapis",
1312
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "5202cfe3e5c2907a1a21a4c6d4bd0812029b6aa3",
15-
"internalRef": "319247865"
13+
"sha": "59f97e6044a1275f83427ab7962a154c00d915b5",
14+
"internalRef": "321058159"
1615
}
1716
},
1817
{
1918
"git": {
2019
"name": "synthtool",
2120
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "303271797a360f8a439203413f13a160f2f5b3b4"
21+
"sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e"
2322
}
2423
}
2524
],

synth.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@
4242
include_protos=True,
4343
)
4444

45+
s.move(
46+
library / "datastore-admin-v1-py/google/cloud/datastore_admin_v1",
47+
"google/cloud/datastore_admin_v1"
48+
)
49+
4550
s.move(library / "google/cloud/datastore_admin_v1/proto")
46-
s.move(library / "google/cloud/datastore_admin_v1/gapic")
4751

4852
# TODO(busunkim): Remove during the microgenerator transition.
4953
# This re-orders the parameters to avoid breaking existing code.

0 commit comments

Comments
 (0)