
                            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                  j$                        ej                   G d
 dej                                       Zy)zQuotaPreference create command.    N)encoding)quota_preference)base)flags)logc                   4    e Zd ZdZed        Zd ZddefdZy)CreateAlphaa  Create a new QuotaPreference that declares the desired value for a quota.

  ## EXAMPLES

  To create a quota preference in region `us-central1` that applies to the
  `default_limit` quota under service `example.$$UNIVERSE_DOMAIN$$` for
  `projects/12321`, run:

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


  To create a quota preference under service `example.$$UNIVERSE_DOMAIN$$` for
  `organizations/789` with random preference ID, run:

    $ {command}
    --service=example.$$UNIVERSE_DOMAIN$$
    --organization=789
    --quota-id=default_limit
    --preferred-value=200
  c                    t        j                  | d       t        j                         j                  |        t        j                         j                  |        t        j
                  d      j                  |        t        j                  d      j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        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quota preference to createF)
positionalNr   AddResourceFlagsServiceAddToParserPreferredValueQuotaIdPreferenceId
DimensionsAllowsQuotaDecreaseBelowUsage AllowHighPercentageQuotaDecreaseEmailJustificationparsers    (lib/surface/quotas/preferences/create.pyArgszCreateAlpha.Args8        
6#?@	MMO'	&&v.	MMU#//7 
%(44V<	""6*	'')55f=	**,88@	KKMf%	%%f-    c                     t        j                  |t        j                  j                        | _        | j
                  S zRun command.

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

    Returns:
      The created quota preference.
    )release_track)r   CreateQuotaPreferencer   ReleaseTrackGAcreated_resourceselfargss     r   RunzCreateAlpha.RunN   s6     -BBD--00D    r   resources_were_displayedc                     |rTt         j                  j                  t        j                  t        j                  | j                        ddd             y y NT   ),:)	sort_keysindent
separatorsr   statusPrintjsondumpsr   MessageToDictr%   r'   r*   s     r   EpilogzCreateAlpha.Epilog^   E    	jj
**$$T%:%:;#	  r   NT)	__name__
__module____qualname____doc__staticmethodr   r)   boolr:    r   r   r	   r	      s,    6 . .*! 	T 	r   r	   c                   .    e Zd ZdZed        Zd ZddZy)
CreateBetaa  Create a new QuotaPreference that declares the desired value for a quota.

  ## EXAMPLES

  To create a quota preference in region `us-central1` that applies to the
  `default_limit` quota under service `example.$$UNIVERSE_DOMAIN$$` for
  `projects/12321`, run:

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


  To create a quota preference under service `example.$$UNIVERSE_DOMAIN$$`` for
  `organizations/789` with random preference ID, run:

    $ {command}
    --service=example.$$UNIVERSE_DOMAIN$$
    --organization=789
    --quota-id=default_limit
    --preferred-value=200
  c                    t        j                  | d       t        j                         j                  |        t        j                         j                  |        t        j
                  d      j                  |        t        j                  d      j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        t        j                         j                  |        yr   r   r   s    r   r   zCreateBeta.Args   r   r   c                     t        j                  |t        j                  j                        | _        | j
                  S r    )r   r"   r   r#   BETAr%   r&   s     r   r)   zCreateBeta.Run   s6     -BBD--22D    r   c                     |rTt         j                  j                  t        j                  t        j                  | j                        ddd             y y r,   r3   r9   s     r   r:   zCreateBeta.Epilog   r;   r   Nr<   )r=   r>   r?   r@   rA   r   r)   r:   rC   r   r   rE   rE   j   s%    6 . .*! 	r   rE   )r@   r6   apitools.base.pyr   googlecloudsdk.api_lib.quotasr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.quotasr   googlecloudsdk.corer   ReleaseTracksr#   ALPHAUniverseCompatibleCreateCommandr	   rH   rE   rC   r   r   <module>rS      s    &  % : ( 3 # D%%++,K$$$ K  -K\ D%%**+K## K  ,Kr   