Skip to content
This repository was archived by the owner on Dec 31, 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
160 changes: 160 additions & 0 deletions google/cloud/kms_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,31 @@
]
}
}
},
"rest": {
"libraryClient": "EkmServiceClient",
"rpcs": {
"CreateEkmConnection": {
"methods": [
"create_ekm_connection"
]
},
"GetEkmConnection": {
"methods": [
"get_ekm_connection"
]
},
"ListEkmConnections": {
"methods": [
"list_ekm_connections"
]
},
"UpdateEkmConnection": {
"methods": [
"update_ekm_connection"
]
}
}
}
}
},
Expand Down Expand Up @@ -330,6 +355,141 @@
]
}
}
},
"rest": {
"libraryClient": "KeyManagementServiceClient",
"rpcs": {
"AsymmetricDecrypt": {
"methods": [
"asymmetric_decrypt"
]
},
"AsymmetricSign": {
"methods": [
"asymmetric_sign"
]
},
"CreateCryptoKey": {
"methods": [
"create_crypto_key"
]
},
"CreateCryptoKeyVersion": {
"methods": [
"create_crypto_key_version"
]
},
"CreateImportJob": {
"methods": [
"create_import_job"
]
},
"CreateKeyRing": {
"methods": [
"create_key_ring"
]
},
"Decrypt": {
"methods": [
"decrypt"
]
},
"DestroyCryptoKeyVersion": {
"methods": [
"destroy_crypto_key_version"
]
},
"Encrypt": {
"methods": [
"encrypt"
]
},
"GenerateRandomBytes": {
"methods": [
"generate_random_bytes"
]
},
"GetCryptoKey": {
"methods": [
"get_crypto_key"
]
},
"GetCryptoKeyVersion": {
"methods": [
"get_crypto_key_version"
]
},
"GetImportJob": {
"methods": [
"get_import_job"
]
},
"GetKeyRing": {
"methods": [
"get_key_ring"
]
},
"GetPublicKey": {
"methods": [
"get_public_key"
]
},
"ImportCryptoKeyVersion": {
"methods": [
"import_crypto_key_version"
]
},
"ListCryptoKeyVersions": {
"methods": [
"list_crypto_key_versions"
]
},
"ListCryptoKeys": {
"methods": [
"list_crypto_keys"
]
},
"ListImportJobs": {
"methods": [
"list_import_jobs"
]
},
"ListKeyRings": {
"methods": [
"list_key_rings"
]
},
"MacSign": {
"methods": [
"mac_sign"
]
},
"MacVerify": {
"methods": [
"mac_verify"
]
},
"RestoreCryptoKeyVersion": {
"methods": [
"restore_crypto_key_version"
]
},
"UpdateCryptoKey": {
"methods": [
"update_crypto_key"
]
},
"UpdateCryptoKeyPrimaryVersion": {
"methods": [
"update_crypto_key_primary_version"
]
},
"UpdateCryptoKeyVersion": {
"methods": [
"update_crypto_key_version"
]
}
}
}
}
}
Expand Down
109 changes: 109 additions & 0 deletions google/cloud/kms_v1/services/ekm_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # 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 @@ -755,6 +756,114 @@ async def sample_update_ekm_connection():
# 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, str]] = (),
) -> 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, str]]): Strings which should be
sent along with the request as metadata.
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 = gapic_v1.method.wrap_method(
self._client._transport.get_location,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

# 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),)),
)

# 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, str]] = (),
) -> 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, str]]): Strings which should be
sent along with the request as metadata.
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 = gapic_v1.method.wrap_method(
self._client._transport.list_locations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

# 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),)),
)

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

# Done; return the response.
return response

async def set_iam_policy(
self,
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
Expand Down
Loading