@@ -70,6 +70,8 @@ class EkmServiceAsyncClient:
7070 DEFAULT_ENDPOINT = EkmServiceClient .DEFAULT_ENDPOINT
7171 DEFAULT_MTLS_ENDPOINT = EkmServiceClient .DEFAULT_MTLS_ENDPOINT
7272
73+ ekm_config_path = staticmethod (EkmServiceClient .ekm_config_path )
74+ parse_ekm_config_path = staticmethod (EkmServiceClient .parse_ekm_config_path )
7375 ekm_connection_path = staticmethod (EkmServiceClient .ekm_connection_path )
7476 parse_ekm_connection_path = staticmethod (EkmServiceClient .parse_ekm_connection_path )
7577 service_path = staticmethod (EkmServiceClient .service_path )
@@ -756,6 +758,238 @@ async def sample_update_ekm_connection():
756758 # Done; return the response.
757759 return response
758760
761+ async def get_ekm_config (
762+ self ,
763+ request : Optional [Union [ekm_service .GetEkmConfigRequest , dict ]] = None ,
764+ * ,
765+ name : Optional [str ] = None ,
766+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
767+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
768+ metadata : Sequence [Tuple [str , str ]] = (),
769+ ) -> ekm_service .EkmConfig :
770+ r"""Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton
771+ resource for a given project and location.
772+
773+ .. code-block:: python
774+
775+ # This snippet has been automatically generated and should be regarded as a
776+ # code template only.
777+ # It will require modifications to work:
778+ # - It may require correct/in-range values for request initialization.
779+ # - It may require specifying regional endpoints when creating the service
780+ # client as shown in:
781+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
782+ from google.cloud import kms_v1
783+
784+ async def sample_get_ekm_config():
785+ # Create a client
786+ client = kms_v1.EkmServiceAsyncClient()
787+
788+ # Initialize request argument(s)
789+ request = kms_v1.GetEkmConfigRequest(
790+ name="name_value",
791+ )
792+
793+ # Make the request
794+ response = await client.get_ekm_config(request=request)
795+
796+ # Handle the response
797+ print(response)
798+
799+ Args:
800+ request (Optional[Union[google.cloud.kms_v1.types.GetEkmConfigRequest, dict]]):
801+ The request object. Request message for
802+ [EkmService.GetEkmConfig][google.cloud.kms.v1.EkmService.GetEkmConfig].
803+ name (:class:`str`):
804+ Required. The [name][google.cloud.kms.v1.EkmConfig.name]
805+ of the [EkmConfig][google.cloud.kms.v1.EkmConfig] to
806+ get.
807+
808+ This corresponds to the ``name`` field
809+ on the ``request`` instance; if ``request`` is provided, this
810+ should not be set.
811+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
812+ should be retried.
813+ timeout (float): The timeout for this request.
814+ metadata (Sequence[Tuple[str, str]]): Strings which should be
815+ sent along with the request as metadata.
816+
817+ Returns:
818+ google.cloud.kms_v1.types.EkmConfig:
819+ An [EkmConfig][google.cloud.kms.v1.EkmConfig] is a singleton resource that
820+ represents configuration parameters that apply to all
821+ [CryptoKeys][google.cloud.kms.v1.CryptoKey] and
822+ [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]
823+ with a
824+ [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel]
825+ of
826+ [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC]
827+ in a given project and location.
828+
829+ """
830+ # Create or coerce a protobuf request object.
831+ # Quick check: If we got a request object, we should *not* have
832+ # gotten any keyword arguments that map to the request.
833+ has_flattened_params = any ([name ])
834+ if request is not None and has_flattened_params :
835+ raise ValueError (
836+ "If the `request` argument is set, then none of "
837+ "the individual field arguments should be set."
838+ )
839+
840+ request = ekm_service .GetEkmConfigRequest (request )
841+
842+ # If we have keyword arguments corresponding to fields on the
843+ # request, apply these.
844+ if name is not None :
845+ request .name = name
846+
847+ # Wrap the RPC method; this adds retry and timeout information,
848+ # and friendly error handling.
849+ rpc = gapic_v1 .method_async .wrap_method (
850+ self ._client ._transport .get_ekm_config ,
851+ default_timeout = None ,
852+ client_info = DEFAULT_CLIENT_INFO ,
853+ )
854+
855+ # Certain fields should be provided within the metadata header;
856+ # add these here.
857+ metadata = tuple (metadata ) + (
858+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
859+ )
860+
861+ # Send the request.
862+ response = await rpc (
863+ request ,
864+ retry = retry ,
865+ timeout = timeout ,
866+ metadata = metadata ,
867+ )
868+
869+ # Done; return the response.
870+ return response
871+
872+ async def update_ekm_config (
873+ self ,
874+ request : Optional [Union [ekm_service .UpdateEkmConfigRequest , dict ]] = None ,
875+ * ,
876+ ekm_config : Optional [ekm_service .EkmConfig ] = None ,
877+ update_mask : Optional [field_mask_pb2 .FieldMask ] = None ,
878+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
879+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
880+ metadata : Sequence [Tuple [str , str ]] = (),
881+ ) -> ekm_service .EkmConfig :
882+ r"""Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton
883+ resource for a given project and location.
884+
885+ .. code-block:: python
886+
887+ # This snippet has been automatically generated and should be regarded as a
888+ # code template only.
889+ # It will require modifications to work:
890+ # - It may require correct/in-range values for request initialization.
891+ # - It may require specifying regional endpoints when creating the service
892+ # client as shown in:
893+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
894+ from google.cloud import kms_v1
895+
896+ async def sample_update_ekm_config():
897+ # Create a client
898+ client = kms_v1.EkmServiceAsyncClient()
899+
900+ # Initialize request argument(s)
901+ request = kms_v1.UpdateEkmConfigRequest(
902+ )
903+
904+ # Make the request
905+ response = await client.update_ekm_config(request=request)
906+
907+ # Handle the response
908+ print(response)
909+
910+ Args:
911+ request (Optional[Union[google.cloud.kms_v1.types.UpdateEkmConfigRequest, dict]]):
912+ The request object. Request message for
913+ [EkmService.UpdateEkmConfig][google.cloud.kms.v1.EkmService.UpdateEkmConfig].
914+ ekm_config (:class:`google.cloud.kms_v1.types.EkmConfig`):
915+ Required. [EkmConfig][google.cloud.kms.v1.EkmConfig]
916+ with updated values.
917+
918+ This corresponds to the ``ekm_config`` field
919+ on the ``request`` instance; if ``request`` is provided, this
920+ should not be set.
921+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
922+ Required. List of fields to be
923+ updated in this request.
924+
925+ This corresponds to the ``update_mask`` field
926+ on the ``request`` instance; if ``request`` is provided, this
927+ should not be set.
928+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
929+ should be retried.
930+ timeout (float): The timeout for this request.
931+ metadata (Sequence[Tuple[str, str]]): Strings which should be
932+ sent along with the request as metadata.
933+
934+ Returns:
935+ google.cloud.kms_v1.types.EkmConfig:
936+ An [EkmConfig][google.cloud.kms.v1.EkmConfig] is a singleton resource that
937+ represents configuration parameters that apply to all
938+ [CryptoKeys][google.cloud.kms.v1.CryptoKey] and
939+ [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]
940+ with a
941+ [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel]
942+ of
943+ [EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC]
944+ in a given project and location.
945+
946+ """
947+ # Create or coerce a protobuf request object.
948+ # Quick check: If we got a request object, we should *not* have
949+ # gotten any keyword arguments that map to the request.
950+ has_flattened_params = any ([ekm_config , update_mask ])
951+ if request is not None and has_flattened_params :
952+ raise ValueError (
953+ "If the `request` argument is set, then none of "
954+ "the individual field arguments should be set."
955+ )
956+
957+ request = ekm_service .UpdateEkmConfigRequest (request )
958+
959+ # If we have keyword arguments corresponding to fields on the
960+ # request, apply these.
961+ if ekm_config is not None :
962+ request .ekm_config = ekm_config
963+ if update_mask is not None :
964+ request .update_mask = update_mask
965+
966+ # Wrap the RPC method; this adds retry and timeout information,
967+ # and friendly error handling.
968+ rpc = gapic_v1 .method_async .wrap_method (
969+ self ._client ._transport .update_ekm_config ,
970+ default_timeout = None ,
971+ client_info = DEFAULT_CLIENT_INFO ,
972+ )
973+
974+ # Certain fields should be provided within the metadata header;
975+ # add these here.
976+ metadata = tuple (metadata ) + (
977+ gapic_v1 .routing_header .to_grpc_metadata (
978+ (("ekm_config.name" , request .ekm_config .name ),)
979+ ),
980+ )
981+
982+ # Send the request.
983+ response = await rpc (
984+ request ,
985+ retry = retry ,
986+ timeout = timeout ,
987+ metadata = metadata ,
988+ )
989+
990+ # Done; return the response.
991+ return response
992+
759993 async def get_location (
760994 self ,
761995 request : Optional [locations_pb2 .GetLocationRequest ] = None ,
0 commit comments