
    2                     x    d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d dej                        Z G d d	e	      Z
y
)z+API Library for `gcloud tasks cmek-config`.    )absolute_import)division)unicode_literals)
exceptionsc                       e Zd ZdZy)RequiredFieldsMissingErrorzEError for when calling a method when a required field is unspecified.N)__name__
__module____qualname____doc__     /lib/googlecloudsdk/api_lib/tasks/cmek_config.pyr   r      s    Mr   r   c                   &    e Zd ZdZd Z	 ddZd Zy)
CmekConfigz6Client for cmekConfig resource in the Cloud Tasks API.c                      || _         || _        y )N)messagescmek_config_service)selfr   r   s      r   __init__zCmekConfig.__init__   s    DM2Dr   c                 <   |r||t        d      |s"|||t        dj                  |||            dj                  ||      }| j                  j                  ||      }| j                  j	                  ||      }| j
                  j                  |      S )zGPrepares and sends a UpdateCmekConfig request for the given CmekConfig.zGThe location or project are undefined. Please set these flags properly.zOne or more of the --kms-key-name, --kms-keyring, --location, or --project are invalid. Please set these flags properly or make sure the full KMS key name is valid. (args: kms_key={}, location={}, project={})8projects/{project_id}/locations/{location_id}/cmekConfig
project_idlocation_id)namekmsKey)
cmekConfigr   )r   formatr   r   2CloudtasksProjectsLocationsUpdateCmekConfigRequestr   UpdateCmekConfig)r   r   r   full_kms_key_nameclearcmek_config_namecmek_configrequests           r   r!   zCmekConfig.UpdateCmekConfig#   s    
 +%);&.  ![%8J<N&   1;
K	  	CII!{ 	J 	
  --**  + K mmNN O G
 ##44W==r   c                 
   |t        dj                  |            |t        dj                  |            dj                  ||      }| j                  j                  |      }| j                  j                  |      S )zDPrepares and sends a GetCmekConfig request for the given CmekConfig.zCProject ({project_id}) is invalid. Must specify --project properly.)r   zKLocation path ({location_id}) is invalid. Must specify --location properly.)r   r   r   )r   )r   r   r   /CloudtasksProjectsLocationsGetCmekConfigRequestr   GetCmekConfig)r   r   r   r$   r&   s        r   r)   zCmekConfig.GetCmekConfigI   s    &vv4  &v+v6  	CII!{ 	J 	
 
 mmKK L G ##11'::r   N)F)r	   r
   r   r   r   r!   r)   r   r   r   r   r      s    >3
 ?D$>L;r   r   N)r   
__future__r   r   r   googlecloudsdk.corer   Errorr   objectr   r   r   r   <module>r.      s8    2 &  ' *N!1!1 NC; C;r   