
    
                     ^    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddZddZ G d	 d
e	      Z
y)z*Utilities for Cloud Monitoring Uptime API.    )absolute_import)division)unicode_literals)apisc                 2    t        j                  dd|       S )N
monitoringv3no_http)r   GetClientInstancer
   s    /lib/googlecloudsdk/api_lib/monitoring/uptime.pyr   r      s    			dG	DD    Nc                 6    | xs
 t               } | j                  S N)r   MESSAGES_MODULE)clients    r   GetMessagesModuler      s    (&(&			r   c                   ,    e Zd ZdZddZd Zd ZddZy)	UptimeClientzFClient for the Uptime Check service in the Stackdriver Monitoring API.Nc                     |xs
 t               | _        |xs t        |      | _        | j                  j                  | _        y r   )r   r   r   messagesprojects_uptimeCheckConfigs_service)selfr   r   s      r   __init__zUptimeClient.__init__$   s5    /-/DK9 1& 9DMKK;;DMr   c                     | j                   j                  |j                               }| j                  j	                  |      S )z Gets a Stackdriver uptime check.)name)r   .MonitoringProjectsUptimeCheckConfigsGetRequestRelativeNamer   Get)r   uptime_check_refrequests      r   r    zUptimeClient.Get)   s?    mmJJ**, K G ==W%%r   c                     | j                   j                  |j                         |      }| j                  j	                  |      S )z#Creates a Stackdriver uptime check.)parentuptimeCheckConfig)r   1MonitoringProjectsUptimeCheckConfigsCreateRequestr   r   Create)r   project_refuptime_checkreqs       r   r'   zUptimeClient.Create0   sB    
--
I
I'')& J C ==$$r   c                     | j                   j                  |j                         ||      }| j                  j	                  |      S )a  Updates a Stackdriver uptime check.

    If fields is not specified, then the uptime check is replaced entirely. If
    fields are specified, then only the fields are replaced.

    Args:
      uptime_check_ref: resources.Resource, Resource reference to the
        uptime_check to be updated.
      uptime_check: Uptime Check, The uptime_check message to be sent with the
        request.
      fields: str, Comma separated list of field masks.

    Returns:
      Uptime Check, The updated Uptime Check.
    )r   r%   
updateMask)r   0MonitoringProjectsUptimeCheckConfigsPatchRequestr   r   Patch)r   r!   r)   fieldsr"   s        r   UpdatezUptimeClient.Update8   sG      mmLL**,& M G
 ==w''r   )NNr   )__name__
__module____qualname____doc__r   r    r'   r0    r   r   r   r   !   s    N<
&%(r   r   )Fr   )r4   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   r   objectr   r5   r   r   <module>r9      s-    1 &  ' ,E 
,(6 ,(r   