
    	                     ^    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 Snoozes API.    )absolute_import)division)unicode_literals)apisc                 2    t        j                  dd|       S )N
monitoringv3no_http)r   GetClientInstancer
   s    0lib/googlecloudsdk/api_lib/monitoring/snoozes.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)	SnoozeClientz@Client for the Snooze service in the Stackdriver Monitoring API.Nc                     |xs
 t               | _        |xs t        |      | _        | j                  j                  | _        y r   )r   r   r   messagesprojects_snoozes_service)selfr   r   s      r   __init__zSnoozeClient.__init__$   s5    /-/DK9 1& 9DMKK00DMr   c                     | j                   j                  |j                         |      }| j                  j	                  |      S )zCreates a Stackdriver snooze.)parentsnooze)r   &MonitoringProjectsSnoozesCreateRequestRelativeNamer   Create)r   project_refr   reqs       r   r!   zSnoozeClient.Create)   sA    
--
>
>'') ? C ==$$r   c                     | j                   j                  |j                               }| j                  j	                  |      S )zGets an Monitoring Snooze.)name)r   #MonitoringProjectsSnoozesGetRequestr    r   Get)r   
snooze_refrequests      r   r'   zSnoozeClient.Get0   s=    mm??$$& @ (G==W%%r   c                     | j                   j                  |j                         ||      }| j                  j	                  |      S )a  Updates a Monitoring Snooze.

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

    Args:
      snooze_ref: resources.Resource, Resource reference to the snooze to be
          updated.
      snooze: Snooze, The snooze message to be sent with the request.
      fields: str, Comma separated list of field masks.
    Returns:
      Snooze, The updated Snooze.
    )r%   r   
updateMask)r   %MonitoringProjectsSnoozesPatchRequestr    r   Patch)r   r(   r   fieldsr)   s        r   UpdatezSnoozeClient.Update6   sG     mmAA$$& B G ==w''r   )NNr   )__name__
__module____qualname____doc__r   r!   r'   r/    r   r   r   r   !   s    H1
%&(r   r   )Fr   )r3   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   r   objectr   r4   r   r   <module>r8      s-    2 &  ' ,E 
'(6 '(r   