Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore

from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
Expand Down Expand Up @@ -367,7 +368,7 @@ async def sample_list_secrets():
Returns:
google.cloud.secretmanager_v1beta1.services.secret_manager_service.pagers.ListSecretsAsyncPager:
Response message for
[SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].
[SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].

Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -516,8 +517,8 @@ async def sample_create_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -765,8 +766,8 @@ async def sample_get_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -889,8 +890,8 @@ async def sample_update_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -1116,7 +1117,7 @@ async def sample_list_secret_versions():
Returns:
google.cloud.secretmanager_v1beta1.services.secret_manager_service.pagers.ListSecretVersionsAsyncPager:
Response message for
[SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].
[SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].

Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -1368,7 +1369,7 @@ async def sample_access_secret_version():
Returns:
google.cloud.secretmanager_v1beta1.types.AccessSecretVersionResponse:
Response message for
[SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].
[SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -2112,6 +2113,116 @@ async def sample_test_iam_permissions():
# Done; return the response.
return response

async def get_location(
self,
request: Optional[locations_pb2.GetLocationRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> locations_pb2.Location:
r"""Gets information about a location.

Args:
request (:class:`~.location_pb2.GetLocationRequest`):
The request object. Request message for
`GetLocation` method.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
~.location_pb2.Location:
Location object.
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = locations_pb2.GetLocationRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self.transport._wrapped_methods[self._client._transport.get_location]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

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

# Done; return the response.
return response

async def list_locations(
self,
request: Optional[locations_pb2.ListLocationsRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> locations_pb2.ListLocationsResponse:
r"""Lists information about the supported locations for this service.

Args:
request (:class:`~.location_pb2.ListLocationsRequest`):
The request object. Request message for
`ListLocations` method.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
~.location_pb2.ListLocationsResponse:
Response message for ``ListLocations`` method.
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = locations_pb2.ListLocationsRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self.transport._wrapped_methods[self._client._transport.list_locations]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

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

# Done; return the response.
return response

async def __aenter__(self) -> "SecretManagerServiceAsyncClient":
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

_LOGGER = std_logging.getLogger(__name__)

from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
Expand Down Expand Up @@ -804,7 +805,7 @@ def sample_list_secrets():
Returns:
google.cloud.secretmanager_v1beta1.services.secret_manager_service.pagers.ListSecretsPager:
Response message for
[SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].
[SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].

Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -950,8 +951,8 @@ def sample_create_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -1193,8 +1194,8 @@ def sample_get_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -1314,8 +1315,8 @@ def sample_update_secret():

Returns:
google.cloud.secretmanager_v1beta1.types.Secret:
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can
be accessed.
A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is
made up of zero or more
Expand Down Expand Up @@ -1535,7 +1536,7 @@ def sample_list_secret_versions():
Returns:
google.cloud.secretmanager_v1beta1.services.secret_manager_service.pagers.ListSecretVersionsPager:
Response message for
[SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].
[SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].

Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -1781,7 +1782,7 @@ def sample_access_secret_version():
Returns:
google.cloud.secretmanager_v1beta1.types.AccessSecretVersionResponse:
Response message for
[SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].
[SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -2523,6 +2524,124 @@ def __exit__(self, type, value, traceback):
"""
self.transport.close()

def get_location(
self,
request: Optional[locations_pb2.GetLocationRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> locations_pb2.Location:
r"""Gets information about a location.

Args:
request (:class:`~.location_pb2.GetLocationRequest`):
The request object. Request message for
`GetLocation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
~.location_pb2.Location:
Location object.
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = locations_pb2.GetLocationRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.get_location]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._validate_universe_domain()

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

# Done; return the response.
return response
except core_exceptions.GoogleAPICallError as e:
self._add_cred_info_for_auth_errors(e)
raise e

def list_locations(
self,
request: Optional[locations_pb2.ListLocationsRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> locations_pb2.ListLocationsResponse:
r"""Lists information about the supported locations for this service.

Args:
request (:class:`~.location_pb2.ListLocationsRequest`):
The request object. Request message for
`ListLocations` method.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
~.location_pb2.ListLocationsResponse:
Response message for ``ListLocations`` method.
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = locations_pb2.ListLocationsRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.list_locations]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._validate_universe_domain()

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

# Done; return the response.
return response
except core_exceptions.GoogleAPICallError as e:
self._add_cred_info_for_auth_errors(e)
raise e


DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
Expand Down
Loading
Loading