Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
13 changes: 11 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(root_doc, "google-cloud-shell", "google-cloud-shell Documentation", [author], 1,)
(
root_doc,
"google-cloud-shell",
"google-cloud-shell Documentation",
[author],
1,
)
]

# If true, show URL addresses after external links.
Expand Down Expand Up @@ -355,7 +361,10 @@
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
Expand Down
42 changes: 35 additions & 7 deletions google/cloud/shell_v1/services/cloud_shell_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ def sample_get_environment():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable, core_exceptions.Unknown,
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
),
Expand All @@ -316,7 +317,12 @@ def sample_get_environment():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -398,7 +404,12 @@ def sample_start_environment():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand Down Expand Up @@ -484,7 +495,12 @@ def sample_authorize_environment():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand Down Expand Up @@ -571,7 +587,12 @@ def sample_add_public_key():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand Down Expand Up @@ -658,7 +679,12 @@ def sample_remove_public_key():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand All @@ -680,7 +706,9 @@ async def __aexit__(self, exc_type, exc, tb):

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-shell",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-shell",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down
86 changes: 68 additions & 18 deletions google/cloud/shell_v1/services/cloud_shell_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class CloudShellServiceClientMeta(type):
_transport_registry["grpc_asyncio"] = CloudShellServiceGrpcAsyncIOTransport

def get_transport_class(
cls, label: str = None,
cls,
label: str = None,
) -> Type[CloudShellServiceTransport]:
"""Returns an appropriate transport class.

Expand Down Expand Up @@ -171,10 +172,14 @@ def transport(self) -> CloudShellServiceTransport:
return self._transport

@staticmethod
def environment_path(user: str, environment: str,) -> str:
def environment_path(
user: str,
environment: str,
) -> str:
"""Returns a fully-qualified environment string."""
return "users/{user}/environments/{environment}".format(
user=user, environment=environment,
user=user,
environment=environment,
)

@staticmethod
Expand All @@ -184,7 +189,9 @@ def parse_environment_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
def common_billing_account_path(
billing_account: str,
) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
Expand All @@ -197,9 +204,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
def common_folder_path(
folder: str,
) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
return "folders/{folder}".format(
folder=folder,
)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
Expand All @@ -208,9 +219,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
def common_organization_path(
organization: str,
) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
return "organizations/{organization}".format(
organization=organization,
)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
Expand All @@ -219,9 +234,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
def common_project_path(
project: str,
) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
return "projects/{project}".format(
project=project,
)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
Expand All @@ -230,10 +249,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
def common_location_path(
project: str,
location: str,
) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
project=project,
location=location,
)

@staticmethod
Expand Down Expand Up @@ -501,7 +524,12 @@ def sample_get_environment():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -584,7 +612,12 @@ def sample_start_environment():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down Expand Up @@ -671,7 +704,12 @@ def sample_authorize_environment():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down Expand Up @@ -759,7 +797,12 @@ def sample_add_public_key():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down Expand Up @@ -847,7 +890,12 @@ def sample_remove_public_key():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down Expand Up @@ -876,7 +924,9 @@ def __exit__(self, type, value, traceback):

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-shell",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-shell",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-shell",).version,
gapic_version=pkg_resources.get_distribution(
"google-cloud-shell",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
Expand Down Expand Up @@ -127,35 +129,42 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable, core_exceptions.Unknown,
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
self.start_environment: gapic_v1.method.wrap_method(
self.start_environment, default_timeout=60.0, client_info=client_info,
self.start_environment,
default_timeout=60.0,
client_info=client_info,
),
self.authorize_environment: gapic_v1.method.wrap_method(
self.authorize_environment,
default_timeout=60.0,
client_info=client_info,
),
self.add_public_key: gapic_v1.method.wrap_method(
self.add_public_key, default_timeout=60.0, client_info=client_info,
self.add_public_key,
default_timeout=60.0,
client_info=client_info,
),
self.remove_public_key: gapic_v1.method.wrap_method(
self.remove_public_key, default_timeout=60.0, client_info=client_info,
self.remove_public_key,
default_timeout=60.0,
client_info=client_info,
),
}

def close(self):
"""Closes resources associated with the transport.

.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ def create_channel(

@property
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
"""Return the channel designed to connect to this service."""
return self._grpc_channel

@property
Expand Down
Loading