
                         f    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	\
5      rg
)z/API client library for Cloud DNS managed zones.    )absolute_import)division)unicode_literals)
operations)util)logc                   ^    \ rS rSrSrS
S jr\SS j5       rS r         SS jr	S r
S	rg)Client   z'API client for Cloud DNS managed zones.Nc                     Xl         X l        U R                  R                  U l        U=(       d    U R                  R                  U l        X@l        g N)versionclientmanagedZones_serviceMESSAGES_MODULEmessageslocation)selfr   r   r   r   s        /lib/googlecloudsdk/api_lib/dns/managed_zones.py__init__Client.__init__   s8    LKKK,,DM; ; ;DMM    c                 :    U " U[         R                  " U5      US9$ )N)r   )r   GetApiClient)clsr   r   s      r   FromApiVersionClient.FromApiVersion$   s    w))'2XFFr   c                 V   U R                   (       aR  U R                  R                  U R                  R	                  UR
                  UR                  U R                   S95      $ U R                  R                  U R                  R	                  UR
                  UR                  S95      $ )N)projectmanagedZoner   r    r!   )r   r   Getr   DnsManagedZonesGetRequestr    r!   )r   zone_refs     r   r#   
Client.Get(   s    }}]]
--
1
1&&"..}} 2 &' '
 ==//$$ ,, 	0 	./ /r   c                 ^   U R                   R                  UR                  5       UUUS9nU(       a  Xll        U(       a  X|l        U(       a  Xl        U	(       a  Xl        U
(       a  Xl        U R                   R                  UUR                  UR                  5       S9nU R                  (       a  U R                  Ul
        U R                  R                  U5         U R                  R                  R                  U5      nSSS5        UR                  UR                  5       S.nU R                  (       a  U R                  US'   [        R                   " U R"                  5      R%                  WR&                  USS9nU(       aL  [(        R*                  R-                  SR/                  UR                  5       UR                  5       5      5        g[0        R2                  " U R"                  US	R/                  UR                  5       5      U R                  5      $ ! , (       d  f       GN"= f)
a  Managed Zones Update Request.

Args:
  zone_ref: the managed zones being patched.
  is_async: if the PATCH operation is asynchronous.
  dnssec_config: zone DNSSEC config.
  description: zone description.
  labels: zone labels.
  private_visibility_config: zone visibility config.
  forwarding_config: zone forwarding config.
  peering_config: zone peering config.
  service_directory_config: zone service directory config.
  cloud_logging_config: Stackdriver logging config.
  cleared_fields: the fields that should be included in the request JSON as
    their default value (fields that are their default value will be omitted
    otherwise).

Returns:
  The PATCH response, if operation is not asynchronous.
)namednssecConfigdescriptionlabelsmanagedZoneResourcer    r!   Nr"   r   dns.managedZoneOperationsparams
collectionz$Updating [{0}] with operation [{1}].Updating managed zone [{}])r   ManagedZoneNameprivateVisibilityConfigforwardingConfigpeeringConfigserviceDirectoryConfigcloudLoggingConfigDnsManagedZonesPatchRequestr    r   r   IncludeFieldsr   Patchr   GetRegistryr   Parseidr   statuswriteformatr   WaitFor)r   r%   is_asyncdnssec_configr*   r+   private_visibility_configforwarding_configpeering_configservice_directory_configcloud_logging_configcleared_fieldszonerequest	operationoperation_paramoperation_refs                    r   r<   Client.Patch4   s   @ ==$$]]_"	 % D
 !%>"/)$<! 4mm77   MMO 8 %G
 }}g 
	"	">	2++**009i 
3 ##}}O
 }}$(MMoj!$$T\\288. 9 0M
 	jj
0
7
7mmo}11356 $++HMMO<	 + 
3	2s   &H
H,c                 2   U R                  U5      nX#l        U R                  R                  U R                  R                  UUR                  UR                  5       S95      nUR                  UR                  5       S.nU R                  (       a  U R                  US'   [        R                  " U R                  5      R                  UR                  USS9n[        R                  " U R                  USR!                  UR                  5       5      5      $ )z1Update labels using Managed Zones Update request.r,   r"   r   r.   r/   r2   )r#   r+   r   Updater   DnsManagedZonesUpdateRequestr    r4   r   r   r=   r   r>   r?   r   rC   rB   )r   r%   r+   rL   rN   rO   rP   s          r   UpdateLabelsClient.UpdateLabels   s    88HDK$$22 $$$  	3 	)*I ##}}O
 }}$(MMoj!$$T\\288. 9 0M
 m$++HMMO<> >r   )r   r   r   r   r   )NNr   )	NNNNNNNNN)__name__
__module____qualname____firstlineno____doc__r   classmethodr   r#   r<   rU   __static_attributes__ r   r   r
   r
      sN    / G G
/ &*"%)!%Sj>r   r
   N)r[   
__future__r   r   r   googlecloudsdk.api_lib.dnsr   r   googlecloudsdk.corer   objectr
   r^   r   r   <module>rc      s*    6 &  ' 1 + #H>V H>r   