Skip to content

Commit

Permalink
[CHANGE ME] Re-generated spanner to pick up changes in the API or cli…
Browse files Browse the repository at this point in the history
…ent library generator.
  • Loading branch information
yoshi-automation committed Feb 14, 2019
1 parent fd126fd commit 48ec3e3
Show file tree
Hide file tree
Showing 35 changed files with 5,657 additions and 8,185 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"google.spanner.admin.database.v1.DatabaseAdmin": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
"non_idempotent": []
},
"retry_params": {
"default": {
Expand All @@ -13,56 +13,56 @@
"initial_rpc_timeout_millis": 60000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 60000,
"total_timeout_millis": 600000,
"total_timeout_millis": 600000
}
},
"methods": {
"ListDatabases": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"CreateDatabase": {
"timeout_millis": 30000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"GetDatabase": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"UpdateDatabaseDdl": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"DropDatabase": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"GetDatabaseDdl": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"SetIamPolicy": {
"timeout_millis": 30000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"GetIamPolicy": {
"timeout_millis": 30000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
"retry_params_name": "default"
},
"TestIamPermissions": {
"timeout_millis": 30000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
},
"retry_params_name": "default"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class State(enum.IntEnum):
with ``FAILED_PRECONDITION`` in this state.
READY (int): The database is fully created and ready for use.
"""

STATE_UNSPECIFIED = 0
CREATING = 1
READY = 2
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ class DatabaseAdminGrpcTransport(object):
which can be used to take advantage of advanced
features of gRPC.
"""

# The scopes needed to make gRPC calls to all of the methods defined
# in this service.
_OAUTH_SCOPES = (
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/spanner.admin",
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/spanner.admin',
)

def __init__(
self, channel=None, credentials=None, address="spanner.googleapis.com:443"
):
def __init__(self,
channel=None,
credentials=None,
address='spanner.googleapis.com:443'):
"""Instantiate the transport class.
Args:
Expand All @@ -56,32 +56,35 @@ def __init__(
# exception (channels come with credentials baked in already).
if channel is not None and credentials is not None:
raise ValueError(
"The `channel` and `credentials` arguments are mutually " "exclusive."
)
'The `channel` and `credentials` arguments are mutually '
'exclusive.', )

# Create the channel.
if channel is None:
channel = self.create_channel(address=address, credentials=credentials)
channel = self.create_channel(
address=address,
credentials=credentials,
)

self._channel = channel

# gRPC uses objects called "stubs" that are bound to the
# channel and provide a basic method for each RPC.
self._stubs = {
"database_admin_stub": spanner_database_admin_pb2_grpc.DatabaseAdminStub(
channel
)
'database_admin_stub':
spanner_database_admin_pb2_grpc.DatabaseAdminStub(channel),
}

# Because this API includes a method that returns a
# long-running operation (proto: google.longrunning.Operation),
# instantiate an LRO client.
self._operations_client = google.api_core.operations_v1.OperationsClient(
channel
)
channel)

@classmethod
def create_channel(cls, address="spanner.googleapis.com:443", credentials=None):
def create_channel(cls,
address='spanner.googleapis.com:443',
credentials=None):
"""Create and return a gRPC channel object.
Args:
Expand All @@ -96,7 +99,9 @@ def create_channel(cls, address="spanner.googleapis.com:443", credentials=None):
grpc.Channel: A gRPC channel object.
"""
return google.api_core.grpc_helpers.create_channel(
address, credentials=credentials, scopes=cls._OAUTH_SCOPES
address,
credentials=credentials,
scopes=cls._OAUTH_SCOPES,
)

@property
Expand All @@ -119,7 +124,7 @@ def list_databases(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].ListDatabases
return self._stubs['database_admin_stub'].ListDatabases

@property
def create_database(self):
Expand All @@ -137,7 +142,7 @@ def create_database(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].CreateDatabase
return self._stubs['database_admin_stub'].CreateDatabase

@property
def get_database(self):
Expand All @@ -150,7 +155,7 @@ def get_database(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].GetDatabase
return self._stubs['database_admin_stub'].GetDatabase

@property
def update_database_ddl(self):
Expand All @@ -168,7 +173,7 @@ def update_database_ddl(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].UpdateDatabaseDdl
return self._stubs['database_admin_stub'].UpdateDatabaseDdl

@property
def drop_database(self):
Expand All @@ -181,7 +186,7 @@ def drop_database(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].DropDatabase
return self._stubs['database_admin_stub'].DropDatabase

@property
def get_database_ddl(self):
Expand All @@ -196,7 +201,7 @@ def get_database_ddl(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].GetDatabaseDdl
return self._stubs['database_admin_stub'].GetDatabaseDdl

@property
def set_iam_policy(self):
Expand All @@ -213,7 +218,7 @@ def set_iam_policy(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].SetIamPolicy
return self._stubs['database_admin_stub'].SetIamPolicy

@property
def get_iam_policy(self):
Expand All @@ -230,7 +235,7 @@ def get_iam_policy(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].GetIamPolicy
return self._stubs['database_admin_stub'].GetIamPolicy

@property
def test_iam_permissions(self):
Expand All @@ -249,4 +254,4 @@ def test_iam_permissions(self):
deserialized request object and returns a
deserialized response object.
"""
return self._stubs["database_admin_stub"].TestIamPermissions
return self._stubs['database_admin_stub'].TestIamPermissions
Loading

0 comments on commit 48ec3e3

Please sign in to comment.