
    	                     H   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ e
j                  j                  Ze
j                  j                  d
e
j                  j"                  de
j                  j$                  diZee   Z G d de      Zd Zd Zy)z<Common utility functions for getting the alloydb API client.    )absolute_import)division)unicode_literals)
list_pager)apis)base)log)	resourcesv1alphav1betav1c                       e Zd ZdZd Zy)AlloyDBClientz8Wrapper for alloydb API client and associated resources.c                     t         |   }|| _        t        j                  d|      | _        | j                  j
                  | _        t        j                         | _	        | j                  j                  d|       y )Nalloydb)VERSION_MAPrelease_trackr   GetClientInstancealloydb_clientMESSAGES_MODULEalloydb_messagesr
   Registryresource_parserRegisterApiByName)selfr   api_versions      .lib/googlecloudsdk/api_lib/alloydb/api_util.py__init__zAlloyDBClient.__init__(   sd    m,K&D00KHD //??D$--/D**9kB    N)__name__
__module____qualname____doc__r    r   r   r   r   %   s    @Cr   r   c                 @    t         |    }t        j                  d|      S )z-Returns the message module for release track.r   )r   r   GetMessagesModule)r   r   s     r   r&   r&   1   s    M*+				;	77r   c               /      K   t               fd}t        j                  | d|i|}|D ]  }|  r/t        j                  ddj                  t                           yyw)z2Yields from paged List calls handling unreachable.c                 R    j                  | j                         t        | |      S )N)updateunreachablegetattr)messageattrr*   s     r   _GetFieldFnz5YieldFromListHandlingUnreachable.<locals>._GetFieldFn;   s$    w**+7D!!r   get_field_funcz,The following locations were unreachable: %sz, N)setr   YieldFromListr	   warningjoinsorted)argskwargsr.   resultitemr*   s        @r    YieldFromListHandlingUnreachabler9   7   sf     +" ##P;PP&d
J KK6		&%& s   A$A'N)r#   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   ReleaseTrackALPHADEFAULT_RELEASE_TRACKBETAGAr   API_VERSION_DEFAULTobjectr   r&   r9   r$   r   r   <module>rF      s    C &  ' ' , ( # ) ))// YH$
 ""78 	CF 	C8r   