
    	                     ,   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	lmZ dd
lmZ ej                   ej                  ej                   j"                        ej$                   G d dej&                                             Zy)zOCommand for creating or updating application resources from YAML specification.    )absolute_import)division)print_function)unicode_literals)base)deprecation_util)flags)run_apps_operations)
exceptionsc                   6    e Zd ZdZdddZed        Zd Zd Zy)	DeployzACreate or update application resources from a YAML specification.z"          {description}
          zm          To create application resources from specification

              $ {command} stack.yaml

         )DESCRIPTIONEXAMPLESc                 X    t        j                  |       t        j                  |       y )N)r	   
AddFileArgAddServiceAccountArg)clsparsers     &lib/surface/run/integrations/deploy.pyArgszDeploy.Args1   s    	V	v&    c                 p    d|vrd|vrt        j                  d      d|v rt        j                  d      y )Nname	resourcesz!'name' or 'resources' is missing.z/tztabs found in manifest content.)r   FieldMismatchErrorConfigurationError)selffile_contents     r   _ValidateAppConfigFilezDeploy._ValidateAppConfigFile6   sB    \!k&E))*MNN|))*KLL r   c                 F   t        j                          t        j                          |j                  }| j	                  |       | j                         }t        j                  ||      5 }|j                          |j                  |      cddd       S # 1 sw Y   yxY w)z'Create or Update application from YAML.N)
r   CheckIfEndOfSaleAppliesDeprecationNoticeFILEr   ReleaseTrackr
   ConnectVerifyLocation	ApplyYaml)r   argsr   release_trackclients        r   Runz
Deploy.Run<   sy     ,,.&&(99L-%%'M		$	$T=	9Vl+ 
:	9	9s   ,!BB N)	__name__
__module____qualname____doc__detailed_helpclassmethodr   r   r+    r   r   r   r      s8     J- ' 'M,r   r   N)r/   
__future__r   r   r   r   googlecloudsdk.callioper   +googlecloudsdk.command_lib.run.integrationsr   r	   r
   "googlecloudsdk.command_lib.runappsr   HiddenReleaseTracksr$   ALPHADefaultUniverseOnlyCommandr   r2   r   r   <module>r<      sx    V &  % ' ( H = K 9 D%%++,(,T\\ (,  - (,r   