
    #                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ dd	l	mZ dd
lmZ ej                   G d dej                                Zy)z<`gcloud domains registrations configure management` command.    )absolute_import)division)unicode_literals)registrations)base)flags)resource_args)util)logc                   &    e Zd ZdZed        Zd Zy)ConfigureManagementa^  Configure management settings of a Cloud Domains registration.

  Configure management settings of a registration. This includes settings
  related to transfers, billing and renewals of a registration.

  ## EXAMPLES

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

    $ {command} example.com

  To unlock a transfer lock of a registration for ``example.com'', run:

    $ {command} example.com --transfer-lock-state=unlocked

  To disable automatic renewals for ``example.com'', run:

    $ {command} example.com --preferred-renewal-method=renewal-disabled
  c                     t        j                  | d       t        j                  |        t        j                  |        y )Nz$to configure management settings for)r	   AddRegistrationResourceArgr   "AddManagementSettingsFlagsToParserAddAsyncFlagToParser)parsers    9lib/surface/domains/registrations/configure/management.pyArgszConfigureManagement.Args4   s2    ,,68	,,V4	v&    c                 8   t        j                  |      }t        j                  |      }t        j                  |j
                        |_        |j                  j
                  j                         }|j                  |      }t        j                  ||       t        j                  ||j                        }t        j                  ||j                        }|V|Tt        j                  ||j                  j                         }t        j"                  ||j                  j$                        }||y |j'                  |||      }t        j(                  |||j*                        }t-        j.                  |j1                         d|j*                         |S )Nregistration)r   GetApiVersionFromArgsRegistrationsClientr
   NormalizeResourceNamer   CONCEPTSParseGetAssertRegistrationOperationalParseTransferLockStatetransfer_lock_stateParseRenewalMethodpreferred_renewal_methodPromptForTransferLockStatemanagementSettingstransferLockStatePromptForRenewalMethodpreferredRenewalMethodr   WaitForOperationasync_r   UpdatedResourceName)	selfargsapi_versionclientregistration_refr   r    renewal_methodresponses	            r   RunzConfigureManagement.Run;   sc   55d;K..{;F2243D3DED}}11779::./L&&{LA55k6:6N6NP,,T22N "~'= ;;
|66HHJ22
|66MMn "~'=))-~H $$[(DKKHH(--/MOr   N)__name__
__module____qualname____doc__staticmethodr   r3    r   r   r   r      s     * ' 'r   r   N)r7   
__future__r   r   r   googlecloudsdk.api_lib.domainsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.domainsr   r	   r
   googlecloudsdk.corer   DefaultUniverseOnlyUpdateCommandr   r9   r   r   <module>rA      sM    C &  ' 8 ( 4 < 3 # <$,, < <r   