diff --git a/google/cloud/kms_v1/services/ekm_service/async_client.py b/google/cloud/kms_v1/services/ekm_service/async_client.py index 9aab6c69..6bffae6c 100644 --- a/google/cloud/kms_v1/services/ekm_service/async_client.py +++ b/google/cloud/kms_v1/services/ekm_service/async_client.py @@ -223,6 +223,26 @@ async def list_ekm_connections( ) -> pagers.ListEkmConnectionsAsyncPager: r"""Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_ekm_connections(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListEkmConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_ekm_connections(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.kms_v1.types.ListEkmConnectionsRequest, dict]): @@ -318,6 +338,26 @@ async def get_ekm_connection( [EkmConnection][google.cloud.kms.v1.EkmConnection]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetEkmConnectionRequest( + name="name_value", + ) + + # Make the request + response = client.get_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetEkmConnectionRequest, dict]): The request object. Request message for @@ -415,6 +455,27 @@ async def create_ekm_connection( in a given Project and Location. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateEkmConnectionRequest( + parent="parent_value", + ekm_connection_id="ekm_connection_id_value", + ) + + # Make the request + response = client.create_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateEkmConnectionRequest, dict]): The request object. Request message for @@ -530,6 +591,25 @@ async def update_ekm_connection( metadata. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateEkmConnectionRequest( + ) + + # Make the request + response = client.update_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateEkmConnectionRequest, dict]): The request object. Request message for diff --git a/google/cloud/kms_v1/services/ekm_service/client.py b/google/cloud/kms_v1/services/ekm_service/client.py index 4b8e4374..9e644de9 100644 --- a/google/cloud/kms_v1/services/ekm_service/client.py +++ b/google/cloud/kms_v1/services/ekm_service/client.py @@ -441,6 +441,27 @@ def list_ekm_connections( r"""Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_ekm_connections(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListEkmConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_ekm_connections(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ListEkmConnectionsRequest, dict]): The request object. Request message for @@ -525,6 +546,27 @@ def get_ekm_connection( [EkmConnection][google.cloud.kms.v1.EkmConnection]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetEkmConnectionRequest( + name="name_value", + ) + + # Make the request + response = client.get_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetEkmConnectionRequest, dict]): The request object. Request message for @@ -612,6 +654,28 @@ def create_ekm_connection( in a given Project and Location. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateEkmConnectionRequest( + parent="parent_value", + ekm_connection_id="ekm_connection_id_value", + ) + + # Make the request + response = client.create_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateEkmConnectionRequest, dict]): The request object. Request message for @@ -717,6 +781,26 @@ def update_ekm_connection( metadata. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateEkmConnectionRequest( + ) + + # Make the request + response = client.update_ekm_connection(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateEkmConnectionRequest, dict]): The request object. Request message for diff --git a/google/cloud/kms_v1/services/key_management_service/async_client.py b/google/cloud/kms_v1/services/key_management_service/async_client.py index 9d3e4fe4..2766ae1e 100644 --- a/google/cloud/kms_v1/services/key_management_service/async_client.py +++ b/google/cloud/kms_v1/services/key_management_service/async_client.py @@ -255,6 +255,26 @@ async def list_key_rings( ) -> pagers.ListKeyRingsAsyncPager: r"""Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_key_rings(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListKeyRingsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_key_rings(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.kms_v1.types.ListKeyRingsRequest, dict]): @@ -347,6 +367,26 @@ async def list_crypto_keys( ) -> pagers.ListCryptoKeysAsyncPager: r"""Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_crypto_keys(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeysRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_keys(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.kms_v1.types.ListCryptoKeysRequest, dict]): @@ -439,6 +479,26 @@ async def list_crypto_key_versions( ) -> pagers.ListCryptoKeyVersionsAsyncPager: r"""Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_crypto_key_versions(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeyVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_key_versions(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.kms_v1.types.ListCryptoKeyVersionsRequest, dict]): @@ -532,6 +592,26 @@ async def list_import_jobs( ) -> pagers.ListImportJobsAsyncPager: r"""Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_import_jobs(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListImportJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_import_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.kms_v1.types.ListImportJobsRequest, dict]): @@ -626,6 +706,26 @@ async def get_key_ring( [KeyRing][google.cloud.kms.v1.KeyRing]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetKeyRingRequest( + name="name_value", + ) + + # Make the request + response = client.get_key_ring(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetKeyRingRequest, dict]): The request object. Request message for @@ -711,6 +811,26 @@ async def get_crypto_key( [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetCryptoKeyRequest, dict]): The request object. Request message for @@ -801,6 +921,26 @@ async def get_crypto_key_version( [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -903,6 +1043,26 @@ async def get_public_key( [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_public_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetPublicKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_public_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetPublicKeyRequest, dict]): The request object. Request message for @@ -990,6 +1150,26 @@ async def get_import_job( [ImportJob][google.cloud.kms.v1.ImportJob]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetImportJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_import_job(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetImportJobRequest, dict]): The request object. Request message for @@ -1120,6 +1300,27 @@ async def create_key_ring( Project and Location. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateKeyRingRequest( + parent="parent_value", + key_ring_id="key_ring_id_value", + ) + + # Make the request + response = client.create_key_ring(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateKeyRingRequest, dict]): The request object. Request message for @@ -1228,6 +1429,27 @@ async def create_crypto_key( are required. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyRequest( + parent="parent_value", + crypto_key_id="crypto_key_id_value", + ) + + # Make the request + response = client.create_crypto_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateCryptoKeyRequest, dict]): The request object. Request message for @@ -1343,6 +1565,26 @@ async def create_crypto_key_version( [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyVersionRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1447,6 +1689,29 @@ async def import_crypto_key_version( [CryptoKey][google.cloud.kms.v1.CryptoKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_import_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ImportCryptoKeyVersionRequest( + rsa_aes_wrapped_key=b'rsa_aes_wrapped_key_blob', + parent="parent_value", + algorithm="EXTERNAL_SYMMETRIC_ENCRYPTION", + import_job="import_job_value", + ) + + # Make the request + response = client.import_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ImportCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1516,6 +1781,32 @@ async def create_import_job( is required. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + import_job = kms_v1.ImportJob() + import_job.import_method = "RSA_OAEP_4096_SHA1_AES_256" + import_job.protection_level = "EXTERNAL_VPC" + + request = kms_v1.CreateImportJobRequest( + parent="parent_value", + import_job_id="import_job_id_value", + import_job=import_job, + ) + + # Make the request + response = client.create_import_job(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateImportJobRequest, dict]): The request object. Request message for @@ -1661,6 +1952,24 @@ async def update_crypto_key( ) -> resources.CryptoKey: r"""Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyRequest( + ) + + # Make the request + response = client.update_crypto_key(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyRequest, dict]): @@ -1775,6 +2084,25 @@ async def update_crypto_key_version( to move between other states. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyVersionRequest( + ) + + # Make the request + response = client.update_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1887,6 +2215,27 @@ async def update_crypto_key_primary_version( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key_primary_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyPrimaryVersionRequest( + name="name_value", + crypto_key_version_id="crypto_key_version_id_value", + ) + + # Make the request + response = client.update_crypto_key_primary_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyPrimaryVersionRequest, dict]): The request object. Request message for @@ -2007,6 +2356,26 @@ async def destroy_crypto_key_version( may be called to reverse the process. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_destroy_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DestroyCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.destroy_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.DestroyCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -2113,6 +2482,26 @@ async def restore_crypto_key_version( will be cleared. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_restore_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.RestoreCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.restore_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.RestoreCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -2213,6 +2602,27 @@ async def encrypt( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_encrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.EncryptRequest( + name="name_value", + plaintext=b'plaintext_blob', + ) + + # Make the request + response = client.encrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.EncryptRequest, dict]): The request object. Request message for @@ -2325,6 +2735,27 @@ async def decrypt( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.decrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.DecryptRequest, dict]): The request object. Request message for @@ -2424,6 +2855,26 @@ async def asymmetric_sign( [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_asymmetric_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricSignRequest( + name="name_value", + ) + + # Make the request + response = client.asymmetric_sign(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.AsymmetricSignRequest, dict]): The request object. Request message for @@ -2529,6 +2980,27 @@ async def asymmetric_decrypt( ASYMMETRIC_DECRYPT. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_asymmetric_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricDecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.asymmetric_decrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.AsymmetricDecryptRequest, dict]): The request object. Request message for @@ -2627,6 +3099,27 @@ async def mac_sign( same key. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_mac_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacSignRequest( + name="name_value", + data=b'data_blob', + ) + + # Make the request + response = client.mac_sign(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.MacSignRequest, dict]): The request object. Request message for @@ -2726,6 +3219,28 @@ async def mac_verify( verification was successful. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_mac_verify(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacVerifyRequest( + name="name_value", + data=b'data_blob', + mac=b'mac_blob', + ) + + # Make the request + response = client.mac_verify(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.MacVerifyRequest, dict]): The request object. Request message for @@ -2829,6 +3344,25 @@ async def generate_random_bytes( source in the provided location. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_generate_random_bytes(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GenerateRandomBytesRequest( + ) + + # Make the request + response = client.generate_random_bytes(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GenerateRandomBytesRequest, dict]): The request object. Request message for diff --git a/google/cloud/kms_v1/services/key_management_service/client.py b/google/cloud/kms_v1/services/key_management_service/client.py index c444d4fa..a33798ed 100644 --- a/google/cloud/kms_v1/services/key_management_service/client.py +++ b/google/cloud/kms_v1/services/key_management_service/client.py @@ -532,6 +532,27 @@ def list_key_rings( r"""Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_key_rings(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListKeyRingsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_key_rings(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ListKeyRingsRequest, dict]): The request object. Request message for @@ -614,6 +635,27 @@ def list_crypto_keys( r"""Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_crypto_keys(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeysRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_keys(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ListCryptoKeysRequest, dict]): The request object. Request message for @@ -696,6 +738,27 @@ def list_crypto_key_versions( r"""Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_crypto_key_versions(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeyVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_key_versions(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ListCryptoKeyVersionsRequest, dict]): The request object. Request message for @@ -779,6 +842,27 @@ def list_import_jobs( r"""Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_list_import_jobs(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListImportJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_import_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ListImportJobsRequest, dict]): The request object. Request message for @@ -862,6 +946,27 @@ def get_key_ring( [KeyRing][google.cloud.kms.v1.KeyRing]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetKeyRingRequest( + name="name_value", + ) + + # Make the request + response = client.get_key_ring(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetKeyRingRequest, dict]): The request object. Request message for @@ -937,6 +1042,27 @@ def get_crypto_key( [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetCryptoKeyRequest, dict]): The request object. Request message for @@ -1017,6 +1143,27 @@ def get_crypto_key_version( [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1109,6 +1256,27 @@ def get_public_key( [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_public_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetPublicKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_public_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetPublicKeyRequest, dict]): The request object. Request message for @@ -1186,6 +1354,27 @@ def get_import_job( [ImportJob][google.cloud.kms.v1.ImportJob]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_get_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetImportJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_import_job(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GetImportJobRequest, dict]): The request object. Request message for @@ -1306,6 +1495,28 @@ def create_key_ring( Project and Location. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateKeyRingRequest( + parent="parent_value", + key_ring_id="key_ring_id_value", + ) + + # Make the request + response = client.create_key_ring(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateKeyRingRequest, dict]): The request object. Request message for @@ -1404,6 +1615,28 @@ def create_crypto_key( are required. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyRequest( + parent="parent_value", + crypto_key_id="crypto_key_id_value", + ) + + # Make the request + response = client.create_crypto_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateCryptoKeyRequest, dict]): The request object. Request message for @@ -1509,6 +1742,27 @@ def create_crypto_key_version( [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyVersionRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1615,6 +1869,30 @@ def import_crypto_key_version( [CryptoKey][google.cloud.kms.v1.CryptoKey]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_import_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ImportCryptoKeyVersionRequest( + rsa_aes_wrapped_key=b'rsa_aes_wrapped_key_blob', + parent="parent_value", + algorithm="EXTERNAL_SYMMETRIC_ENCRYPTION", + import_job="import_job_value", + ) + + # Make the request + response = client.import_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.ImportCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -1687,6 +1965,33 @@ def create_import_job( is required. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_create_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + import_job = kms_v1.ImportJob() + import_job.import_method = "RSA_OAEP_4096_SHA1_AES_256" + import_job.protection_level = "EXTERNAL_VPC" + + request = kms_v1.CreateImportJobRequest( + parent="parent_value", + import_job_id="import_job_id_value", + import_job=import_job, + ) + + # Make the request + response = client.create_import_job(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.CreateImportJobRequest, dict]): The request object. Request message for @@ -1823,6 +2128,25 @@ def update_crypto_key( r"""Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyRequest( + ) + + # Make the request + response = client.update_crypto_key(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyRequest, dict]): The request object. Request message for @@ -1926,6 +2250,26 @@ def update_crypto_key_version( to move between other states. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyVersionRequest( + ) + + # Make the request + response = client.update_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -2030,6 +2374,28 @@ def update_crypto_key_primary_version( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_update_crypto_key_primary_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyPrimaryVersionRequest( + name="name_value", + crypto_key_version_id="crypto_key_version_id_value", + ) + + # Make the request + response = client.update_crypto_key_primary_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.UpdateCryptoKeyPrimaryVersionRequest, dict]): The request object. Request message for @@ -2142,6 +2508,27 @@ def destroy_crypto_key_version( may be called to reverse the process. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_destroy_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DestroyCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.destroy_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.DestroyCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -2240,6 +2627,27 @@ def restore_crypto_key_version( will be cleared. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_restore_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.RestoreCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.restore_crypto_key_version(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.RestoreCryptoKeyVersionRequest, dict]): The request object. Request message for @@ -2332,6 +2740,28 @@ def encrypt( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_encrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.EncryptRequest( + name="name_value", + plaintext=b'plaintext_blob', + ) + + # Make the request + response = client.encrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.EncryptRequest, dict]): The request object. Request message for @@ -2434,6 +2864,28 @@ def decrypt( [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.decrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.DecryptRequest, dict]): The request object. Request message for @@ -2523,6 +2975,27 @@ def asymmetric_sign( [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_asymmetric_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricSignRequest( + name="name_value", + ) + + # Make the request + response = client.asymmetric_sign(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.AsymmetricSignRequest, dict]): The request object. Request message for @@ -2618,6 +3091,28 @@ def asymmetric_decrypt( ASYMMETRIC_DECRYPT. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_asymmetric_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricDecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.asymmetric_decrypt(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.AsymmetricDecryptRequest, dict]): The request object. Request message for @@ -2706,6 +3201,28 @@ def mac_sign( same key. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_mac_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacSignRequest( + name="name_value", + data=b'data_blob', + ) + + # Make the request + response = client.mac_sign(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.MacSignRequest, dict]): The request object. Request message for @@ -2795,6 +3312,29 @@ def mac_verify( verification was successful. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_mac_verify(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacVerifyRequest( + name="name_value", + data=b'data_blob', + mac=b'mac_blob', + ) + + # Make the request + response = client.mac_verify(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.MacVerifyRequest, dict]): The request object. Request message for @@ -2888,6 +3428,26 @@ def generate_random_bytes( source in the provided location. + + .. code-block:: + + from google.cloud import kms_v1 + + def sample_generate_random_bytes(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GenerateRandomBytesRequest( + ) + + # Make the request + response = client.generate_random_bytes(request=request) + + # Handle the response + print(response) + + Args: request (Union[google.cloud.kms_v1.types.GenerateRandomBytesRequest, dict]): The request object. Request message for diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_async.py new file mode 100644 index 00000000..7e028b5a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_async] +from google.cloud import kms_v1 + + +async def sample_create_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.CreateEkmConnectionRequest( + parent="parent_value", + ekm_connection_id="ekm_connection_id_value", + ) + + # Make the request + response = await client.create_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_sync.py new file mode 100644 index 00000000..aa114499 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_sync] +from google.cloud import kms_v1 + + +def sample_create_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateEkmConnectionRequest( + parent="parent_value", + ekm_connection_id="ekm_connection_id_value", + ) + + # Make the request + response = client.create_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_async.py new file mode 100644 index 00000000..4960ace1 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_GetEkmConnection_async] +from google.cloud import kms_v1 + + +async def sample_get_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetEkmConnectionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_GetEkmConnection_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_sync.py new file mode 100644 index 00000000..b5887ac0 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_GetEkmConnection_sync] +from google.cloud import kms_v1 + + +def sample_get_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetEkmConnectionRequest( + name="name_value", + ) + + # Make the request + response = client.get_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_GetEkmConnection_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_async.py new file mode 100644 index 00000000..63d7e7f5 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEkmConnections +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_ListEkmConnections_async] +from google.cloud import kms_v1 + + +async def sample_list_ekm_connections(): + # Create a client + client = kms_v1.EkmServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ListEkmConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_ekm_connections(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_ListEkmConnections_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_sync.py new file mode 100644 index 00000000..6d70bcca --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEkmConnections +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_ListEkmConnections_sync] +from google.cloud import kms_v1 + + +def sample_list_ekm_connections(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListEkmConnectionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_ekm_connections(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_ListEkmConnections_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_async.py new file mode 100644 index 00000000..8ea58452 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_async] +from google.cloud import kms_v1 + + +async def sample_update_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.UpdateEkmConnectionRequest( + ) + + # Make the request + response = await client.update_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_sync.py new file mode 100644 index 00000000..96db3993 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEkmConnection +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_sync] +from google.cloud import kms_v1 + + +def sample_update_ekm_connection(): + # Create a client + client = kms_v1.EkmServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateEkmConnectionRequest( + ) + + # Make the request + response = client.update_ekm_connection(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_async.py new file mode 100644 index 00000000..1f2ee5e6 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsymmetricDecrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_async] +from google.cloud import kms_v1 + + +async def sample_asymmetric_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricDecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = await client.asymmetric_decrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_sync.py new file mode 100644 index 00000000..bb3b40d8 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsymmetricDecrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_sync] +from google.cloud import kms_v1 + + +def sample_asymmetric_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricDecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.asymmetric_decrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_async.py new file mode 100644 index 00000000..68ac5f22 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsymmetricSign +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_async] +from google.cloud import kms_v1 + + +async def sample_asymmetric_sign(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricSignRequest( + name="name_value", + ) + + # Make the request + response = await client.asymmetric_sign(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_sync.py new file mode 100644 index 00000000..f01bb5f5 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsymmetricSign +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_sync] +from google.cloud import kms_v1 + + +def sample_asymmetric_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.AsymmetricSignRequest( + name="name_value", + ) + + # Make the request + response = client.asymmetric_sign(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_async.py new file mode 100644 index 00000000..a59de630 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_async] +from google.cloud import kms_v1 + + +async def sample_create_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyRequest( + parent="parent_value", + crypto_key_id="crypto_key_id_value", + ) + + # Make the request + response = await client.create_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_sync.py new file mode 100644 index 00000000..d2ca255c --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_sync] +from google.cloud import kms_v1 + + +def sample_create_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyRequest( + parent="parent_value", + crypto_key_id="crypto_key_id_value", + ) + + # Make the request + response = client.create_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_async.py new file mode 100644 index 00000000..8eb0b520 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_create_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyVersionRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_sync.py new file mode 100644 index 00000000..57697b2a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_create_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateCryptoKeyVersionRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_async.py new file mode 100644 index 00000000..f028974a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateImportJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_async] +from google.cloud import kms_v1 + + +async def sample_create_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + import_job = kms_v1.ImportJob() + import_job.import_method = "RSA_OAEP_4096_SHA1_AES_256" + import_job.protection_level = "EXTERNAL_VPC" + + request = kms_v1.CreateImportJobRequest( + parent="parent_value", + import_job_id="import_job_id_value", + import_job=import_job, + ) + + # Make the request + response = await client.create_import_job(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_sync.py new file mode 100644 index 00000000..83d506d2 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_import_job_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateImportJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_sync] +from google.cloud import kms_v1 + + +def sample_create_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + import_job = kms_v1.ImportJob() + import_job.import_method = "RSA_OAEP_4096_SHA1_AES_256" + import_job.protection_level = "EXTERNAL_VPC" + + request = kms_v1.CreateImportJobRequest( + parent="parent_value", + import_job_id="import_job_id_value", + import_job=import_job, + ) + + # Make the request + response = client.create_import_job(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_async.py new file mode 100644 index 00000000..6a44228e --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKeyRing +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_async] +from google.cloud import kms_v1 + + +async def sample_create_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.CreateKeyRingRequest( + parent="parent_value", + key_ring_id="key_ring_id_value", + ) + + # Make the request + response = await client.create_key_ring(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_sync.py new file mode 100644 index 00000000..7e897cf4 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_create_key_ring_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKeyRing +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_sync] +from google.cloud import kms_v1 + + +def sample_create_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.CreateKeyRingRequest( + parent="parent_value", + key_ring_id="key_ring_id_value", + ) + + # Make the request + response = client.create_key_ring(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_async.py new file mode 100644 index 00000000..b1426dad --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Decrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_Decrypt_async] +from google.cloud import kms_v1 + + +async def sample_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.DecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = await client.decrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_Decrypt_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_sync.py new file mode 100644 index 00000000..31562671 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_decrypt_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Decrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_Decrypt_sync] +from google.cloud import kms_v1 + + +def sample_decrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DecryptRequest( + name="name_value", + ciphertext=b'ciphertext_blob', + ) + + # Make the request + response = client.decrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_Decrypt_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_async.py new file mode 100644 index 00000000..6a613059 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DestroyCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_destroy_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.DestroyCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = await client.destroy_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_sync.py new file mode 100644 index 00000000..af8f0649 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DestroyCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_destroy_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.DestroyCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.destroy_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_async.py new file mode 100644 index 00000000..31cb0378 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Encrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_Encrypt_async] +from google.cloud import kms_v1 + + +async def sample_encrypt(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.EncryptRequest( + name="name_value", + plaintext=b'plaintext_blob', + ) + + # Make the request + response = await client.encrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_Encrypt_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_sync.py new file mode 100644 index 00000000..3d7ab77d --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_encrypt_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Encrypt +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_Encrypt_sync] +from google.cloud import kms_v1 + + +def sample_encrypt(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.EncryptRequest( + name="name_value", + plaintext=b'plaintext_blob', + ) + + # Make the request + response = client.encrypt(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_Encrypt_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_async.py new file mode 100644 index 00000000..60a80e0f --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateRandomBytes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_async] +from google.cloud import kms_v1 + + +async def sample_generate_random_bytes(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GenerateRandomBytesRequest( + ) + + # Make the request + response = await client.generate_random_bytes(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_sync.py new file mode 100644 index 00000000..7b69e424 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateRandomBytes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_sync] +from google.cloud import kms_v1 + + +def sample_generate_random_bytes(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GenerateRandomBytesRequest( + ) + + # Make the request + response = client.generate_random_bytes(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_async.py new file mode 100644 index 00000000..467fc7ee --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_async] +from google.cloud import kms_v1 + + +async def sample_get_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_sync.py new file mode 100644 index 00000000..82661e78 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_sync] +from google.cloud import kms_v1 + + +def sample_get_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_async.py new file mode 100644 index 00000000..0f37fd91 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_get_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_sync.py new file mode 100644 index 00000000..a62f8776 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_get_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.get_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_async.py new file mode 100644 index 00000000..bf35accc --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetImportJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_async] +from google.cloud import kms_v1 + + +async def sample_get_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetImportJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_import_job(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_sync.py new file mode 100644 index 00000000..d3374d3a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_import_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetImportJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_sync] +from google.cloud import kms_v1 + + +def sample_get_import_job(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetImportJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_import_job(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_async.py new file mode 100644 index 00000000..3b96903a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKeyRing +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_async] +from google.cloud import kms_v1 + + +async def sample_get_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetKeyRingRequest( + name="name_value", + ) + + # Make the request + response = await client.get_key_ring(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_sync.py new file mode 100644 index 00000000..9c90893f --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_key_ring_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKeyRing +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_sync] +from google.cloud import kms_v1 + + +def sample_get_key_ring(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetKeyRingRequest( + name="name_value", + ) + + # Make the request + response = client.get_key_ring(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_async.py new file mode 100644 index 00000000..81f2564d --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPublicKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_async] +from google.cloud import kms_v1 + + +async def sample_get_public_key(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.GetPublicKeyRequest( + name="name_value", + ) + + # Make the request + response = await client.get_public_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_sync.py new file mode 100644 index 00000000..f9c1c09c --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_get_public_key_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPublicKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_sync] +from google.cloud import kms_v1 + + +def sample_get_public_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.GetPublicKeyRequest( + name="name_value", + ) + + # Make the request + response = client.get_public_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_async.py new file mode 100644 index 00000000..2777c086 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_import_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ImportCryptoKeyVersionRequest( + rsa_aes_wrapped_key=b'rsa_aes_wrapped_key_blob', + parent="parent_value", + algorithm="EXTERNAL_SYMMETRIC_ENCRYPTION", + import_job="import_job_value", + ) + + # Make the request + response = await client.import_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_sync.py new file mode 100644 index 00000000..ef25c76a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_import_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ImportCryptoKeyVersionRequest( + rsa_aes_wrapped_key=b'rsa_aes_wrapped_key_blob', + parent="parent_value", + algorithm="EXTERNAL_SYMMETRIC_ENCRYPTION", + import_job="import_job_value", + ) + + # Make the request + response = client.import_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_async.py new file mode 100644 index 00000000..3c8d29a7 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCryptoKeyVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_async] +from google.cloud import kms_v1 + + +async def sample_list_crypto_key_versions(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeyVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_key_versions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_sync.py new file mode 100644 index 00000000..ed173262 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCryptoKeyVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_sync] +from google.cloud import kms_v1 + + +def sample_list_crypto_key_versions(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeyVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_key_versions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_async.py new file mode 100644 index 00000000..95db1387 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCryptoKeys +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_async] +from google.cloud import kms_v1 + + +async def sample_list_crypto_keys(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeysRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_keys(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_sync.py new file mode 100644 index 00000000..1722e988 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCryptoKeys +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_sync] +from google.cloud import kms_v1 + + +def sample_list_crypto_keys(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListCryptoKeysRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_crypto_keys(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_async.py new file mode 100644 index 00000000..f64af8ff --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListImportJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_async] +from google.cloud import kms_v1 + + +async def sample_list_import_jobs(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ListImportJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_import_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_sync.py new file mode 100644 index 00000000..2fa1f91b --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_import_jobs_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListImportJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_sync] +from google.cloud import kms_v1 + + +def sample_list_import_jobs(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListImportJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_import_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_async.py new file mode 100644 index 00000000..af0da33a --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKeyRings +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_async] +from google.cloud import kms_v1 + + +async def sample_list_key_rings(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.ListKeyRingsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_key_rings(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_sync.py new file mode 100644 index 00000000..c6bbf71d --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_list_key_rings_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKeyRings +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_sync] +from google.cloud import kms_v1 + + +def sample_list_key_rings(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.ListKeyRingsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_key_rings(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_async.py new file mode 100644 index 00000000..bce9e732 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MacSign +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_MacSign_async] +from google.cloud import kms_v1 + + +async def sample_mac_sign(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.MacSignRequest( + name="name_value", + data=b'data_blob', + ) + + # Make the request + response = await client.mac_sign(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_MacSign_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_sync.py new file mode 100644 index 00000000..dd2b0f13 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_sign_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MacSign +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_MacSign_sync] +from google.cloud import kms_v1 + + +def sample_mac_sign(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacSignRequest( + name="name_value", + data=b'data_blob', + ) + + # Make the request + response = client.mac_sign(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_MacSign_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_async.py new file mode 100644 index 00000000..38c8f197 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MacVerify +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_MacVerify_async] +from google.cloud import kms_v1 + + +async def sample_mac_verify(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.MacVerifyRequest( + name="name_value", + data=b'data_blob', + mac=b'mac_blob', + ) + + # Make the request + response = await client.mac_verify(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_MacVerify_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_sync.py new file mode 100644 index 00000000..d2d69923 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_mac_verify_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for MacVerify +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_MacVerify_sync] +from google.cloud import kms_v1 + + +def sample_mac_verify(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.MacVerifyRequest( + name="name_value", + data=b'data_blob', + mac=b'mac_blob', + ) + + # Make the request + response = client.mac_verify(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_MacVerify_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_async.py new file mode 100644 index 00000000..236e6c89 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_restore_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.RestoreCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = await client.restore_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_sync.py new file mode 100644 index 00000000..2b0eae27 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_restore_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.RestoreCryptoKeyVersionRequest( + name="name_value", + ) + + # Make the request + response = client.restore_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_async.py new file mode 100644 index 00000000..0df6c4e0 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_async] +from google.cloud import kms_v1 + + +async def sample_update_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyRequest( + ) + + # Make the request + response = await client.update_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_async.py new file mode 100644 index 00000000..236cd506 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKeyPrimaryVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_async] +from google.cloud import kms_v1 + + +async def sample_update_crypto_key_primary_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyPrimaryVersionRequest( + name="name_value", + crypto_key_version_id="crypto_key_version_id_value", + ) + + # Make the request + response = await client.update_crypto_key_primary_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_sync.py new file mode 100644 index 00000000..5a873459 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKeyPrimaryVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] +from google.cloud import kms_v1 + + +def sample_update_crypto_key_primary_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyPrimaryVersionRequest( + name="name_value", + crypto_key_version_id="crypto_key_version_id_value", + ) + + # Make the request + response = client.update_crypto_key_primary_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_sync.py new file mode 100644 index 00000000..570bee1d --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKey +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_sync] +from google.cloud import kms_v1 + + +def sample_update_crypto_key(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyRequest( + ) + + # Make the request + response = client.update_crypto_key(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_sync] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_async.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_async.py new file mode 100644 index 00000000..1da651b2 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_async] +from google.cloud import kms_v1 + + +async def sample_update_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceAsyncClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyVersionRequest( + ) + + # Make the request + response = await client.update_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_async] diff --git a/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_sync.py b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_sync.py new file mode 100644 index 00000000..a985b415 --- /dev/null +++ b/samples/generated_samples/cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCryptoKeyVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-kms + + +# [START cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_sync] +from google.cloud import kms_v1 + + +def sample_update_crypto_key_version(): + # Create a client + client = kms_v1.KeyManagementServiceClient() + + # Initialize request argument(s) + request = kms_v1.UpdateCryptoKeyVersionRequest( + ) + + # Make the request + response = client.update_crypto_key_version(request=request) + + # Handle the response + print(response) + +# [END cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/samples/generated_samples/snippet_metadata_kms_v1.json b/samples/generated_samples/snippet_metadata_kms_v1.json new file mode 100644 index 00000000..f40d8f7c --- /dev/null +++ b/samples/generated_samples/snippet_metadata_kms_v1.json @@ -0,0 +1,2674 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "CreateEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_async.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "CreateEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_create_ekm_connection_sync.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_CreateEkmConnection_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "GetEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_async.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_GetEkmConnection_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "GetEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_get_ekm_connection_sync.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_GetEkmConnection_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "ListEkmConnections" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_async.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_ListEkmConnections_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "ListEkmConnections" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_list_ekm_connections_sync.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_ListEkmConnections_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "UpdateEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_async.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "EkmService" + }, + "shortName": "UpdateEkmConnection" + } + }, + "file": "cloudkms_generated_kms_v1_ekm_service_update_ekm_connection_sync.py", + "regionTag": "cloudkms_generated_kms_v1_EkmService_UpdateEkmConnection_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "AsymmetricDecrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "AsymmetricDecrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_asymmetric_decrypt_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_AsymmetricDecrypt_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "AsymmetricSign" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "AsymmetricSign" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_asymmetric_sign_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_AsymmetricSign_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKeyVersion_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_crypto_key_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_crypto_key_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateCryptoKey_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateImportJob" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_import_job_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateImportJob" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_import_job_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateImportJob_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateKeyRing" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_key_ring_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "CreateKeyRing" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_create_key_ring_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_CreateKeyRing_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "Decrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_decrypt_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_Decrypt_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "Decrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_decrypt_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_Decrypt_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "DestroyCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "DestroyCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_destroy_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_DestroyCryptoKeyVersion_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "Encrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_encrypt_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_Encrypt_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "Encrypt" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_encrypt_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_Encrypt_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GenerateRandomBytes" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GenerateRandomBytes" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_generate_random_bytes_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GenerateRandomBytes_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKeyVersion_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_crypto_key_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_crypto_key_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetCryptoKey_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetImportJob" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_import_job_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetImportJob" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_import_job_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetImportJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetKeyRing" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_key_ring_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetKeyRing" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_key_ring_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetKeyRing_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetPublicKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_public_key_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "GetPublicKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_get_public_key_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_GetPublicKey_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ImportCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ImportCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_import_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ImportCryptoKeyVersion_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListCryptoKeyVersions" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListCryptoKeyVersions" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_crypto_key_versions_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeyVersions_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListCryptoKeys" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListCryptoKeys" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_crypto_keys_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListCryptoKeys_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListImportJobs" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_import_jobs_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListImportJobs" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_import_jobs_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListImportJobs_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListKeyRings" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_key_rings_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "ListKeyRings" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_list_key_rings_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_ListKeyRings_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "MacSign" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_mac_sign_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_MacSign_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "MacSign" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_mac_sign_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_MacSign_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "MacVerify" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_mac_verify_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_MacVerify_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "MacVerify" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_mac_verify_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_MacVerify_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "RestoreCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "RestoreCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_restore_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_RestoreCryptoKeyVersion_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKeyPrimaryVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKeyPrimaryVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_primary_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKeyVersion" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_version_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKeyVersion_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_async.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "KeyManagementService" + }, + "shortName": "UpdateCryptoKey" + } + }, + "file": "cloudkms_generated_kms_v1_key_management_service_update_crypto_key_sync.py", + "regionTag": "cloudkms_generated_kms_v1_KeyManagementService_UpdateCryptoKey_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +}