
                             S r SSKJr  SSKJr  SSKJr  SSK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)z4`gcloud domains registrations renew-domain` command.    )absolute_import)division)unicode_literalsN)
exceptions)registrations)base)flags)resource_args)util)logc                   .    \ rS rSrSr\S 5       rS rSrg)RenewDomain"   a  Renew a recently expired Cloud Domains registration.

Use this method to renew domains that expired within the last 30 days.
Renewing your domain extends it for one year from the previous expiration date
and you are charged the yearly renewal price.

## EXAMPLES

To renew a registration for ``example.com'' interactively, run:

  $ {command} example.com

To renew ``example.com'' with interactive prompts disabled, provide the
--yearly-price flag. For example, run:

  $ {command} example.com --yearly-price="12.00 USD" --quiet
c                     [         R                  " U S5        [        R                  " U [        R                  R
                  5        [        R                  " U S5        [        R                  " U 5        g )Nzto renewrenew)r
   AddRegistrationResourceArgr	   AddPriceFlagsToParser
MutationOpRENEWALAddValidateOnlyFlagToParserAddAsyncFlagToParser)parsers    1lib/surface/domains/registrations/renew_domain.pyArgsRenewDomain.Args6   sL    ,,VZ@	(8(8(@(@A	%%fg6	v&    c                 H   [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  5      Ul        UR                  R
                  R                  5       n[        R                  " X!R                  5      nUc7  [         R                  " U5      nUR                  5       n UR                  XGSS9  UR                  XEUR.                  5      nUR.                  (       a!  [0        R2                  R5                  S5        U$ [        R6                  " X,UR8                  5      n[0        R:                  " UR=                  5       S	UR8                  5        U$ ! [        R                   a  n[        R                   " SUR"                  5      n	U	(       am  U	R%                  5       u  pUR                  ['        U
5      ['        U5      S-  SS9n[        R(                  " U5      nUc  [*        R,                  " S5      e S nAGNJUeS nAff = f)
NT)validate_onlyz#INVALID: expected (\d+).(\d{2}) USDi USD)unitsnanoscurrencyCodez#Accepting yearly price is required.zKThe command will not have any effect because validate-only flag is present.registration)r   GetApiVersionFromArgsRegistrationsClientr   NormalizeResourceNamer#   CONCEPTSParseParseYearlyPriceyearly_priceGetMessagesModuleMoneyRenewapitools_exceptions	HttpErrorresearchcontentgroupsintPromptForYearlyPriceAckr   Errorr   r   statusPrintWaitForOperationasync_UpdatedResourceName)selfargsapi_versionclientregistration_refr*   messagesempty_priceematchr    centsresponses                r   RunRenewDomain.Run=   s   55d;K..{;F2243D3DED}}11779((6G6GHL00=hNN$k%$G ||,D<N<NOH	jj 8 9
 O &&{dkkJh	*//1>4;;OO) !** 
		@!))L,%!Jc%j5&8u ( N,55lC,!""#HII " '
s    E1 1H!BHHH! N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rH   __static_attributes__rJ   r   r   r   r   "   s     $ ' ' r   r   )rO   
__future__r   r   r   r0   apitools.base.pyr   r.   googlecloudsdk.api_lib.domainsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.domainsr	   r
   r   googlecloudsdk.corer   DefaultUniverseOnlyUpdateCommandr   rJ   r   r   <module>rZ      sU    ; &  ' 	 > 8 ( 4 < 3 * # :$$$ : :r   