ó
    €Ï?  ã                   ó¶   • 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 r
S rS	 rS
 rS rS rS rS rS rS rS rS rS rS rS\\\4   4S jrS rg)z6Provides common arguments for the Run command surface.é    )ÚDict)Útypes_utils)Ú	validator)Úarg_parsers)Ú
propertiesc                 óL   • U R                  S[        R                  " 5       SS9  g)zAdds a FILE positional arg.ÚFILEzVThe absolute path to the YAML file with an application definition to update or deploy.©ÚtypeÚhelpN)Úadd_argumentr   ÚYAMLFileContents©Úparsers    Ú8lib/googlecloudsdk/command_lib/run/integrations/flags.pyÚ
AddFileArgr      s)   € à×ÑØÜ×'Ò'Ó)ð(ð ò )ó    c                 ó$   • U R                  SSS9  g)z(Adds an integration type positional arg.r   zType of the integration.©r   N©r   r   s    r   ÚAddPositionalTypeArgr   #   ó   € à×ÑØØ%ð ò 'r   c                 ó$   • U R                  SSS9  g)z Adds a service-account argument.z--service-accountzBName of the service account to use when deploying the integration.r   Nr   r   s    r   ÚAddServiceAccountArgr   *   s   € à×ÑØØOð ò r   c                 ó&   • U R                  SSSS9  g)zAdds an integration type arg.ú--typeTzlType of the integration. To see available types and usage, use "gcloud run integrations types list" command.)Úrequiredr   Nr   r   s    r   Ú
AddTypeArgr   2   s!   € à×ÑØØð?ð ò @r   c                 ó$   • U R                  SSS9  g)úAdds an integration name arg.z--nameúName of the integration.r   Nr   r   s    r   Ú
AddNameArgr"   ;   s   € à×ÑØØ%ð ò 'r   c                 ó$   • U R                  SSS9  g)r    Únamer!   r   Nr   r   s    r   ÚAddNamePositionalArgr%   B   r   r   c                 ó$   • U R                  SSS9  g)zAdds a service arg for create.ú	--servicezaName of the Cloud Run service to attach to the integration. It is required for some integrations.r   Nr   r   s    r   ÚAddServiceCreateArgr(   I   s   € à×ÑØð.ð ò /r   c                 ód   • U R                  5       nUR                  SSS9  UR                  SSS9  g)z"Adds service arguments for update.z--add-servicez;Name of the Cloud Run service to attach to the integration.r   z--remove-servicez=Name of the Cloud Run service to remove from the integration.N)Úadd_mutually_exclusive_groupr   )r   Úgroups     r   ÚAddServiceUpdateArgsr,   Q   sF   € à
×
-Ñ
-Ó
/€%Ø×ÑØØHð ñ Jð ×ÑØØJð ò Lr   c           	      ón   • U R                  S[        R                  " 5       [        R                  0 SSS9  g)zAdds a parameters arg.z--parameterszPARAMETER=VALUEz·Comma-separated list of parameter names and values. Names must be one of the parameters shown when describing the integration type. Only simple values can be specified with this flag.)r   ÚactionÚdefaultÚmetavarr   N)r   r   ÚArgDictÚUpdateActionr   s    r   ÚAddParametersArgr3   \   s:   € à×ÑØÜ×ÒÓ Ü×%Ñ%ØØðNð ò Or   c                 ó|   • [         R                  " U 5        [        R                  " U 5      nUR	                  5         g)z@Validates user has enabled APIs, or else prompts user to enable.N)r   ÚCheckValidIntegrationTyper   ÚGetIntegrationValidatorÚValidateEnabledGcpApis)Úintegration_typeÚvalidates     r   r7   r7   i   s.   € ä×'Ò'Ð(8Ô9Ü×.Ò.Ð/?Ó@€(Ø
×!Ñ!Õ#r   c                 ó~   • [         R                  " U 5        [        R                  " U 5      nUR	                  X5        g)zGValidates given params conform to what's expected from the integration.N)r   r5   r   r6   ÚValidateCreateParameters)r8   Ú
parametersÚservicer9   s       r   r;   r;   p   s0   € ä×'Ò'Ð(8Ô9Ü×.Ò.Ð/?Ó@€(Ø
×#Ñ# JÕ8r   c                 ó~   • [         R                  " U 5        [        R                  " U 5      nUR	                  U5        g)z<Validate params for update commands for a given integration.N)r   r5   r   r6   ÚValidateUpdateParameters)r8   r<   r9   s      r   r?   r?   w   s0   € ä×'Ò'Ð(8Ô9Ü×.Ò.Ð/?Ó@€(Ø
×#Ñ# JÕ/r   c                 ó.   • U R                  S[        SS9  g)zFilter by Service Name.r'   z1Filter Integrations by Name of Cloud Run service.r
   N©r   Ústrr   s    r   ÚListIntegrationsOfServicerC   ~   s   € à×ÑØÜØ>ð ò @r   c                 ó.   • U R                  S[        SS9  g)zFilter by Integration Type.r   z+Filter Integrations by Type of Integration.r
   NrA   r   s    r   ÚListIntegrationsOfTyperE   †   s   € à×ÑØ”SÐLð ò Nr   Úreturnc                 ól   • 0 nU R                  S5      (       a  UR                  U R                  5        U$ )z6Validates all parameters and returns a dict of values.r<   )ÚIsSpecifiedÚupdater<   )Úargsr<   s     r   ÚGetParametersrK   Œ   s0   € à€*Ø	×Ñl×#Ñ#Ø×Ñd—o‘oÔ&à	Ðr   c                 ó  • [        U SS5      (       a  U R                  $ [        R                  R                  R
                  R                  5       (       a2  [        R                  R                  R
                  R                  5       $ g)zîDecides the service account to use.

Service account is decided in the following order:
- service_account flag
- service_account gcloud config;

Args:
  args: Namespace, the args namespace.

Returns:
  A str representing service account.
Úservice_accountN)ÚgetattrrM   r   ÚVALUESÚrunappsÚdeployment_service_accountÚIsExplicitlySetÚGet)rJ   s    r   ÚGetServiceAccountrT   •   sh   € ô ˆTÐ$ d×+Ñ+Ø×ÑÐÜ×Ñ×Ñ×9Ñ9×IÑI×KÑKÜ×Ñ×$Ñ$×?Ñ?×CÑCÓEÐEð Lr   N)Ú__doc__Útypingr   Ú'googlecloudsdk.api_lib.run.integrationsr   r   Úgooglecloudsdk.callioper   Úgooglecloudsdk.corer   r   r   r   r   r"   r%   r(   r,   r3   r7   r;   r?   rC   rE   rB   rK   rT   © r   r   Ú<module>r[      s€   ðñ =õ å ?Ý =Ý /Ý *ò)ò'òò@ò'ò'ò/òLò
Oò$ò9ò0ò@òNð˜4  S ™>ô óFr   