
    ~                        S 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  \R                  " \R                  R                  5      \R                   " S S	\R                   5      5       5       r\R                  " \R                  R$                  5      \R                   " S
 S\R                   5      5       5       rg)zQuotaPreference update command.    N)encoding)quota_preference)base)flags)logc                   @    \ rS rSrSr\S 5       rS rS	S\4S jjr	Sr
g)
UpdateAlpha     Update the parameters of a single QuotaPreference.

This command updates an existing or creates a new QuotaPreference. It can
updates the config in any states, not just the ones pending approval.

## EXAMPLES

To update a quota preference with id `my-preference` in region `us-central1`
that applies to the `default_limit` quota for `projects/12321`, run:

  $ {command} my-preference
  --service=example.$$UNIVERSE_DOMAIN$$
  --project=12321
  --quota-id=default_limit
  --preferred-value=100
  --dimensions=region=us-central1


To create a new quota preference for `organizations/789`, run:

  $ {command} my-preference
  --service=example.$$UNIVERSE_DOMAIN$$
  --organization=789
  --quota-id=default_limit
  --preferred-value=200
  --allow-missing
c                 H   [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R
                  " SS9R                  U 5        [         R                  " U S5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        gzArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
F)
positionalzquota preference to updateNr   PreferenceIdAddToParserServicePreferredValueQuotaIdAddResourceFlags
DimensionsEmailJustificationAllowMissingValidateOnlyAllowsQuotaDecreaseBelowUsage AllowHighPercentageQuotaDecreaseparsers    (lib/surface/quotas/preferences/update.pyArgsUpdateAlpha.Args9       
$$V,	MMO'	&&v.	MMU#//7	6#?@ 
""6*	KKMf%	%%f-	$$V,	$$V,	'')55f=	**,88@    c                     [         R                  " U[        R                  R                  S9U l        UR                  U l        U R
                  $ zRun command.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  The updated QuotaPreference. If `--validate-only` is specified, it returns
  None or any possible error.
)release_track)r   UpdateQuotaPreferencer   ReleaseTrackGAupdated_resourcevalidate_onlyselfargss     r   RunUpdateAlpha.RunQ   sD     -BBD--00D ++D   r#   resources_were_displayedc           	          U(       ae  U R                   (       dS  [        R                  R                  [        R
                  " [        R                  " U R                  5      SSSS95        g g g NT   ),:)	sort_keysindent
separators	r+   r   statusPrintjsondumpsr   MessageToDictr*   r-   r1   s     r   EpilogUpdateAlpha.Epilogc   P    (:(:	jj
**$$T%:%:;#	 );r#   r*   r+   NT)__name__
__module____qualname____firstlineno____doc__staticmethodr    r/   boolrA   __static_attributes__ r#   r   r	   r	      s3    8 A A.!$	T 	 	r#   r	   c                   8    \ rS rSrSr\S 5       rS rSS jrSr	g)	
UpdateBetao   r   c                 H   [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R
                  " SS9R                  U 5        [         R                  " U S5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        gr   r   r   s    r   r    UpdateBeta.Args   r"   r#   c                     [         R                  " U[        R                  R                  S9U l        UR                  U l        U R
                  $ r%   )r   r'   r   r(   BETAr*   r+   r,   s     r   r/   UpdateBeta.Run   sD     -BBD--22D ++D   r#   c           	          U(       ae  U R                   (       dS  [        R                  R                  [        R
                  " [        R                  " U R                  5      SSSS95        g g g r3   r:   r@   s     r   rA   UpdateBeta.Epilog   rC   r#   rD   NrE   )
rF   rG   rH   rI   rJ   rK   r    r/   rA   rM   rN   r#   r   rP   rP   o   s'    8 A A.!"	r#   rP   )rJ   r=   apitools.base.pyr   googlecloudsdk.api_lib.quotasr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.quotasr   googlecloudsdk.corer   ReleaseTracksr(   ALPHAUniverseCompatibleUpdateCommandr	   rU   rP   rN   r#   r   <module>rb      s    &  % : ( 3 # D%%++,P$$$ P  -Pf D%%**+O## O  ,Or#   