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
1 change: 1 addition & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
releaseType: python
handleGHRelease: true
manifest: true
# NOTE: this section is generated by synthtool.languages.python
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
branches:
Expand Down
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.4.3"
}
1 change: 0 additions & 1 deletion docs/shell_v1/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Shell v1 API

.. automodule:: google.cloud.shell_v1.types
:members:
:undoc-members:
:show-inheritance:
4 changes: 4 additions & 0 deletions google/cloud/shell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.shell import gapic_version as package_version

__version__ = package_version.__version__


from google.cloud.shell_v1.services.cloud_shell_service.async_client import (
CloudShellServiceAsyncClient,
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/shell/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://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.
#
__version__ = "1.4.3" # {x-release-please-version}
4 changes: 4 additions & 0 deletions google/cloud/shell_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.shell import gapic_version as package_version

__version__ = package_version.__version__


from .services.cloud_shell_service import (
CloudShellServiceAsyncClient,
Expand Down
48 changes: 29 additions & 19 deletions google/cloud/shell_v1/services/cloud_shell_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)

from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
Expand Down Expand Up @@ -171,9 +181,9 @@ def transport(self) -> CloudShellServiceTransport:
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, CloudShellServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the cloud shell service client.
Expand Down Expand Up @@ -217,11 +227,11 @@ def __init__(

async def get_environment(
self,
request: Union[cloudshell.GetEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.GetEnvironmentRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloudshell.Environment:
r"""Gets an environment. Returns NOT_FOUND if the environment does
Expand Down Expand Up @@ -254,7 +264,7 @@ async def sample_get_environment():
print(response)

Args:
request (Union[google.cloud.shell_v1.types.GetEnvironmentRequest, dict]):
request (Optional[Union[google.cloud.shell_v1.types.GetEnvironmentRequest, dict]]):
The request object. Request message for
[GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment].
name (:class:`str`):
Expand Down Expand Up @@ -337,10 +347,10 @@ async def sample_get_environment():

async def start_environment(
self,
request: Union[cloudshell.StartEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.StartEnvironmentRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Starts an existing environment, allowing clients to
Expand Down Expand Up @@ -382,7 +392,7 @@ async def sample_start_environment():
print(response)

Args:
request (Union[google.cloud.shell_v1.types.StartEnvironmentRequest, dict]):
request (Optional[Union[google.cloud.shell_v1.types.StartEnvironmentRequest, dict]]):
The request object. Request message for
[StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -438,10 +448,10 @@ async def sample_start_environment():

async def authorize_environment(
self,
request: Union[cloudshell.AuthorizeEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.AuthorizeEnvironmentRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Sends OAuth credentials to a running environment on
Expand Down Expand Up @@ -480,7 +490,7 @@ async def sample_authorize_environment():
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AuthorizeEnvironmentRequest, dict]):
request (Optional[Union[google.cloud.shell_v1.types.AuthorizeEnvironmentRequest, dict]]):
The request object. Request message for
[AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -535,10 +545,10 @@ async def sample_authorize_environment():

async def add_public_key(
self,
request: Union[cloudshell.AddPublicKeyRequest, dict] = None,
request: Optional[Union[cloudshell.AddPublicKeyRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Adds a public SSH key to an environment, allowing clients with
Expand Down Expand Up @@ -576,7 +586,7 @@ async def sample_add_public_key():
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AddPublicKeyRequest, dict]):
request (Optional[Union[google.cloud.shell_v1.types.AddPublicKeyRequest, dict]]):
The request object. Request message for
[AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -633,10 +643,10 @@ async def sample_add_public_key():

async def remove_public_key(
self,
request: Union[cloudshell.RemovePublicKeyRequest, dict] = None,
request: Optional[Union[cloudshell.RemovePublicKeyRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Removes a public SSH key from an environment. Clients will no
Expand Down Expand Up @@ -674,7 +684,7 @@ async def sample_remove_public_key():
print(response)

Args:
request (Union[google.cloud.shell_v1.types.RemovePublicKeyRequest, dict]):
request (Optional[Union[google.cloud.shell_v1.types.RemovePublicKeyRequest, dict]]):
The request object. Request message for
[RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down
44 changes: 28 additions & 16 deletions google/cloud/shell_v1/services/cloud_shell_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -60,7 +71,7 @@ class CloudShellServiceClientMeta(type):

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

Expand Down Expand Up @@ -338,8 +349,8 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, CloudShellServiceTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
transport: Optional[Union[str, CloudShellServiceTransport]] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the cloud shell service client.
Expand All @@ -353,7 +364,7 @@ def __init__(
transport (Union[str, CloudShellServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -383,6 +394,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down Expand Up @@ -435,11 +447,11 @@ def __init__(

def get_environment(
self,
request: Union[cloudshell.GetEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.GetEnvironmentRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloudshell.Environment:
r"""Gets an environment. Returns NOT_FOUND if the environment does
Expand Down Expand Up @@ -545,10 +557,10 @@ def sample_get_environment():

def start_environment(
self,
request: Union[cloudshell.StartEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.StartEnvironmentRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Starts an existing environment, allowing clients to
Expand Down Expand Up @@ -647,10 +659,10 @@ def sample_start_environment():

def authorize_environment(
self,
request: Union[cloudshell.AuthorizeEnvironmentRequest, dict] = None,
request: Optional[Union[cloudshell.AuthorizeEnvironmentRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Sends OAuth credentials to a running environment on
Expand Down Expand Up @@ -745,10 +757,10 @@ def sample_authorize_environment():

def add_public_key(
self,
request: Union[cloudshell.AddPublicKeyRequest, dict] = None,
request: Optional[Union[cloudshell.AddPublicKeyRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Adds a public SSH key to an environment, allowing clients with
Expand Down Expand Up @@ -844,10 +856,10 @@ def sample_add_public_key():

def remove_public_key(
self,
request: Union[cloudshell.RemovePublicKeyRequest, dict] = None,
request: Optional[Union[cloudshell.RemovePublicKeyRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Removes a public SSH key from an environment. Clients will no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self,
*,
host: str = DEFAULT_HOST,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def __init__(
self,
*,
host: str = "cloudshell.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: Optional[grpc.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
Expand Down Expand Up @@ -189,8 +189,8 @@ def __init__(
def create_channel(
cls,
host: str = "cloudshell.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CloudShellServiceGrpcAsyncIOTransport(CloudShellServiceTransport):
def create_channel(
cls,
host: str = "cloudshell.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down Expand Up @@ -99,15 +99,15 @@ def __init__(
self,
*,
host: str = "cloudshell.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: aio.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
channel: Optional[aio.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
Expand Down
Loading