
                         D   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 ddlmZ  ej                   ej"                  j$                  ej"                  j&                        ej(                   G d dej*                                      Zy)zICommand for creating or replacing an application from YAML specification.    )absolute_import)division)unicode_literals)types_utils)base)pretty_print)deprecation_util)flags)messages_util)run_apps_operationsc                   0    e Zd ZdZdddZed        Zd Zy)UpdateUpdate a Cloud Run Integration.z"          {description}
          z          To update a redis integration to change the cache size

              $ {command} redis-integration --parameters=memory-size-gb=5

         )DESCRIPTIONEXAMPLESc                     t        j                  |       t        j                  |       t        j                  |       t        j                  |       y)z\Set up arguments for this command.

    Args:
      parser: An argparse.ArgumentParser.
    N)r
   AddNamePositionalArgAddServiceUpdateArgsAddParametersArgAddServiceAccountArg)clsparsers     &lib/surface/run/integrations/update.pyArgszUpdate.Args1   s<     
v&	v&	6"	v&    c                    t        j                          t        j                          |j                  }|j                  }|j
                  }t        j                  |      }| j                         }t        j                  ||      5 }|j                          |j                  ||||       |j                  |      }|j                  |j                        }	t!        j"                  |      }
t%        j&                  d       t%        j(                  t+        j,                  |
j.                  |d             t+        j0                  |
||	      }|rc|sat%        j&                  d       t%        j&                  |       t%        j&                  t+        j2                  | j                         |             ddd       y# 1 sw Y   yxY w)r   )name
parametersadd_serviceremove_service updated)integration_typeintegration_nameactionN)r	   CheckIfEndOfSaleAppliesDeprecationNoticer   r    r   r
   GetParametersReleaseTrackr   ConnectVerifyLocationUpdateIntegrationGetIntegrationGenericGetIntegrationStatusidr   GetTypeMetadataByResourcer   InfoSuccessr   GetSuccessMessager#   GetCallToActionCheckStatusMessage)selfargsr   r    r$   r   release_trackclientresourceresource_statusmetadatacall_to_actions               r   Runz
Update.Run=   sz    ,,.&&(""K((Nyy$$T*J%%'M		$	$T=	9V!'	  ) --.>?h33HKK@o66x@h

)
)'88/ %44
Hon
 
".),,!!#%5	
= 
:	9	9s   D-F>>GN)__name__
__module____qualname____doc__detailed_helpclassmethodr   r>    r   r   r   r      s1     (- 	' 	'-
r   r   N)rB   
__future__r   r   r   'googlecloudsdk.api_lib.run.integrationsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   +googlecloudsdk.command_lib.run.integrationsr	   r
   r   r   ReleaseTracksr)   ALPHABETADefaultUniverseOnlyCommandr   rE   r   r   <module>rP      s    P &  ' ? ( 7 H = E K D%%++T->->-C-CDJ
T\\ J
  EJ
r   