
    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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.    )
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"   -   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)#RegistrationsClient2   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__5   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_pricer8   hsts_notice_acceptedpublic_privacy_acceptedvalidate_onlydomain_noticescontact_noticesreqs                r   rH   RegistrationsClient.RegisterW   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.
r4   )code)r9   r;   authorizationCoder<   r=   )r>   transferDomainRequest)
r'   TransferDomainRequestrC   rD   rG   4DomainsProjectsLocationsRegistrationsTransferRequestrF   AuthorizationCoder)   Transfer)r*   rI   rJ   rK   rL   authorization_coderM   r8   rO   rP   rR   r9   rS   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.
)r5   r8   )r>   importDomainRequest)r'   2DomainsProjectsLocationsRegistrationsImportRequestrF   ImportDomainRequestr)   Import)r*   rI   rJ   r8   rS   s        r   rc   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'   2DomainsProjectsLocationsRegistrationsExportRequestrF   r)   Exportr*   registration_refrS   s      r   ri   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=   )r9   renewDomainRequest)r'   7DomainsProjectsLocationsRegistrationsRenewDomainRequestrF   RenewDomainRequestr)   RenewDomain)r*   rk   rM   rP   rS   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      $ rf   )r'   2DomainsProjectsLocationsRegistrationsDeleteRequestrF   r)   Deleterj   s      r   rw   RegistrationsClient.Delete   rm   r   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ rf   )r'   /DomainsProjectsLocationsRegistrationsGetRequestrF   r)   Get)r*   rk   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)r9   )r'   EDomainsProjectsLocationsRegistrationsRetrieveAuthorizationCodeRequestrF   r)   RetrieveAuthorizationCoderj   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'   BDomainsProjectsLocationsRegistrationsResetAuthorizationCodeRequestrF   r)   ResetAuthorizationCoderj   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)r9   initiatePushTransferRequest)r'   @DomainsProjectsLocationsRegistrationsInitiatePushTransferRequestrF   InitiatePushTransferRequestr)   InitiatePushTransfer)r*   rk   r   rS   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'   EDomainsProjectsLocationsRegistrationsRetrieveImportableDomainsRequestrF   r   YieldFromListr)   )r*   rI   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.
)r>   filterregistrationsr   )r   r   r   r   )r'   0DomainsProjectsLocationsRegistrationsListRequestrF   r   r   r)   )r*   rI   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.
r8   )r9   rg   
updateMask)r'   rG   r8   1DomainsProjectsLocationsRegistrationsPatchRequestrF   r)   Patch)r*   rk   r8   r9   update_mask	patch_reqs         r   r   RegistrationsClient.Patch>  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   )r9   "configureManagementSettingsRequest)r'   ManagementSettingsjoinGDomainsProjectsLocationsRegistrationsConfigureManagementSettingsRequestrF   "ConfigureManagementSettingsRequestr)   ConfigureManagementSettings)r*   rk   transfer_lockr   management_settingsupdated_listr   rS   s           r   ConfigureManagement'RegistrationsClient.ConfigureManagementW  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   )r6   r   r=   )r9   configureDnsSettingsRequest)r   google_domains_dnssecname_serverscustom_dnssecr   r'   @DomainsProjectsLocationsRegistrationsConfigureDnsSettingsRequestrF   ConfigureDnsSettingsRequestr)   ConfigureDnsSettings)r*   rk   rK   updatedrP   r   r   rS   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   )r7   r   r;   r=   r9   configureContactSettingsRequest)r'   ContactSettingsr   r   r   r   ConfigureContactSettingsRequestrC   rD   DDomainsProjectsLocationsRegistrationsConfigureContactSettingsRequestrF   r)   ConfigureContactSettings)r*   rk   contactscontact_privacypublic_contacts_ackrP   r   rL   r   noticesrS   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)r7   r   r   )r'   r   Contactr   rF   r   r)   r   )r*   rk   registrant_emailrL   rS   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   r5   )r'   FDomainsProjectsLocationsRegistrationsRetrieveRegisterParametersRequestrF   r)   RetrieveRegisterParametersregisterParametersr*   rI   rJ   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'   FDomainsProjectsLocationsRegistrationsRetrieveTransferParametersRequestrF   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'   9DomainsProjectsLocationsRegistrationsSearchDomainsRequestrF   r)   SearchDomainsr   )r*   rI   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)r9   	pageTokenr   )r'   KDomainsProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsRequestrF   r)   RetrieveGoogleDomainsDnsRecords)r*   rk   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'   QDomainsProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigRequestrF   r)   %RetrieveGoogleDomainsForwardingConfig)r*   rk   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+   r1   rH   r\   rc   ri   rs   rw   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__ r   r   r$   r$   2   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  apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.corer   r   r   r   r   r   r   r"   objectr$   r  r   r   <module>r     sK    : ( , ( * #  	?8 
uH& uHr   