
                             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 r
S	 rS
 rS rS rS rS rS rS rS rS rS rSS jrS r  SS jrS rS rS rS rSS jrg)z4Shared resource flags for Cloud Monitoring commands.    )absolute_import)division)unicode_literals)concepts)concept_parsers)presentation_specsc                  ,    [         R                  " SSS9$ )NalertzName of the alert.name	help_textr    ResourceParameterAttributeConfig     :lib/googlecloudsdk/command_lib/monitoring/resource_args.pyAlertAttributeConfigr      s    		2	22
 r   c                  ,    [         R                  " SSS9$ )NpolicyzName of the alerting policy.r   r   r   r   r   AlertPolicyAttributeConfigr       s    		2	2.
0 0r   c                  ,    [         R                  " SSS9$ )N	conditionz&Name of the alerting policy condition.r   r   r   r   r   ConditionAttributeConfigr   &   s    		2	28
: :r   c                  ,    [         R                  " SSS9$ )Nnotification_channelsz!Name of the Notification Channel.r   r   r   r   r   "NotificationChannelAttributeConfigr   ,   s    		2	2"3
5 5r   c                  ,    [         R                  " SSS9$ )NsnoozezName of the snooze.r   r   r   r   r   SnoozeAttributeConfigr   2   s    		2	2%
' 'r   c                  ,    [         R                  " SSS9$ )Ncheck_idz.Name of the uptime check or synthetic monitor.r   r   r   r   r   UptimeCheckAttributeConfigr"   8   s    		2	2@
B Br   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nzmonitoring.projects.alertsAlert)resource_namealertsId
projectsId)r   ResourceSpecr    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   GetAlertResourceSpecr*   >   s*    			"#%::	
 r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz!monitoring.projects.alertPolicieszAlert Policy)r%   alertPoliciesIdr'   )r   r(   r   r)   r   r   r   GetAlertPolicyResourceSpecr-   G   s*    			)"02::	
< <r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nz,monitoring.projects.alertPolicies.conditionsr   )r%   conditionsIdr,   r'   )r   r(   r   r   r)   r   r   r   GetConditionResourceSpecr0   O   s0    			4+-02::
< <r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz(monitoring.projects.notificationChannelszNotification Channel)r%   notificationChannelsIdr'   )r   r(   r   r)   r   r   r   "GetNotificationChannelResourceSpecr3   X   s*    			0*?A::	
< <r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nzmonitoring.projects.snoozesSnooze)r%   	snoozesIdr'   )r   r(   r   r)   r   r   r   GetSnoozeResourceSpecr7   `   s*    			#%'::	
< <r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz&monitoring.projects.uptimeCheckConfigsz!uptime check or synthetic monitor)r%   uptimeCheckConfigsIdr'   )r   r(   r"   r)   r   r   r   GetUptimeCheckResourceSpecr:   h   s*    			.757::	
< <r   c                 b    U(       a  SnOSnSU -   n[         R                  " U[        5       USS9$ )Nalert_policyz--policyzName of the Alert Policy Trequired)r   ResourcePresentationSpecr-   )verb
positionalr   r   s       r   CreateAlertPolicyResourceArgrB   p   s;    DD)D0)		4	4
 "	
 r   c                 d    SR                  U 5      n[        R                  " S[        5       USSS9$ )Nz The name of the Condition to {}.r   TF)r>   prefixes)formatr   r?   r0   )r@   r   s     r   CreateConditionResourceArgrF   ~   s7    077=)		4	4 
 r   c                 ^    U(       a  SnOSn[         R                  " U [        5       XA-   UUS9$ )a  Create a resource argument for a Cloud Monitoring Notification Channel.

Args:
  arg_name: str, the name for the arg.
  extra_help: str, the extra_help to describe the resource. This should start
    with the verb, such as 'to update', that is acting on the resource.
  required: bool, if the arg is required.
  plural: bool, if True, use a resource argument that returns a list.

Returns:
  the PresentationSpec for the resource argument.
z+Names of one or more Notification Channels z!Name of the Notification Channel )r>   plural)r   r?   r3   )arg_name
extra_helpr>   rH   	help_stems        r   $CreateNotificationChannelResourceArgrL      s9     =I3I		4	4(*
 r   c                 N    SnSU -   n[         R                  " U[        5       USS9$ )Nr   zName of the Snooze Tr=   )r   r?   r7   r@   r   r   s      r   CreateSnoozeResourceArgrO      s3    	$#d*)		4	4
	
 r   c                 N    SnSU -   n[         R                  " U[        5       USS9$ )Nr!   z.Name of the uptime check or synthetic monitor Tr=   )r   r?   r:   rN   s      r   CreateUptimeResourceArgrQ      s3    	$>E)		4	4
 "	
 r   c                 N    [         R                  " U5      R                  U 5        g)zrAdd resource arguments.

Args:
  parser: the parser for the command.
  resources: a list of resource args to add.
N)r   ConceptParserAddToParser)parser	resourcess     r   AddResourceArgsrW      s     	*66v>r   c                      S $ )Nc                     U R                   $ )N)r   )xs    r   <lambda>)GetAlertResourceUriFunc.<locals>.<lambda>   s    166r   r   r   r   r   GetAlertResourceUriFuncr]      s    	r   c                     [         R                  " [        R                  " S[        R
                  " SS[        R                  S9SU-   US9/5      R                  U 5        g)zAdd a resource argument for a Google Cloud Platform Console project.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: str, the help text for the arg.
  required: bool, if the arg is required.
z	--projectzcloudresourcemanager.projectsproject)r%   	projectIdzProject r=   N)r   rS   r   r?   r   r(   r)   rT   )rU   r   r>   s      r   AddProjectResourceArgra      s^     11



-% AA
 y
 	!  [r   N)T)TF)__doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r   r   r   r"   r*   r-   r0   r3   r7   r:   rB   rF   rL   rO   rQ   rW   r]   ra   r   r   r   <module>rf      s    ; &  ' 5 D G0:5'B<<<<< IM056?r   