
                            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	KJr  SS
KJr  SS jr SS\\	R$                     S\R&                  S\\R(                     4S jjrS rS rS rS rS rS rg)z1Code for making shared messages between commands.    )absolute_import)division)print_function)unicode_literals)Optional)types_utils)integration_printer)base)runapps_v1alpha1_messagesc                 &    SR                  XU5      $ )zReturns a user message for a successful integration deploy.

Args:
  integration_type: str, type of the integration
  integration_name: str, name of the integration
  action: str, the action that succeeded
zQ[{{bold}}{}{{reset}}] integration [{{bold}}{}{{reset}}] has been {} successfully.format)integration_typeintegration_nameactions      @lib/googlecloudsdk/command_lib/run/integrations/messages_util.pyGetSuccessMessager      s    "
Fv67    Nmetadataresourceresource_statusc                 ~    [         R                  " U 5      nUR                  [        R                  " SU SUUSS95      $ )zPrint the call to action message for the given integration.

Args:
  metadata: the type metadata
  resource: the integration resource object
  resource_status: status of the integration

Returns:
  A formatted string of the call to action message.
N)namer   regionr   statuslatest_deployment)r	   GetFormatterCallToActionr
   Record)r   r   r   	formatters       r   GetCallToActionr!   ,   sD     "..x8)			! 
 r   c                 $    SR                  U 5      $ )zReturns message when delete command fails.

Args:
  integration_name: str, name of the integration.

Returns:
  A formatted string of the error message.
zODeleting Integration [{}] failed, please rerun the delete command to try again.r   )r   s    r   GetDeleteErrorMessager#   F   s     012r   c                 8    SR                  [        U 5      U5      $ )zMessage about check status with describe command.

Args:
  release_track: Release track of the command being run.
  integration_name: str, name of the integration.

Returns:
  A formatted string of the message.
zEYou can check the status with `gcloud {}run integrations describe {}`r   _ReleaseCommandPrefixrelease_trackr   s     r   CheckStatusMessager)   S   s!     Nv#M24DEGr   c                 >    SSR                  [        U 5      U5      -   $ )zMessage about retry deployment using update command.

Args:
  release_track: Release track of the command being run.
  integration_name: str, name of the integration.

Returns:
  A formatted string of the message.
z,To retry the deployment, use update command z%`gcloud {}run integrations update {}`r%   r'   s     r   RetryDeploymentMessager+   b   s)     53v#M24DEFGr   c                 6    U R                   nU(       a  US-  nU$ )zPrefix for release track for printing commands.

Args:
  release_track: Release track of the command being run.

Returns:
  A formatted string of the release track prefix
 )prefix)r(   tracks     r   r&   r&   r   s      

%
	SLE	,r   c                 $    SR                  U 5      $ )zGenerates a message when an integration already exists during create.

Args:
  name: name of the integration.

Returns:
  A string message.
z[Integration with name [{}] already exists. Update it with `gcloud run integrations update`.r   r   s    r   IntegrationAlreadyExistsr2      s    =>DfTlKr   c                 $    SR                  U 5      $ )z|Generates a message when an integration is not found.

Args:
  name: name of the integration.

Returns:
  A string message.
zdIntegration [{}] cannot be found. First create an integration with `gcloud run integrations create`.r   r1   s    r   IntegrationNotFoundr4      s    O6$<r   )deployed)N)__doc__
__future__r   r   r   r   typingr   'googlecloudsdk.api_lib.run.integrationsr   +googlecloudsdk.command_lib.run.integrationsr	   6googlecloudsdk.command_lib.run.integrations.formattersr
   6googlecloudsdk.generated_clients.apis.runapps.v1alpha1r   runappsr   TypeMetadataResourceResourceStatusr!   r#   r)   r+   r&   r2   r4    r   r   <module>rB      s    8 &  % '  ? K G g7" 9={//0 g4454
2GG 
Kr   