
    N                         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SK	J
r
  SSKJr  SS	KJr  S
rSrSrS rS rSS jr " S S\5      rg)z3API client library for Cloud Domains Registrations.    )absolute_import)division)unicode_literals)
list_pager)apis)base)
exceptions)logv1alpha2v1beta1v1c                 :   U R                   R                  5       nU[        R                  R                  :X  a  [        $ U[        R                  R
                  :X  a  [        $ U[        R                  R                  :X  a  [        $ [        R                  " U5      e)z!Return API version based on args.)calliope_commandReleaseTrackr   ALPHAALPHA_API_VERSIONBETABETA_API_VERSIONGAGA_API_VERSIONr	   UnsupportedReleaseTrackError)argsrelease_tracks     3lib/googlecloudsdk/api_lib/domains/registrations.pyGetApiVersionFromArgsr       su    ''446-d''---d'',,,d''***//>>    c                 0    [         R                  " SU 5      $ )Ndomains)r   GetClientInstance)api_versions    r   r   r   ,   s    				;	77r   Nc                 B    U=(       d    [        U 5      nUR                  $ N)r   MESSAGES_MODULE)r    clients     r   GetMessagesModuler%   0   s    3&{3&			r   c                       \ rS rSrSrSS jrS r    SS jr   SS jrS r	S	 r
S S
 jrS rS rS rS rS r S!S jrS!S jrS"S jrS rS rS rS rS rS rS rS rS rSrg)#RegistrationsClient5   z:Client for registrations service in the Cloud Domains API.Nc                     U=(       d    [        U5      U l        U=(       d    [        X5      U l        U R                  R                  U l        g r"   )r   r$   r%   messages projects_locations_registrations_service)selfr    r$   r*   s       r   __init__RegistrationsClient.__init__8   s7    :-k:DKF 1+ FDMKK@@DMr   c                 F    Sn[         R                  R                  U5        g)zGPrints FYI acknowledgement about the Google Domains - Squarespace deal.a  Domain name registration services are provided by Squarespace (https://domains.squarespace.com),
pursuant to the Squarespace Terms of Service (https://www.squarespace.com/terms-of-service)
and Squarespace Domain Registration Agreement (https://www.squarespace.com/domain-registration-agreement),
which Google resells pursuant to an agreement with Squarespace.
Google shares your name, contact information, and other domain-related information with Squarespace.
You can review Squarespace's Privacy Policy (https://www.squarespace.com/privacy) for details on how they process your information.
Google's Privacy Policy (https://policies.google.com/privacy) describes how Google handles this information as a reseller.
By choosing to continue, you (1) acknowledge receipt of Google's Privacy Policy and direct us to share this information
with Squarespace; and (2) agree to the Squarespace Terms of Service (https://www.squarespace.com/terms-of-service) and
Squarespace Domain Registration Agreement (https://www.squarespace.com/domain-registration-agreement), and
acknowledge receipt of Squarespace's Privacy Policy (https://www.squarespace.com/privacy).
N)r
   statusPrint)r-   ack_messages     r   PrintSQSPAck RegistrationsClient.PrintSQSPAck=   s     	3 2 JJ[!r   c
                    / n
U(       a+  U R                   R                  R                  R                  /n
/ nU(       a+  U R                   R                  R                  R
                  /nU R                   R                  UR                  5       U R                   R                  U R                   R                  UUUUS9U
UUU	S9S9nU R                  R                  U5      $ )a  Creates a Registration.

Args:
  parent_ref: a Resource reference to a domains.projects.locations resource
    for the parent of this registration.
  domain: str, the name of the domain to register. Used as resource name.
  dns_settings: DnsSettings to be used.
  contact_settings: ContactSettings to be used.
  yearly_price: price for the domain registration and its cost for the
    following years.
  labels: Unified GCP Labels for the resource.
  hsts_notice_accepted: bool, Whether HSTS notice was presented & accepted.
  public_privacy_accepted: bool, Whether public privacy notice was presented
    & accepted.
  validate_only: If set to true, performs only validation, without creating.

Returns:
  Operation: the long running operation to register a domain.

domainNamednsSettingscontactSettingslabels)registrationdomainNoticescontactNoticesyearlyPricevalidateOnly)parentregisterDomainRequest)r*   RegisterDomainRequest%DomainNoticesValueListEntryValuesEnumHSTS_PRELOADED&ContactNoticesValueListEntryValuesEnum#PUBLIC_CONTACT_DATA_ACKNOWLEDGEMENT4DomainsProjectsLocationsRegistrationsRegisterRequestRelativeNameRegistrationr,   Register)r-   
parent_refdomaindns_settingscontact_settingsyearly_pricer;   hsts_notice_acceptedpublic_privacy_acceptedvalidate_onlydomain_noticescontact_noticesreqs                r   rK   RegistrationsClient.RegisterZ   s    > N
--
-
-
S
S
b
bn O
--
-
-
T
T
x
xo --
L
L&&("mmAA33!( 0	 4  )*$& B 
 M C  ==!!#&&r   c
                    / n
U(       a+  U R                   R                  R                  R                  /n
U R                   R	                  UUUUS9nU R                   R                  UR                  5       U R                   R                  UU
U R                   R                  US9UU	S9S9nU R                  R                  U5      $ )a  Transfers a domain and creates a new Registration.

Args:
  parent_ref: a Resource reference to a domains.projects.locations resource
    for the parent of this registration.
  domain: str, the name of the domain to transfer. Used as resource name.
  dns_settings: DnsSettings to be used.
  contact_settings: ContactSettings to be used.
  authorization_code: The authorization code needed to transfer the domain.
  yearly_price: price for the domain transfer and its cost for the following
    years.
  labels: Unified GCP Labels for the resource.
  public_privacy_accepted: bool, Whether public privacy notice was presented
    & accepted.
  validate_only: If set to true, performs only validation, without
    transferring.

Returns:
  Operation: the long running operation to transfer a domain.
r7   )code)r<   r>   authorizationCoder?   r@   )rA   transferDomainRequest)
r*   TransferDomainRequestrF   rG   rJ   4DomainsProjectsLocationsRegistrationsTransferRequestrI   AuthorizationCoder,   Transfer)r-   rL   rM   rN   rO   authorization_coderP   r;   rR   rS   rU   r<   rV   s                r   r_   RegistrationsClient.Transfer   s    @ O
--
-
-
T
T
x
xo ==-- (	 . L --
L
L&&("mmAA%*"mm==' >  %& B 
 M C ==!!#&&r   c                     U R                   R                  UR                  5       U R                   R                  X#S9S9nU R                  R                  U5      $ )aj  Imports a domain and creates a new Registration.

Args:
  parent_ref: a Resource reference to a domains.projects.locations resource
    for the parent of this registration.
  domain: str, the name of the domain to import. Used as resource name.
  labels: Unified GCP Labels for the resource.

Returns:
  Operation: the long running operation to import a domain.
)r8   r;   )rA   importDomainRequest)r*   2DomainsProjectsLocationsRegistrationsImportRequestrI   ImportDomainRequestr,   Import)r-   rL   rM   r;   rV   s        r   rf   RegistrationsClient.Import   s[     --
J
J&&( MM== > 
 K C ==$$r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ N)name)r*   2DomainsProjectsLocationsRegistrationsExportRequestrI   r,   Exportr-   registration_refrV   s      r   rl   RegistrationsClient.Export   ?    
--
J
J**, K C ==$$r   c                     U R                   R                  UR                  5       U R                   R                  X#S9S9nU R                  R                  U5      $ )N)r?   r@   )r<   renewDomainRequest)r*   7DomainsProjectsLocationsRegistrationsRenewDomainRequestrI   RenewDomainRequestr,   RenewDomain)r-   rn   rP   rS   rV   s        r   RenewRegistrationsClient.Renew   sY    
--
O
O%224==;;$ < 
 P C ==$$S))r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ ri   )r*   2DomainsProjectsLocationsRegistrationsDeleteRequestrI   r,   Deleterm   s      r   rz   RegistrationsClient.Delete   rp   r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ ri   )r*   /DomainsProjectsLocationsRegistrationsGetRequestrI   r,   Get)r-   rn   get_reqs      r   r~   RegistrationsClient.Get   s?    mmKK**, L G ==W%%r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ N)r<   )r*   EDomainsProjectsLocationsRegistrationsRetrieveAuthorizationCodeRequestrI   r,   RetrieveAuthorizationCoderm   s      r   r   -RegistrationsClient.RetrieveAuthorizationCode   s?    
--
]
]%224 ^ C ==22377r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ r   )r*   BDomainsProjectsLocationsRegistrationsResetAuthorizationCodeRequestrI   r,   ResetAuthorizationCoderm   s      r   r   *RegistrationsClient.ResetAuthorizationCode  s?    
--
Z
Z%224 [ C ==//44r   c                     U R                   R                  UR                  5       U R                   R                  US9S9nU R                  R                  U5      $ )N)tag)r<   initiatePushTransferRequest)r*   @DomainsProjectsLocationsRegistrationsInitiatePushTransferRequestrI   InitiatePushTransferRequestr,   InitiatePushTransfer)r-   rn   r   rV   s       r   r   (RegistrationsClient.InitiatePushTransfer  sZ    
--
X
X%224$(MM$M$M %N %
 Y C ==--c22r   c           
          U R                   R                  UR                  5       US9n[        R                  " U R
                  USSUUSS9$ )N)locationpageSizeRetrieveImportableDomainsr   r   )methodfieldlimit
batch_sizebatch_size_attribute)r*   EDomainsProjectsLocationsRegistrationsRetrieveImportableDomainsRequestrI   r   YieldFromListr,   )r-   rL   r   	page_sizer   requests         r   r   -RegistrationsClient.RetrieveImportableDomains  sZ     mmaa((*Y b G ##*' r   c           	          U R                   R                  UR                  5       US9n[        R                  " U R
                  UUUSSS9$ )a  List the domain registrations in a given project.

Args:
  parent_ref: a Resource reference to a domains.projects.locations resource
    to list registrations for.
  limit: int, the total number of results to return from the API.
  page_size: int, the number of results in each batch from the API.
  list_filter: str, filter to apply in the list request.

Returns:
  A generator of the domain registrations in the project.
)rA   filterregistrationsr   )r   r   r   r   )r*   0DomainsProjectsLocationsRegistrationsListRequestrI   r   r   r,   )r-   rL   r   r   list_filterlist_reqs         r   ListRegistrationsClient.List(  sW     }}MM&&( N H ##' r   c                     U R                   R                  5       nX#l        SnU R                   R                  UUR	                  5       US9nU R
                  R                  U5      $ )a  Updates a Registration.

Used for updating labels.

Args:
  registration_ref: a Resource reference to a
    domains.projects.locations.registrations resource.
  labels: Unified GCP Labels for the resource.

Returns:
  Operation: the long running operation to patch registration.
r;   )r<   rj   
updateMask)r*   rJ   r;   1DomainsProjectsLocationsRegistrationsPatchRequestrI   r,   Patch)r-   rn   r;   r<   update_mask	patch_reqs         r   r   RegistrationsClient.PatchA  sd     ==--/L KOO!**, P I ==y))r   c                 D   U R                   R                  UUS9n/ nU(       a  US/-  nU(       a  US/-  nSR                  U5      nU R                   R                  UR	                  5       U R                   R                  XFS9S9nU R                  R                  U5      $ )aI  Updates management settings.

Args:
  registration_ref: a Resource reference to a
    domains.projects.locations.registrations resource.
  transfer_lock: The transfer lock state.
  preferred_renewal_method: The preferred Renewal Method.

Returns:
  Operation: the long running operation to configure management
    registration.
)transferLockStatepreferredRenewalMethodtransfer_lock_statepreferred_renewal_method,)managementSettingsr   )r<   "configureManagementSettingsRequest)r*   ManagementSettingsjoinGDomainsProjectsLocationsRegistrationsConfigureManagementSettingsRequestrI   "ConfigureManagementSettingsRequestr,   ConfigureManagementSettings)r-   rn   transfer_lockr   management_settingsupdated_listr   rV   s           r   ConfigureManagement'RegistrationsClient.ConfigureManagementZ  s     --::'7 ; 
 L,--l122l((<(K
--
_
_%224+/==+[+[2 ,\ ,
 ` C ==44S99r   c           	         / nUR                   (       a  US/-  nUR                  (       a  UR                  (       a  US/-  nOUS/-  nUR                  (       a  UR                  (       a  US/-  nOUS/-  nSR	                  U5      nU R
                  R                  UR                  5       U R
                  R                  UUUS9S9nU R                  R                  U5      $ )	a  Calls ConfigureDNSSettings method.

Args:
  registration_ref: Registration resource reference.
  dns_settings: New DNS Settings.
  updated: dns_util.DnsUpdateMask object representing an update mask.
  validate_only: validate_only flag.

Returns:
  Long Running Operation reference.
glue_recordsgoogle_domains_dnszgoogle_domains_dns.ds_state
custom_dnszcustom_dns.ds_recordsr   )r9   r   r@   )r<   configureDnsSettingsRequest)r   google_domains_dnssecname_serverscustom_dnssecr   r*   @DomainsProjectsLocationsRegistrationsConfigureDnsSettingsRequestrI   ConfigureDnsSettingsRequestr,   ConfigureDnsSettings)r-   rn   rN   updatedrS   r   r   rV   s           r   ConfigureDNS RegistrationsClient.ConfigureDNS~  s     L~&&l$$			-..677			&011((<(K --
X
X%224$(MM$M$M$"& %N %
 Y C ==--c22r   c           
         / nU(       a  US/-  nUc  U R                   R                  US9nOU R                   R                  UUR                  UR                  UR                  S9nUR                  (       a  US/-  nUR                  (       a  US/-  nUR                  (       a  US/-  nSR                  U5      n/ n	U(       a+  U R                   R                  R                  R                  /n	U R                   R                  UR                  5       U R                   R                  UUU	US9S	9n
U R                  R                  U
5      $ )
a9  Calls ConfigureContactSettings method.

Args:
  registration_ref: Registration resource reference.
  contacts: New Contacts.
  contact_privacy: New Contact privacy.
  public_contacts_ack: Whether the user accepted public privacy.
  validate_only: validate_only flag.

Returns:
  Long Running Operation reference.
privacy)r   )r   registrantContactadminContacttechnicalContactregistrant_contactadmin_contacttechnical_contactr   )r:   r   r>   r@   r<   configureContactSettingsRequest)r*   ContactSettingsr   r   r   r   ConfigureContactSettingsRequestrF   rG   DDomainsProjectsLocationsRegistrationsConfigureContactSettingsRequestrI   r,   ConfigureContactSettings)r-   rn   contactscontact_privacypublic_contacts_ackrS   r   rO   r   noticesrV   s              r   ConfigureContacts%RegistrationsClient.ConfigureContacts  sS   ( Lyk!l666O66!$66,,#44	 7  
	#	#-..			))		"	",--((<(KG
--
7
7
^
^  C  Cg
 --
\
\%224(,(U(U,""&	 )V )
 ] C ==11#66r   c                    U R                   R                  U R                   R                  US9S9nU R                   R                  UR	                  5       U R                   R                  USS9S9nU R                  R                  U5      $ )aq  Sets a registrant contact.

This resends registrant email confirmation.
It's done by updating registrant email to the current value.

Args:
  registration_ref: a Resource reference to a
    domains.projects.locations.registrations resource.
  registrant_email: The registrant email.

Returns:
  Operation: the long running operation to configure contacts registration.
)email)r   zregistrant_contact.email)r:   r   r   )r*   r   Contactr   rI   r   r,   r   )r-   rn   registrant_emailrO   rV   s        r   ConfigureRegistrantEmail,RegistrationsClient.ConfigureRegistrantEmail  s     }}44--//6F/G 5 
 --
\
\%224(,(U(U,1 )V )
 ] C ==11#66r   c                     U R                   R                  UR                  5       US9nU R                  R	                  U5      R
                  $ N)r   r8   )r*   FDomainsProjectsLocationsRegistrationsRetrieveRegisterParametersRequestrI   r,   RetrieveRegisterParametersregisterParametersr-   rL   rM   r   s       r   r   .RegistrationsClient.RetrieveRegisterParameters  G    mmbb((*v c G ==33G<OOOr   c                     U R                   R                  UR                  5       US9nU R                  R	                  U5      R
                  $ r   )r*   FDomainsProjectsLocationsRegistrationsRetrieveTransferParametersRequestrI   r,   RetrieveTransferParameterstransferParametersr   s       r   r   .RegistrationsClient.RetrieveTransferParameters
  r   r   c                     U R                   R                  UR                  5       US9nU R                  R	                  U5      R
                  $ )N)r   query)r*   9DomainsProjectsLocationsRegistrationsSearchDomainsRequestrI   r,   SearchDomainsr   )r-   rL   r   r   s       r   r   !RegistrationsClient.SearchDomains  sL     	OO,,.e 	P 	
 
 ==&&w/BBBr   c                     U R                   R                  UR                  5       UUS9nU R                  R	                  U5      $ )N)r<   	pageTokenr   )r*   KDomainsProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsRequestrI   r,   RetrieveGoogleDomainsDnsRecords)r-   rn   r   
page_tokenr   s        r   r   3RegistrationsClient.RetrieveGoogleDomainsDnsRecords  sG     mmgg%224 h G
 ==88AAr   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ r   )r*   QDomainsProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigRequestrI   r,   %RetrieveGoogleDomainsForwardingConfig)r-   rn   r   s      r   r  9RegistrationsClient.RetrieveGoogleDomainsForwardingConfig%  s?    mmmm%224 n G ==>>wGGr   )r,   r$   r*   )NN)NFFF)NFF)F)NNNr"   )__name__
__module____qualname____firstlineno____doc__r.   r4   rK   r_   rf   rl   rv   rz   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  __static_attributes__ r   r   r'   r'   5   s    BA
"H  #9'F #:'x%(%*%&853 @D"2*2":H(3T<7|7:PPC	BHr   r'   r"   )r  
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   r   r   r   r   r   r%   objectr'   r
  r   r   <module>r     sR    : &  ' ' , ( * #  	?8 
uH& uHr   