
    R                     ^   d 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
 ddlmZ ddlmZ d	d
dZ ej                   ej"                  j$                         G d dej&                               Z ej                   ej"                  j*                         G d dej&                               Zy)z@Command to update a Application Service in the Project/Location.    )absolute_import)division)unicode_literals)utils)services)base)flagsz{description}z         To update the Service `my-service` with a new environment
        `prod` in the Application `my-app` in location `us-east1`,
        run:

          $ {command} my-service --environment-type=TEST --application=my-app --location=us-east1
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)UpdateGA%Update an Apphub application service.c                 b    t        j                  | t        j                  j                         y Nrelease_track)r	    AddUpdateApplicationServiceFlagsr   ReleaseTrackGAparsers    2lib/surface/apphub/applications/services/update.pyArgszUpdateGA.Args,   s!    	**d//22    c                 @   t        j                  t        j                  j                        }t        j                  |      }t        j                  |t        j                  j                        }|j                  |j                         |j                  ||      S zRun the create command.r   )
service_id
async_flag
attributesargs)apisServicesClientr   r   r   api_lib_utilsGetApplicationServiceRefPopulateAttributesUpdateRelativeNameasync_selfr    clientservice_refr   s        r   RunzUpdateGA.Run2   s      t/@/@/C/CDF88>K11D--00J ==++-;;	   r   N	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   r-    r   r   r   r   &   !    - - 
r   r   c                   *    e Zd ZdZeZed        Zd Zy)UpdateAlphar   c                 b    t        j                  | t        j                  j                         y r   )r	   r   r   r   ALPHAr   s    r   r   zUpdateAlpha.ArgsG   s!    	**d//55r   c                 @   t        j                  t        j                  j                        }t        j                  |      }t        j                  |t        j                  j                        }|j                  |j                         |j                  ||      S r   )r!   r"   r   r   r;   r#   r$   r%   r&   r'   r(   r)   s        r   r-   zUpdateAlpha.RunM   s      t/@/@/F/FGF88>K11D--33J ==++-;;	   r   Nr.   r6   r   r   r9   r9   A   r7   r   r9   N)r2   
__future__r   r   r   googlecloudsdk.api_lib.apphubr   r#   *googlecloudsdk.api_lib.apphub.applicationsr   r!   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apphubr	   r3   ReleaseTracksr   r   UpdateCommandr   r;   r9   r6   r   r   <module>rD      s    G &  ' @ G ( 3 #	 D%%(()t!!  *4 D%%++,$$$  -r   