
    B                         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	\
R                  5      rSS jr " S S\5      rg
)z,API client library for Cloud DNS operatoins.    )absolute_import)division)unicode_literals)
list_pager)util)waiterc                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
Poller   zhManages a longrunning Operations.

See https://cloud.google.com/speech/reference/rpc/google.longrunning
c                     Xl         X l        g)zSets up poller for dns operations.

Args:
  operations_client: Client, client for retrieving information about
      ongoing operation.
  api_version: Cloud DNS api version this poller should use.
N)operations_clientapi_version)selfr   r   s      ,lib/googlecloudsdk/api_lib/dns/operations.py__init__Poller.__init__!   s     /"    c                 6   U R                   S:X  d  U R                   S:X  a4  U R                  R                  R                  R                  R
                  O3U R                  R                  R                  R                  R                  nUR                  U:X  a  gg)z
Overrides.v2devTF)r   r   messages	OperationStatusValueValuesEnumDONEdonestatus)r   	operation	done_enums      r   IsDonePoller.IsDone,   s~     t#t'7'75'@ 	''11GGLL##,,66LLQQ 
 9$r   c                 8    U R                   R                  U5      $ )zrOverrides.

Args:
  operation_ref: googlecloudsdk.core.resources.Resource.

Returns:
  fetched operation message.
)r   Get)r   operation_refs     r   PollPoller.Poll7   s     !!%%m44r   c                 .    UR                   R                  $ )znOverrides.

Args:
  operation: api_name_messages.Operation.

Returns:
  result of result_service.Get request.
)zoneContextnewValue)r   r   s     r   	GetResultPoller.GetResultB   s       )))r   )r   r   N)v1)
__name__
__module____qualname____firstlineno____doc__r   r   r$   r)   __static_attributes__ r   r   r
   r
      s    
	#		5	*r   r
   Nc                 n    [        [        R                  X5      U 5      n[        R                  " XAU5      $ N)r
   ClientFromApiVersionr   WaitFor)versionr#   messagelocationoperation_pollers        r   r7   r7   N   s,    F11'DgN	(	AAr   c                   J    \ rS rSrSrSrS
S jr\SS j5       rS r	SS jr
S	rg)r5   S   z$API client for Cloud DNS operations.dnsNc                     Xl         X l        U R                  R                  U l        U=(       d    UR                  U l        X@l        g r4   )r8   clientmanagedZoneOperations_serviceMESSAGES_MODULEr   r:   )r   r8   r@   r   r:   s        r   r   Client.__init__X   s4    LKKK55DM6 6 6DMMr   c                 <    U " U[         R                  " U5      S US9$ )N)r   r:   )r   GetApiClient)clsr8   r:   s      r   r6   Client.FromApiVersion_   s%    ""7+dXO Or   c                     U R                   R                  UR                  5       UR                  UR                  S9nU R
                  (       a  U R
                  Ul        U R                  R                  U5      $ )N)r   managedZoneproject)r   "DnsManagedZoneOperationsGetRequestNamerJ   rK   r:   rB   r"   )r   r#   requests      r   r"   
Client.Getd   sc    mm>>$$&!--%% ? 'G }}g==W%%r   c                     U R                   R                  UR                  5       UR                  S9nU R                  (       a  U R                  Ul        [
        R                  " U R                  X2SS9$ )N)rJ   rK   
operations)limitfield)r   #DnsManagedZoneOperationsListRequestrM   rK   r:   r   YieldFromListrB   )r   zone_refrR   rN   s       r   ListClient.Listm   sc    mm??MMO   @ "G }}g##w<A Ar   )rB   r@   r:   r   r8   )NNr4   )r,   r-   r.   r/   r0   	_API_NAMEr   classmethodr6   r"   rW   r1   r2   r   r   r5   r5   S   s0    ,) O O&Ar   r5   r4   )r0   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.dnsr   googlecloudsdk.api_lib.utilr   OperationPollerr
   r7   objectr5   r2   r   r   <module>ra      sC    3 &  ' ' + .0*V## 0*fB
!AV !Ar   