
                            d Z ddl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                  ej                  j                        ej                   G d d	ej                                       Zej$                   ej                  ej                  j&                        ej                   G d
 dej                                              Zy)z%QuotaAdjusterSettings update command.    N)encoding)quota_adjuster_settings)base)flags)logc                   .    e Zd ZdZed        Zd ZddZy)
UpdateBetaa  Update the QuotaAdjusterSettings of a resource container.

  This command updates the enablement state of a resource container.

  ## EXAMPLES

  To update QuotaAdjusterSettings for `projects/12321`, run:

    $ {command}
    --enablement=enabled
    --project=12321

  To update QuotaAdjusterSettings for `folders/123`, run:

    $ {command}
    --enablement=inherited
    --folder=123
  c                     t        j                  | d       t        j                         j                  |        t        j                         j                  |        y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.
    zcontainer idNr   AddResourceFlags
EnablementAddToParserValidateOnlyparsers    .lib/surface/quotas/adjuster/settings/update.pyArgszUpdateBeta.Args0   D     
6>2	""6* 
$$V,    c                     t        j                  |t        j                  j                        | _        |j                  | _        | j
                  S a  Run command.

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

    Returns:
      The updated QuotaAdjusterSettings. If `--validate-only` is specified, it
      returns
      None or any possible error.
    )release_track)r   UpdateQuotaAdjusterSettingsr   ReleaseTrackBETAupdated_resourcevalidate_onlyselfargss     r   RunzUpdateBeta.Run?   sD     4OOD--22D ++D   r   c                     |ra| j                   sTt        j                  j                  t	        j
                  t        j                  | j                        ddd             y y y NT   ),:)	sort_keysindent
separators	r   r   statusPrintjsondumpsr   MessageToDictr   r    resources_were_displayeds     r   EpilogzUpdateBeta.EpilogQ   P    (:(:	jj
**$$T%:%:;#	 );r   NT__name__
__module____qualname____doc__staticmethodr   r"   r3    r   r   r	   r	      s%    & - -!$	r   r	   c                   .    e Zd ZdZed        Zd ZddZy)UpdateAlphaa  Update the QuotaAdjusterSettings of a resource container.

  This command updates the enablement state of the resource container.

  ## EXAMPLES

  To update QuotaAdjusterSettings for `projects/12321`, run:

    $ {command}
    --enablement=Enabled
    --project=12321

    To update QuotaAdjusterSettings for `folders/123`, run:

    $ {command}
    --enablement=inherited
    --folder=123
  c                     t        j                  | d       t        j                         j                  |        t        j                         j                  |        yr   r   r   s    r   r   zUpdateAlpha.Argst   r   r   c                     t        j                  |t        j                  j                        | _        |j                  | _        | j
                  S r   )r   r   r   r   GAr   r   r   s     r   r"   zUpdateAlpha.Run   sD     4OOD--00D ++D   r   c                     |ra| j                   sTt        j                  j                  t	        j
                  t        j                  | j                        ddd             y y y r$   r+   r1   s     r   r3   zUpdateAlpha.Epilog   r4   r   Nr5   r6   r<   r   r   r>   r>   ]   s%    & - -!&	r   r>   )r:   r.   apitools.base.pyr   googlecloudsdk.api_lib.quotasr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.quotasr   googlecloudsdk.corer   ReleaseTracksr   r   UniverseCompatibleUpdateCommandr	   HiddenALPHAr>   r<   r   r   <module>rM      s    ,  % A ( 3 # D%%**+>## >  ,>B D%%++,?$$$ ?  - ?r   