
    {                        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KJr  SSSSSSSS.rSSSSSSSS.rSSS.rSSS S!.rS"S#S$.rS%S&S'S(.rS)S*S+S,S-S.S/.rS0S1S2S3S4.rS5S6S7S8S9S:S;.rS<S=S>S?S@SASB.rSCSDSE.rSFSG0rSeSI jrSeSJ jrSfSK jrSL rSfSM jr  SeSN jr!SO r"SP r#SQ r$SR r%SS r&SfST jr'  SgSU jr(  ShSV jr)SW r*SX r+SY r,SZ r-S[ r.SfS\ jr/SfS] jr0S^ r1SfS_ jr2SfS` jr3Sa r4Sb r5   SiSc jr6Sd r7gH)jz4Shared resource flags for Cloud Monitoring commands.    )absolute_import)division)unicode_literals)arg_parsers)base)
exceptions)
completers)labels_util)repeated)timesCOMPARISON_GTCOMPARISON_LTCOMPARISON_GECOMPARISON_LECOMPARISON_EQCOMPARISON_NE)><z>=z<=z===z!=zUptime check against a URL.z/Uptime check against a Compute Engine instance.z*Uptime check against an App Engine module.z)Uptime check against an AWS EC2 instance.z,Uptime check against an ElasticLoadBalancer.z1Uptime check against a Service Directory service.z*Uptime check against a Cloud Run revision.)z
uptime-urlgce-instancezgae-appzaws-ec2-instanceaws-elb-load-balancerzservicedirectory-servicezcloud-run-revisionzSUptime check against a group of instances from Google Cloud or Amazon Web Services.z:Uptime check against a group of Amazon ELB load balancers.)r   r   zAn HTTP check.zAn HTTPS check.zA TCP check.)httphttpstcpzHTTP GET methodzHTTP POST method)getpostzNot specifiedzURL encodedzUser provided)unspecifiedzurl-encodedzuser-providedz(Any response code from 100-199 inclusivez(Any response code from 200-299 inclusivez(Any response code from 300-399 inclusivez(Any response code from 400-499 inclusivez(Any response code from 500-599 inclusivezAny response code)1xx2xx3xx4xx5xxanyz
One minutezFive minuteszTen minuteszFifteen minutes)151015zus-west1zus-east4zus-central1zeurope-west1zsouthamerica-east1zasia-southeast1)z
usa-oregonzusa-virginiazusa-iowaeuropezsouth-americazasia-pacificzResponse contains stringz Response does not contain stringzResponse matches regexzResponse does not match regexzResponse matches at JSONPathz#Response does not match at JSONPath)zcontains-stringznot-contains-stringzmatches-regexznot-matches-regexzmatches-json-pathznot-matches-json-pathz)Response matches exact string at JSONPathz"Response matches regex at JSONPath)zexact-matchzregex-matchz
oidc-tokenzOIDC Token authenticationNc                     U R                  SR                  U=(       d    U5      [        R                  " 5       SR                  U5      S9  g)z<Adds flags for specifying a message as a file to the parser.--{}-from-file2The path to a JSON or YAML file containing the {}.typehelpN)add_argumentformatr   FileContents)parserresourceflags      2lib/googlecloudsdk/command_lib/monitoring/flags.pyAddFileMessageFlagr6   {   sE    d.h/##%?FF
      c                 &   U R                  SS9nUR                  SR                  U=(       d    U5      SR                  U5      S9  UR                  SR                  U=(       d    U5      [        R                  " 5       SR                  U5      S9  g	)
zCAdds flags for specifying a message as a string/file to the parser.Tmutexz--{}z2The {} as a string. In either JSON or YAML format.r.   r*   r+   r,   N)	add_groupr/   r0   r   r1   )r2   r3   r4   message_groups       r5   AddMessageFlagsr>      s    """.-mmD$H%?FF
   d.h/##%?FF
  r7   c                     U(       a&  [         R                  " SSSS9R                  U 5        g U R                  SSR	                  U5      S9  g )Ndisplay_nameDISPLAY_NAMEz7Display name for the uptime check or synthetic monitor.)metavarr.   --display-namezThe display name for the {}.r;   )r   ArgumentAddToParserr/   r0   )r2   r3   
positionals      r5   AddDisplayNameFlagrG      sJ    MMF k&
=DDXN  r7   c                 N    U R                  SSSSSS.SR                  U5      S9  g	)
zfAdds flags for specifying a combiner, which defines how to combine the results of multiple conditions.z
--combinerzAn unspecified combinerzAn incident is created only if all conditions are met simultaneously. This combiner is satisfied if all conditions are met, even if they are met on completely different resources.z>An incident is created if any of the listed conditions is met.zCombine conditions using logical AND operator, but unlike the regular AND option, an incident is created only if all conditions are met simultaneously on at least one resource.)COMBINE_UNSPECIFIEDANDORAND_WITH_MATCHING_RESOURCEzThe combiner for the {}.choicesr.   N)r/   r0   r2   r3   s     r5   AddCombinerFlagrP      sA    !:K7)D  &,,X6%  8r7   c                    U R                  SS9n[        USS9  [        USS9  SU(       a  [        R                  OS0nU(       d  SUS'   UR
                  "  SS	S
0UD6  UR                  SS9nUR                  SU(       d  SOSSS9  UR                  SS9nUR                  SSS9  UR                  S[        R                  " 5       SS9  U(       a%  [        R                  " USSS5        [        SUSS9  g[        USS5        g)z)Adds policy settings flags to the parser.z      Policy Settings.
      If any of these are specified, they will overwrite fields in the
      `--policy` or `--policy-from-file` flags if specified.r;   zAlert Policyr3   action
store_trueTdefaultr.   zIf the policy is enabled.Documentationz--documentation-formatztext/markdownNzThe MIME type that should be used with `--documentation` or `--documentation-from-file`. Currently, only "text/markdown" is supported.)rU   r.   r9   z--documentationz1The documentation to be included with the policy.z--documentation-from-filezOThe path to a file containing the documentation to be included with the policy.r,   znotification-channelszNotification Channelsuser-labelsUser Labels
group_textpolicyz	--enabled)r<   rG   rP   r   StoreTrueFalseActionr/   r1   r   AddPrimitiveArgsAddUpdateLabelsFlagsAddCreateLabelsFlag)r2   updatepolicy_settings_groupenabled_kwargsdocumentation_groupdocumentation_string_groups         r5   AddPolicySettingsFlagsrf      sP    ** 1@* A *^D'.AF00. 
 $N9$$G3G7EG .77_7M""%+o #   3<<4<H))> * @ ))!##% * 
 	!
 ,H -}hGr7   c                 |    U R                  SS9nUR                  SS[        R                  " US9US9  U" U40 UD6  g)z4Adds fields flags with mutually excludisve settings.Tr9   z--fieldsfieldrN   rB   r-   r.   N)r<   r/   r   ArgList)r2   fields_helpadd_settings_funcfields_choiceskwargsupdate_groups         r5   +AddFieldsFlagsWithMutuallyExclusiveSettingsrq      sP     !!!-,~6	  
 L+F+r7   c                     U R                   (       a=  U R                  (       d+  U R                  (       d  [        R                  " SS/S5      eggg)z"Validate alert policy update args.z--policyz--policy-from-fileIf --fields is specified.N)fieldsr[   policy_from_filer   OneOfArgumentsRequiredExceptionargss    r5   ValidateAlertPolicyUpdateArgsry      s?    	[[$++)>)>

4
4	)*#% % *?+[r7   c                    U R                  5       S:X  a  g[        U 5      S:  a  [        R                  " SS5      eU S   nU SS n [        U   n[        U5      nUS	;  a  [        R                  " SS
5      eX44$ ! [         a    [        R                  " SS
5      e[         a    [        R                  " SS5      ef = f)z/Validates and returns the comparator and value.absent)NN   --ifzInvalid value for flag.r      N)r   r   zComparator must be < or >.zThreshold not a value float.)lowerlenr   BadArgumentExceptionCOMPARISON_TO_ENUMfloatKeyError
ValueError)if_valuecomparator_partthreshold_part
comparatorthreshold_values        r5   ComparisonValidatorr      s    ^^!]Q

)
)&2K
LLQK/AB<.J#O4JN+O ;;++F,HJ J&&	 H

)
)&*FH H	 J

)
)&*HJ JJs   3A; ;AB=c                     U R                  SS9nUR                  SSS9  UR                  SSS9  UR                  SSS9  UR                  S	[        R                  " 5       S
S9  [	        U5        g)z*Adds policy condition flags to the parser.z        Condition Settings.
        This will add a condition to the created policy. If any conditions are
        already specified, this condition will be appended.r;   z--condition-display-namez#The display name for the condition.z--condition-filterzISpecifies the "filter" in a metric absence or metric threshold condition.z--aggregationzSpecifies an Aggregation message as a JSON/YAML value to be applied to the condition. For more information about the format: https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPoliciesz
--durationzaThe duration (e.g. "60s", "2min", etc.) that the condition must hold in order to trigger as true.r,   N)r<   r/   r   DurationAddUpdateableConditionFlags)r2   condition_groups     r5   AddConditionSettingsFlagsr     s    $$ +?$ @/  0  2    $  % !4  5
 o.r7   c                     U R                  SS[        SS9  U R                  SS9nUR                  S[        SS	9  UR                  S
[        SS	9  g)zDAdds flags for condition settings that are updateable to the parser.r}   r   zWOne of "absent", "< THRESHOLD", "> THRESHOLD" where "THRESHOLD" is an integer or float.)destr-   r.   Tr9   z--trigger-countzbThe absolute number of time series that must fail the predicate for the condition to be triggered.r,   z--trigger-percentz]The percentage of time series that must fail the predicate for the condition to be triggered.N)r/   r   r<   intr   )r2   trigger_groups     r5   r   r   .  sv    "	  # """.-0  1
 ,  -r7   c                     U R                   (       a=  U R                  (       d+  U R                  (       d  [        R                  " SS/S5      eggg)z*Validate notification channel update args.z--channel-contentz--channel-content-from-filers   N)rt   channel_contentchannel_content_from_filer   rv   rw   s    r5   %ValidateNotificationChannelUpdateArgsr   C  sG    
kk4#A#A

4
4	;<#% % $B r7   c                 d   U R                  SS9n[        US5        UR                  SSS9  UR                  SSS9  SU(       a  [        R                  OS	0nU(       d  S
US'   UR                  "  SSS0UD6  U(       a  [        SUSS9  [        SUSSS9  g[        USS5        [        USSSSS9  g)z.Adds flags for channel settings to the parser.zNotification channel settingsr;   channelz--descriptionz(An optional description for the channel.z--typezsThe type of the notification channel. This field matches the value of the NotificationChannelDescriptor type field.rS   rT   TrU   r.   z=Whether notifications are forwarded to the described channel.rW   rX   rY   zchannel-labelsFzOConfiguration Fields: Key-Value pairs that define the channel and its behavior.)validate_valuesrZ   zHThese are configuration fields that define the channel and its behavior.)r   extra_messageNr\   )r<   rG   r/   r   r]   r_   r`   )r2   ra   channel_grouprc   s       r5   "AddNotificationChannelSettingFlagsr   L  s    ""(G"H-]I.5  7 D  E F00. 
 $N9J 	 }@-/0
 }i@'E*+r7   c                     U(       d  USR                  U5      -  n[        R                  " UUUS9R                  U 5        g)zAdd create labels flags.z{If the {0} was given as a JSON/YAML object from a string or file, this flag will replace the labels value in the given {0}.)r   labels_namer   N)r0   r
   GetCreateLabelsFlagrE   )r2   r   resource_namer   r   skip_extra_messages         r5   r`   r`   q  sF     
 **0&*?AM !!!%' (3{6':r7   c                    UR                  U5      n[        R                  " SU US9R                  U5        UR                  SS9n[        R                  " SU S9R                  U5        [        R
                  " U S9R                  U5        g)zAdd update labels flags. )r   r   Tr9   )r   N)r<   r
   GetUpdateLabelsFlagrE   GetRemoveLabelsFlagGetClearLabelsFlag)r   r2   rZ   r   labels_groupremove_groups         r5   r_   r_   ~  s     !!*-,!!k%''2{<'@''d'3,!!k##.;|#<  *{<8r7   c                 j    [         R                  " SS[        R                  SR	                  U 5      S9$ )z1Flag for managing a monitored resource container.!monitored_resource_container_name!MONITORED_RESOURCE_CONTAINER_NAMEzUMonitored resource container (example - projects/PROJECT_ID) project you want to {0}.)rB   	completerr.   )r   rD   r	   #MonitoredResourceContainerCompleterr0   )verbs    r5   %GetMonitoredResourceContainerNameFlagr     s0    	)1>>$fTl
 r7   c           	      l    U R                  SS[        R                  " SSS9SR                  U5      S9  g )Nz--criteria-policiesCRITERIA_POLICIESr~      )
min_length
max_lengthz{The policies that the {} applies to. Exactly 1 alert policy is required if `criteria-filter` is specified at the same time.rj   )r/   r   rk   r0   rO   s     r5   AddCriteriaPoliciesFlagr     s;    !!;J6(  	r7   c                 N    U R                  SS[        SR                  U5      S9  g )Nz--criteria-filterCRITERIA_FILTERa<  Optional. When you define a {}, you can also define a filter for that snooze. The filter is a string containing one or more key-value pairs. The string uses the standard https://google.aip.dev/160 filter syntax. If you define a filter for a snooze, then the snooze can only apply to one alert policy. When the snooze is active, incidents won't be created when the incident would have key-value pairs (labels) that match those specified by the filter in the snooze. Snooze filters support resource, metric, and metadata labels. If multiple labels are used, then they must be connected with an AND operator. For example: resource.labels.instance_id="1234567890" AND resource.labels.zone="us-central1-a" AND metric.labels.instance_name="test_group" AND metadata.user_labels.foo="bar" AND metadata.system_labels.region="us-central1"rj   )r/   strr0   rO   s     r5   AddCriteriaFilterFlagr     s0    9 :@9I'  r7   c                 t    U R                  S[        R                  R                  SR	                  U5      S9  g )N--start-timezThe start time for the {}.r,   r/   r   DatetimeParser0   rO   s     r5   AddStartTimeFlagr     s5    %%'..x8  :r7   c                 t    U R                  S[        R                  R                  SR	                  U5      S9  g )N
--end-timezThe end time for the {}.r,   r   rO   s     r5   AddEndTimeFlagr     s5    %%%,,X6  8r7   c                     U R                  SS9n[        USS9  U(       d  [        USS9  [        USS9  [	        USS9  [        USS9  g)z)Adds snooze settings flags to the parser.z      Snooze Settings.
      If any of these are specified, they will overwrite fields in the
      `--snooze-from-file` flags if specified.r;   SnoozerR   N)r<   rG   r   r   r   r   )r2   ra   snooze_settings_groups      r5   AddSnoozeSettingsFlagsr     sW     ** 12* 3 *X>	1HE/(C(8<&:r7   c                 j    U(       d  [        U 5        [        X5        [        X5        [        U 5        g)z/Adds uptime check settings flags to the parser.N)AddUptimeResourceFlagsAddUptimeProtocolFlagsAddUptimeRunFlagsAddUptimeMatcherFlags)r2   ra   s     r5   AddUptimeSettingsFlagsr     s%    	6"(F#r7   c           	         U R                  SSSS9nUR                  SS9nUR                  SS[        S9  [        R                  " S	S
[
        R                  " [        [        S9[
        R                  SSS9R                  U5        UR                  SS9nUR                  SS[        S9  UR                  SSS[        S9  UR                  SS[        S9  g)z8Adds uptime check resource settings flags to the parser.zUptime check resource.T)r.   r:   requiredzMonitored resourcer;   z--resource-typez5Type of monitored resource, defaults to `uptime-url`.r.   rN   z--resource-labels	KEY=VALUEkey_type
value_typezValues for all of the labels listed in the associated monitored resource descriptor.
            See https://cloud.google.com/monitoring/api/resources for more information and allowed
            keys.)rB   r-   rS   r   r.   zMonitored resource groupz--group-typezCThe resource type of the group members, defaults to `gce-instance`.z
--group-idz'The group of resources being monitored.)r.   r   r-   z--synthetic-targetzfThe target of the Synthetic Monitor.
        This is the fully qualified GCFv2 resource name.
        r.   r-   N)r<   r/   UPTIME_MONITORED_RESOURCESr   rD   r   ArgDictr   UpdateActionrE   UPTIME_GROUP_RESOURCES)r2   uptime_resource_groupmonitored_resource_groupgroup_resource_groups       r5   r   r     s    **# + 
 3<< =  ''B( ( 
 --<%% K().88% 9  ##
O$ $  ##4	 $  $$  % r7   c           	         U R                  SS9nU(       d  UR                  SS[        S9  UR                  SS[        R                  " SS	S
9S9  UR                  SS[        R                  " SSS
9S9  UR                  SS[
        S9  UR                  SS[        S9  UR                  SS[        S9  UR                  SS[        S9  UR                  SS[        S9  UR                  SS9nUR                  SS[        S9  U(       a  UR                  SS9n[        R                  " SS[        R                  " [        [        S9[        R                  S S!9R                  U5        UR                  S"S#S$9nUR                  S%S&S'[        R                  " [        5      S(9  UR                  S)S*[        S9  OP[        R                  " S+S[        R                  " [        [        S9[        R                  S,S!9R                  U5        UR                  S-S.[        S9  UR                  S/S0[        S9  UR                  S1S2[        S9  UR                  S3S4[        S9  UR                  S5S#S$9nU(       GaA  UR                  S6S#S$9nUR                  S7S8S9[        R                  " [         S:9S(9  UR                  S;S8S<[        R                  " [         S:9S(9  UR                  S=S8S>[        R                  " [         S:9S(9  UR                  S?S@[        S9  UR                  SAS#S$9nUR                  SBSCSD[        R                  " ["        5      S(9  UR                  SESCSF[        R                  " ["        5      S(9  UR                  SGSCSH[        R                  " ["        5      S(9  UR                  SISJ[        S9  gOUR                  SKS8SL[        R                  " [         S:9S(9  UR                  SMSCSN[        R                  " ["        5      S(9  gO)Pz8Adds uptime check protocol settings flags to the parser.zUptime check protocol settings.r;   z
--protocolz0The protocol of the request, defaults to `http`.r   z--portzThe port on the server against which to run the check.
        Defaults to `80` when `--protocol` is `http`.
        Defaults to `443` when `--protocol` is `https`.
        Required if `--protocol` is `tcp`.r~   i  lower_boundupper_boundr   z--pings-countz3Number of ICMP pings to send alongside the request.   z--request-methodzpThe HTTP request method to use, defaults to `get`.
        Can only be set if `--protocol` is `http` or `https`.z--pathzThe path to the page against which to run the check, defaults to `/`.
        Can only be set if `--protocol` is `http` or `https`.z
--usernamez{The username to use when authenticating with the HTTP server.
        Can only be set if `--protocol` is `http` or `https`.z
--passwordz{The password to use when authenticating with the HTTP server.
        Can only be set if `--protocol` is `http` or `https`.z--mask-headersz}Whether to encrypt the header information, defaults to `false`.
        Can only be set if `--protocol` is `http` or `https`.z)Uptime check service agent authorization.z--service-agent-authzkThe type of authentication to use for the HTTP request.
        Can only be set if `--protocol` is `https`.zUptime check headers.z--update-headersr   r   zThe list of headers to add to the uptime check. Any existing
              headers with matching "key" are overridden by the provided
              values.)rB   r-   rS   r.   zUptime check remove headers.Tr.   r:   z--remove-headersKEYz8The list of header keys to remove from the uptime check.rB   r.   r-   z--clear-headersz&Clear all headers on the uptime check.z	--headerszThe list of headers to send as part of the uptime check
              request. Can only be set if `--protocol` is `http` or `https`.z--content-typezThe content type header to use for the check, defaults to `unspecified`.
        Can only be set if `--protocol` is `http` or `https`.z--custom-content-typezwA user-provided content type header to use for the check.
        Can only be set if `--protocol` is `http` or `https`.z--validate-sslzWhether to include SSL certificate validation as a part of the uptime check,
        defaults to `false`.
        Can only be set if `--protocol` is `http` or `https`.z--bodyzuThe request body associated with the HTTP POST request.
        Can only be set if `--protocol` is `http` or `https`.zUptime check status.zUptime check status classes.z--set-status-classeszstatus-classz|List of HTTP status classes. The uptime check will only pass if the response
                code is contained in this list.ri   z--add-status-classesz;The list of HTTP status classes to add to the uptime check.z--remove-status-classesz@The list of HTTP status classes to remove from the uptime check.z--clear-status-classeszClear all HTTP status classes on the uptime check. Setting this
            flag is the same as selecting only the `2xx` status class.zUptime check status codes.z--set-status-codeszstatus-codezxList of HTTP status codes. The uptime check will only pass if the response
                code is present in this list.z--add-status-codesz9The list of HTTP status codes to add to the uptime check.z--remove-status-codesz>The list of HTTP status codes to remove from the uptime check.z--clear-status-codeszClear all HTTP status codes on the uptime check. Setting this
            flag is the same as selecting only the `2xx` status class.z--status-classeszList of HTTP status classes. The uptime check only passes when the response
              code is contained in this list. Defaults to `2xx`.
              Can only be set if `--protocol` is `http` or `https`.z--status-codeszList of HTTP Status Codes. The uptime check will only pass if the response code
              is present in this list.
              Can only be set if `--protocol` is `http` or `https`.N)r<   r/   UPTIME_PROTOCOLSr   
BoundedIntUPTIME_REQUEST_METHODSr   boolUPTIME_SERVICE_AGENT_TYPESr   rD   r   r   rE   rk   UPTIME_CONTENT_TYPESUPTIME_STATUS_CLASSESr   )	r2   ra   uptime_protocol_groupuptime_service_agent_auth_groupuptime_headers_groupuptime_remove_header_groupuptime_status_groupuptime_status_classes_groupuptime_status_codes_groups	            r5   r   r     s    **, +  
&&?  ' 
 $$. !!aUC %  $$@!!aQ? % 
 $$A$	 %  $$A	 %  $$A	 %  $$A	 %  $$A	 %  %:$C$C6 %D %! "..7(	 / *
 0::$ ;  	MM  ##>'' k&'!5!?!?+ "@ " ++K  %	 ,  ++9 ,  	MM  ##>''P	 k'($$A"	 %  $$A	 %  $$A  %  $$A	 %  .77! 8  "5"?"?+ #@ #  ,,3  )>? -   ,,N  )>?	 -   ,,!S  )>?	 -   ,, J	 -  !4 = =) !> ! **1  % +  **L  %	 +  **Q  %	 +  **J	 +  $$G   )>? %  $$G   % % r7   c           	         U R                  SS9nUR                  SS[        S9  UR                  SS[        R                  " SS	S
9S9  U(       a  [        USSS9  UR                  SSS9nUR                  SSS[        R                  " [        S9S9  UR                  SSS[        R                  " [        S9S9  UR                  SSS[        R                  " [        S9S9  UR                  SS[        S9  O(UR                  SSS[        R                  " [        S9S9  U(       a  [        S US!5        g#[        US S!SS"9  g#)$z*Adds uptime check run flags to the parser.z	Settings.r;   z--periodzThe time between uptime check or synthetic monitor executions in
              minutes, defaults to `1`. Can be set for synthetic monitors.r   z	--timeoutzThe maximum amount of time in seconds to wait for the request to complete, defaults to `60`. Can be set for synthetic monitors.r~   <   r   r   z!uptime check or synthetic monitorF)r3   rF   zUptime check selected regions.Tr   z--set-regionsregionzaThe list of regions from which the check is run. At least 3 regions must be
            selected.ri   r   z--add-regionsz/The list of regions to add to the uptime check.z--remove-regionsz4The list of regions to remove from the uptime check.z--clear-regionszxClear all regions on the uptime check. This setting acts the same as if all available
            regions were selected.z	--regionsrh   zThe list of regions from which the check is run. At least 3 regions must be selected.
            Defaults to all available regions.rW   z/User labels. Can be set for synthetic monitors.)r   N)r<   r/   UPTIME_PERIODSr   r   rG   rk   UPTIME_REGIONSr   r_   r`   )r2   ra   uptime_settings_groupuptime_regions_groups       r5   r   r     s    ***<$$N	 %  $$L !!aR@ %  4
 1::1 ;  %%  8 &  %%B  8	 &  %%G  8	 &  %%&	 &  &&2  8 '  9 9	r7   c                     U R                  SS9nUR                  SS[        SS9  UR                  S[        SS	9  UR                  S
S9nUR                  S[        SSS9  UR                  S[        SS	9  g)z.Adds uptime check matcher flags to the parser.zUptime check matcher settings.r;   z--matcher-contentTz'String, regex or JSON content to match.)r   r-   r.   z--matcher-typezhThe type of content matcher that is applied to the server output, defaults to
        `contains-string`.rM   z1Uptime check matcher settings for JSON responses.z--json-pathzJSONPath within the response output pointing to the expected content to match.
            Only used if `--matcher-type` is `matches-json-path` or `not-matches-json-path`.)r-   r   r.   z--json-path-matcher-typezThe type of JSONPath match that is applied to the JSON output, defaults to
            `exact-match`.
            Only used if `--matcher-type` is `matches-json-path` or `not-matches-json-path`.N)r<   r/   r   UPTIME_MATCHER_TYPESUPTIME_JSON_MATCHER_TYPES)r2   uptime_matcher_groupuptime_json_matcher_groups      r5   r   r   4  s    ))/O)P##4	 $  ##" $  3<<> =  ((`	 )  (( '` ) r7   c                 z    U R                   (       a*  U R                  (       d  [        R                  " S/S5      egg)zValidate snooze update args.z--snooze-from-filers   N)rt   snooze_from_filer   rv   rw   s    r5   ValidateSnoozeUpdateArgsr  V  s4    	[[..

4
4	 ;  /[r7   c                 >   Sn[         R                  " U R                  R                  5      nU[         R                  " 5       :  a  SnU(       aO  Ub  [
        R                  " SS5      eUb  [
        R                  " SS5      eUb  [
        R                  " SS5      egg)z#Validate snooze reference interval.FTNrC   z)Expired snoozes can no longer be updated.r   r   )r   ParseDateTimeintervalendTimeNowr   InvalidArgumentException)snoozer@   
start_timeend_timesnooze_pastend_time_refs         r5   ValidateSnoozeIntervalr  ^  s     +$$V__%<%<=,EIIKK//

5  
	//

5  
	//

5  
 r7   c                     U R                  5       nUR                  SS[        R                  " [        R                  " 5       5      SS9  UR                  SS[        R                  " 5       SS9  g)	z!Adds migrate flags to the parser.z+--policies-from-prometheus-alert-rules-yaml PROMETHEUS_ALERT_RULE_FILE_PATHSzOne or more Prometheus alert rule YAML files (separated by commas if multiple) to be converted to Cloud Alerting Policies. Example: --policies-from-prometheus-alert-rules-yaml=rules_1.yaml,rules_2.yamlrj   z,--channels-from-prometheus-alertmanager-yaml"PROMETHEUS_ALERT_MANAGER_FILE_PATHa	  Prometheus alert manager YAML file to be converted to Cloud Monitoring notification channels. Specifying this flag with the --policies-from-prometheus-alert-rules-yaml flag puts the newly created notification channels into the translated Alert Policies' definition.N)r<   r/   r   rk   r1   )r2   migrate_groups     r5   AddMigrateFlagsr  |  sr    ""$-30{779:R  	 42##%  r7   )N)F)r   TF)r   T)NNN)8__doc__
__future__r   r   r   googlecloudsdk.callioper   r   r   %googlecloudsdk.command_lib.monitoringr	   $googlecloudsdk.command_lib.util.argsr
   r   googlecloudsdk.core.utilr   r   r   r   r   r   r   r   r   r   r   r   r   r6   r>   rG   rP   rf   rq   ry   r   r   r   r   r   r`   r_   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r7   r5   <module>r     s   ; &  ' / ( . < < 9 * 
	


	
  0E;CK;F
 	# 	E      # $  65555  
	

	 )% 2=-87B  ?7  - 

8.*H` @D,%J2/6-*%"+J KMAF
; :<)-9

2:8; 1hM`HVD 	<r7   