
    @)                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  Sr	Sr
S	rS
r\r\
SSS.\SSS.\SSS.0r\4S jr\4S jr\4S jr\4S jr\4S jr " S S5      rg)zEssential Contacts API.    )absolute_import)division)unicode_literals)
list_pager)apisessentialcontactsv1alpha1v1beta1v1+googleCloudEssentialcontactsV1alpha1Contact+GoogleCloudEssentialcontactsV1alpha1Contact)
param_namemessage_name*googleCloudEssentialcontactsV1beta1Contact*GoogleCloudEssentialcontactsV1beta1Contact%googleCloudEssentialcontactsV1Contact%GoogleCloudEssentialcontactsV1Contactc                 6    [         R                  " [        U SS9$ )NF)api_nameapi_versionno_http)r   GetClientInstanceAPI_NAMEversions    9lib/googlecloudsdk/api_lib/essential_contacts/contacts.pyr   r   .   s    			We
= =    c                 4    [         R                  " [        U S9$ )N)r   r   )r   GetMessagesModuler   r   s    r   GetMessagesr    3   s    			w	GGr   c                 D    [         U    S   n[        [        U 5      U5      $ )z>Gets the contact message for the specified version of the API.r   )_CONTACT_TYPES_BY_VERSIONgetattrr    )r   versioned_message_types     r   GetContactMessager%   7   s%    4W=nM	W%'=	>>r   c                     [         U    S   $ )Nr   )r"   r   s    r   GetContactParamNamer'   =   s    	"7	+L	99r   c                 ,    [        U 5      R                  $ N)r%   9NotificationCategorySubscriptionsValueListEntryValuesEnumr   s    r   "GetContactNotificationCategoryEnumr+   A   s    	
HHIr   c                   T    \ rS rSrSr\4S jrS rS rS r	S r
SS	 jr  SS
 jrSrg)ContactsClientF   z"Client for Essential Contacts API.c                 <   [        U5      U l        U R                  R                  U l        U R                  R                  U l        U R                  R                  U l        U R                  R                  U l	        [        U5      U l        [        U5      U l        g r)   )r   clientMESSAGES_MODULE	_messagesprojects_contacts_projects_servicefolders_contacts_folders_serviceorganizations_contacts_organizations_servicer%   contact_messager'   contact_param_name)selfr   s     r   __init__ContactsClient.__init__I   so    #G,DK[[00DN![[::D KK88D"&++"D"DD,W5D1':Dr   c                    U R                  UUUS9nSXR                  U0nUR                  S5      (       a7  U R                  R                  " S0 UD6nU R
                  R                  U5      $ UR                  S5      (       a7  U R                  R                  " S0 UD6nU R                  R                  U5      $ U R                  R                  " S0 UD6nU R                  R                  U5      $ )a  Creates an Essential Contact.

Args:
  parent_name: the full id of the resource to create the contact for in the
    form of [projects|folders|organizations]/{resourceId}
  email: the contact's email address.
  notification_categories: the categories of notifications this contact
    should receive.
  language_tag: the contact's preferred language to receive communication
    in.

Returns:
  The created contact.
)email!notificationCategorySubscriptionslanguageTagparentfoldersorganizations )r9   r:   
startswithr2   -EssentialcontactsFoldersContactsCreateRequestr6   Create3EssentialcontactsOrganizationsContactsCreateRequestr8   .EssentialcontactsProjectsContactsCreateRequestr4   )r;   parent_namer?   notification_categorieslanguage_tagcontactargs
create_reqs           r   rH   ContactsClient.CreateY   s     ""*A  # "G k#:#:GDDi((>>OO j""))*55o..>>UU j((//
;;NN 
J!!((44r   c                 n   / nU(       a  UR                  S5        U(       a  UR                  S5        SR                  U5      nU R                  UUS9nSUSUU R                  U0nUR	                  S5      (       a7  U R
                  R                  " S	0 UD6nU R                  R                  U5      $ UR	                  S5      (       a7  U R
                  R                  " S	0 UD6nU R                  R                  U5      $ U R
                  R                  " S	0 UD6nU R                  R                  U5      $ )
a  Updates an Essential Contact.

Args:
  contact_name: the full id of the contact to update in the form of
    [projects|folders|organizations]/{resourceId}/contacts/{contactId}
  notification_categories: the categories of notifications this contact
    should receive, or None if not updating notification categories.
  language_tag: the contact's preferred language to receive communication
    in, or None if not updating language.

Returns:
  The updated contact.
#notification_category_subscriptionsrM   ,)r@   rA   name
updateMaskrC   rD   rE   )appendjoinr9   r:   rF   r2   ,EssentialcontactsFoldersContactsPatchRequestr6   Patch2EssentialcontactsOrganizationsContactsPatchRequestr8   -EssentialcontactsProjectsContactsPatchRequestr4   )	r;   contact_namerL   rM   update_masksupdate_maskrN   rO   
update_reqs	            r   UpdateContactsClient.Update{   s0    L?@.)((<(K""*A  # "G 	kD y))>>NN j""((44//>>TT j((..z::MM 
J!!''
33r   c                    UR                  S5      (       a4  U R                  R                  US9nU R                  R	                  U5      $ UR                  S5      (       a4  U R                  R                  US9nU R                  R	                  U5      $ U R                  R                  US9nU R                  R	                  U5      $ )zDeletes an Essential Contact.

Args:
  contact_name: the full id of the contact to delete in the form of
    [projects|folders|organizations]/{resourceId}/contacts/{contactId}

Returns:
  Empty response message.
rC   rU   rD   )	rF   r2   -EssentialcontactsFoldersContactsDeleteRequestr6   Delete3EssentialcontactsOrganizationsContactsDeleteRequestr8   .EssentialcontactsProjectsContactsDeleteRequestr4   )r;   r]   
delete_reqs      r   rf   ContactsClient.Delete   s     y))>>OO P j""))*55//>>UU V j((//
;;NN O J!!((44r   c                    UR                  S5      (       a4  U R                  R                  US9nU R                  R	                  U5      $ UR                  S5      (       a4  U R                  R                  US9nU R                  R	                  U5      $ U R                  R                  US9nU R                  R	                  U5      $ )zDescribes an Essential Contact.

Args:
  contact_name: the full id of the contact to describe in the form of
    [projects|folders|organizations]/{resourceId}/contacts/{contactId}

Returns:
  The requested contact.
rC   rd   rD   )	rF   r2   *EssentialcontactsFoldersContactsGetRequestr6   Get0EssentialcontactsOrganizationsContactsGetRequestr8   +EssentialcontactsProjectsContactsGetRequestr4   )r;   r]   describe_reqs      r   DescribeContactsClient.Describe   s     y))^^NN O l""&&|44//^^TT U l((,,\::>>MM N L!!%%l33r   Nc           	      v   SnSnUR                  S5      (       a&  U R                  nU R                  R                  US9nOaUR                  S5      (       a&  U R                  nU R                  R                  US9nO%U R                  nU R                  R                  US9n[        R                  " UUUUSSS9$ )a  Lists Essential Contacts set directly on a Cloud resource.

Args:
  parent_name: the full name of the parent resource to list contacts for in
    the form of [projects|folders|organizations]/{resourceId}
  page_size: the number of contacts to return per page of the result list.
  limit: the total number of contacts to return.

Returns:
  The contacts that have been set directly on the requested resource.
NrC   )rB   rD   contactspageSize)
batch_sizelimitfieldbatch_size_attribute)
rF   r6   r2   +EssentialcontactsFoldersContactsListRequestr8   1EssentialcontactsOrganizationsContactsListRequestr4   ,EssentialcontactsProjectsContactsListRequestr   YieldFromList)r;   rK   	page_sizerw   servicelist_reqs         r   ListContactsClient.List   s     GHi((%%gKK L h				0	0++gQQ R h &&gLL M h ##') )r   c           
      x   SnSnUR                  S5      (       a&  U R                  nU R                  R                  XS9nOaUR                  S5      (       a&  U R                  nU R                  R                  XS9nO%U R                  nU R                  R                  XS9n[        R                  " UUUUSSSS9$ )	a  Computes the Essential Contacts for a Cloud resource.

Args:
  parent_name: the full name of the parent resource to compute contacts for
    in the form of [projects|folders|organizations]/{resourceId}
  notification_categories: the notification categories (as choices) to
    retrieve subscribed contacts for.
  page_size: the number of contacts to return per page of the result list.
  limit: the total number of contacts to return.

Returns:
  The contacts that have been computed from the resource hierarchy.
NrC   )rB   notificationCategoriesrD   Computert   ru   )rv   rw   methodrx   ry   )
rF   r6   r2   .EssentialcontactsFoldersContactsComputeRequestr8   4EssentialcontactsOrganizationsContactsComputeRequestr4   /EssentialcontactsProjectsContactsComputeRequestr   r}   )r;   rK   rL   r~   rw   r   compute_reqs          r   r   ContactsClient.Compute   s    $ GKi((%%gNNQQ R Nk				0	0++gNNWW X Nk &&gNNRR S Nk ##') )r   )r6   r2   r8   r4   r0   r9   r:   )2   N)__name__
__module____qualname____firstlineno____doc__DEFAULT_API_VERSIONr<   rH   ra   rf   rq   r   r   __static_attributes__rE   r   r   r-   r-   F   s6    *0 ;  5D)4V5040")N 	))r   r-   N)r   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.utilr   r   ALPHA_API_VERSIONBETA_API_VERSIONGA_API_VERSIONr   r"   r   r    r%   r'   r+   r-   rE   r   r   <module>r      s     &  ' ' ,  $  CE BD =?   2 =
 , H 2 ? !4 : 0C I
]) ])r   