
    Z                        S 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
0r\	R                  \	R                  " \	R                  R                   5       " S S\	R"                  5      5       5       r\\l        g)zCImplementation of gcloud Procurement consumer order modify command.    )absolute_import)division)unicode_literals)apis)arg_parsers)base)resource_argsEXAMPLESay  
        To modify an order to another product plan or update parameters, you
        must specify product request. To specify parameters, you must follow the
        pattern "ParameterName=ParameterType:ParameterValue". For example:

            $ {command} --product-request line-item-id=lineItemId,line-item-change-type=UPDATE,product-external-name=productId,flavor-external-name=flavorId,region=str:us-west-1

        To cancel a product plan-based order, you must specify the product
        request. For example:

            $ {command} --product-request line-item-id=lineItemId,line-item-change-type=CANCEL

        To revert cancellation on a product plan-based order, you must specify
        the product request. For example:

            $ {command} --product-request line-item-id=lineItemId,line-item-change-type=REVERT_CANCELLATION

        To update an order to another quote, you must specify the fields that
        are related to the quote. For example:

            $ {command} --quote-change-type UPDATE --new-quote-external-name quoteId

        To cancel a quote-based order, you must specify the quote change type.
        For example:

            $ {command} --quote-change-type CANCEL

        To revert cancellation on a quote-based order, you must specify the
        quote change type. For example:

            $ {command} --quote-change-type REVERT_CANCELLATION
        c                   .    \ rS rSrSr\S 5       rS rSrg)Modify?   z0Modifies the order resource from the Modify API.c                    [         R                  " U S5        U R                  SSS9  U R                  SS9nUR                  S[        R
                  " SS	/S
9SSSS9  UR                  SS9nUR                  SSSS9  UR                  SSS9  g)zfRegister flags for this command.

Args:
  parser: argparse.ArgumentParser to register arguments with.
zOrder to modify.z--etagz1The weak etag for validation check, if specified.)helpT)requiredz--product-requestzline-item-idzline-item-change-type)required_keysz	KEY=VALUEappendz3Request about product info to modify order against.)typemetavaractionr   zQuote-related modification.z--quote-change-typez$Change type on quote based purchase.)r   r   z--new-quote-external-namez2The external name of the quote the order will use.N)r	   AddOrderResourceArgadd_argumentadd_mutually_exclusive_groupr   ArgDict	add_group)parserproduct_quote_groupquote_request_groups      :lib/surface/commerce_procurement/consumer/orders/modify.pyArgsModify.ArgsD   s     %%f.@A
J  L !==t=L$$  )+BCEB % D .77* 8 ,$$3 % 5 $$#A % C    c                     UR                   R                  R                  5       n[        R                  R                  UR                  5       UR                  UR                  UR                  UR                  5      $ )z~Runs the command.

Args:
  args: The arguments that were provided to this command invocation.

Returns:
  An Order operation.
)CONCEPTSorderParser   Ordersr   RelativeNameetagproduct_requestquote_change_typenew_quote_external_name)selfargs	order_refs      r   Run
Modify.Runa   s^     ##))+I;;i446		"22D4J4J"::< <r!    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r/   __static_attributes__r1   r!   r   r   r   ?   s      9C C8<r!   r   N)r6   
__future__r   r   r   +googlecloudsdk.api_lib.commerce_procurementr   googlecloudsdk.callioper   r   /googlecloudsdk.command_lib.commerce_procurementr	   DETAILED_HELPHiddenReleaseTracksReleaseTrackALPHACommandr   detailed_helpr1   r!   r   <module>rD      s    J &  ' < / ( I 	"J D%%++,,<T\\ ,< - ,<^ % r!   