
                             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S
K	Jr  SSKJr  \R                    " S S\R"                  5      5       rg)z:`gcloud domains registrations configure contacts` command.    )absolute_import)division)unicode_literals)registrations)base)contacts_util)flags)resource_args)util)logc                   4    \ rS rSrSr\S 5       rS rS rSr	g)ConfigureContacts   a  Configure contact settings of a Cloud Domains registration.

Configure registration's contact settings: email, phone number, postal
address and also contact privacy.

In some cases such changes have to be confirmed through an email sent to
the registrant before they take effect. In order to resend the email, execute
this command again.

NOTE: Please consider carefully any changes to contact privacy settings when
changing from "redacted-contact-data" to "public-contact-data."
There may be a delay in reflecting updates you make to registrant
contact information such that any changes you make to contact privacy
(including from "redacted-contact-data" to "public-contact-data")
will be applied without delay but changes to registrant contact
information may take a limited time to be publicized. This means that
changes to contact privacy from "redacted-contact-data" to
"public-contact-data" may make the previous registrant contact
data public until the modified registrant contact details are published.

## EXAMPLES

To start an interactive flow to configure contact settings for
``example.com'', run:

  $ {command} example.com

To enable contact privacy for ``example.com'', run:

  $ {command} example.com --contact-privacy=private-contact-data

To change contact data for ``example.com'' according to information from a
YAML file ``contacts.yaml'', run:

  $ {command} example.com --contact-data-from-file=contacts.yaml
c                     [         R                  " U S5        [        R                  " U 5        [        R                  " U S5        [        R
                  " U 5        g )Nz!to configure contact settings forz!configure contact settings of the)r
   AddRegistrationResourceArgr	   )AddConfigureContactsSettingsFlagsToParserAddValidateOnlyFlagToParserAddAsyncFlagToParser)parsers    7lib/surface/domains/registrations/configure/contacts.pyArgsConfigureContacts.ArgsE   sF    ,,35	33F;	%%f&IK	v&    c                 N    UR                  U5      n[        UR                  5      $ )N)GetboolpendingContactSettings)selfclientregistration_refregistrations       r   CheckPendingContacts&ConfigureContacts.CheckPendingContactsN   s"    ::./L3344r   c                    [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  5      Ul        UR                  R
                  R                  5       nUR                  U5      n[        R                  " X%5        [        R                  " UUR                  5      n[        R                  " UUR                  5      n[        R                  " X!R                   5      nUc!  [        R"                  " UUR$                  5      nUcr  ['        [)        [*        R,                  " UR.                  5      R0                  UR2                  5      5      n	[        R4                  " X)UR$                  R6                  5      nUc  Uc  g U=(       d    UR$                  R6                  n
UR.                  R8                  R:                  nU(       d  XR<                  :X  a  [        R>                  " UUR$                  US9nUR$                  R6                  UR<                  :w  a"  [        R@                  " URB                  U5      nO![        RD                  " URB                  U5      nURG                  UUUUURH                  S9nURH                  (       a!  [J        RL                  RO                  S5        U$ [        RP                  " X-URR                  5      nS nURR                  (       d  U RU                  UU5      (       a  Sn[J        RV                  " URY                  5       SURR                  US9  U$ )N)prev_contactsnew_contacts)validate_onlyzKThe command will not have any effect because validate-only flag is present.zNote:
The contact settings are currently pending.
In order to finalize the update you need to confirm the change.
An email with instructions has been sent to the registrant.r!   )details)-r   GetApiVersionFromArgsRegistrationsClientr   NormalizeResourceNamer!   CONCEPTSParser   AssertRegistrationOperationalr   ParseContactDatacontact_data_from_fileParseContactPrivacycontact_privacyParsePublicContactsAcknoticesPromptForContactscontactSettingslistmapr	   ContactPrivacyEnumMappermessagesGetChoiceForEnumsupportedPrivacyPromptForContactPrivacyprivacyContactSettingsPrivacyValueValuesEnumPUBLIC_CONTACT_DATAMergeContacts PromptForPublicContactsUpdateAck
domainNamePromptForPublicContactsAckr   r'   r   statusPrintWaitForOperationasync_r"   UpdatedResourceName)r   argsapi_versionr   r    r!   contactsr2   public_contacts_ackchoicesnew_privacyr>   merged_contactsresponsenotes                  r   RunConfigureContacts.RunR   s   55d;K..{;F2243D3DED}}11779::./L&&{A--k.2.I.IKH#778<8L8LNO'>>\\# 001=1M1MOh 
,,V__=NN++-.g &==
 < < D DFo O3!I\%A%A%I%IKoo--DDG;2M2M#M%33
$44!o 
	%	%	-	-1L1L	L+LL##_6 ,FF##_6 ''(( ( *H 	jj 8 9 O &&{dkkJhd[[T66v7GI IK 




!>4;;N Or    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r"   rU   __static_attributes__rW   r   r   r   r      s'    #J ' '5Cr   r   N)r\   
__future__r   r   r   googlecloudsdk.api_lib.domainsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.domainsr   r	   r
   r   googlecloudsdk.corer   DefaultUniverseOnlyUpdateCommandr   rW   r   r   <module>rf      sS    A &  ' 8 ( < 4 < 3 # v** v vr   