
    K                         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KJr  S	rS
r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)z@Useful commands for interacting with the Cloud NetApp Files API.    )absolute_import)division)unicode_literals)
list_pager)util)waiter)basenetappv1alpha1c                       \ rS rSrSr\R                  R                  4S jr\	S 5       r
\	S 5       rS rS rS rS	 rSS jrSS jrSrg
)NetAppClient   z;Wrapper for working with the Cloud NetApp Files API Client.c                 l   U[         R                  R                  :X  a  [        5       U l        g U[         R                  R
                  :X  a  [        5       U l        g U[         R                  R                  :X  a  [        5       U l        g [        SR                  [        R                  U   5      5      e)Nz [{}] is not a valid API version.)r	   ReleaseTrackALPHAAlphaNetappAdapter_adapterBETABetaNetappAdapterGANetappAdapter
ValueErrorformatr   VERSION_MAP)selfrelease_tracks     2lib/googlecloudsdk/api_lib/netapp/netapp_client.py__init__NetAppClient.__init__!   s    ))///(*dm	$++00	0')dm	$++..	.#odm9@@


=
)+ , ,    c                 .    U R                   R                  $ N)r   clientr   s    r   r#   NetAppClient.client,   s    ==r    c                 .    U R                   R                  $ r"   )r   messagesr$   s    r   r'   NetAppClient.messages0   s    ==!!!r    c                     U R                   R                  UR                  5       S9nU R                  R                  R                  U5      $ )zGets description of a long-running operation.

Args:
  operation_ref: the operation reference.

Returns:
  messages.GoogleLongrunningOperation, the operation.
name)r'   +NetappProjectsLocationsOperationsGetRequestRelativeNamer#   projects_locations_operationsGetr   operation_refrequests      r   GetOperationNetAppClient.GetOperation4   sE     mmGG'') H +G;;4488AAr    c                     [         R                  " [         R                  " U R                  R                  5      USR                  UR                  5       5      5      $ )zWaits on the long-running operation until the done field is True.

Args:
  operation_ref: the operation reference.

Raises:
  waiter.OperationError: if the operation contains an error.

Returns:
  the 'response' field of the Operation.
zWaiting for [{0}] to finish)r   WaitForCloudOperationPollerNoResourcesr#   r.   r   Name)r   r1   s     r   WaitForOperationNetAppClient.WaitForOperationA   sL     >>..KK55	78E%,,]-?-?-ABD Dr    c                     U R                   R                  UR                  5       S9nU R                  R                  R                  U5      $ )zwCancels a long-running operation.

Args:
  operation_ref: the operation reference.

Returns:
  Empty response message.
r*   )r'   .NetappProjectsLocationsOperationsCancelRequestr-   r#   r.   Cancelr0   s      r   CancelOperationNetAppClient.CancelOperationR   sE     mmJJ'') K +G;;44;;GDDr    c                 ~    U R                   R                  US9nU R                  R                  R	                  U5      $ )Nr*   )r'   !NetappProjectsLocationsGetRequestr#   projects_locationsr/   )r   location_refr2   s      r   GetLocationNetAppClient.GetLocation_   s4    mm==<=PG;;))--g66r    Nc                     U R                   R                  UR                  5       S9n[        R                  " U R
                  R                  USUSS9$ )Nr*   	locationspageSizefieldlimitbatch_size_attribute)r'   "NetappProjectsLocationsListRequestr-   r   YieldFromListr#   rB   )r   project_refrK   r2   s       r   ListLocationsNetAppClient.ListLocationsc   sS    mm>>%%' ? )G##&&') )r    c                     U R                   R                  US9n[        R                  " U R                  R
                  USUSS9$ )aP  Make API calls to List active Cloud NetApp operations.

Args:
  location_ref: The parsed location of the listed NetApp resources.
  limit: The number of Cloud NetApp resources to limit the results to. This
    limit is passed to the server and the server does the limiting.

Returns:
  Generator that yields the Cloud NetApp resources.
r*   
operationsrH   rI   )r'   ,NetappProjectsLocationsOperationsListRequestr   rN   r#   r.   )r   rC   rK   r2   s       r   ListOperationsNetAppClient.ListOperationsm   sM     mmHH I G##11') )r    )r   r"   )__name__
__module____qualname____firstlineno____doc__r	   r   r   r   propertyr#   r'   r3   r9   r>   rD   rP   rU   __static_attributes__ r    r   r   r      sb    C#'#4#4#:#: 	,     " "BD"E7))r    r   c                       \ rS rSrSrS rSrg)r      z*Adapter for the Cloud NetApp Files v1 API.c                     [         R                  R                  U l        [        R
                  " U R                  S9U l        [        R                  " U R                  S9U l        g N)r   )	r	   r   r   r   r   GetClientInstancer#   GetMessagesModuler'   r$   s    r   r   NetappAdapter.__init__   sN    **--D((((DK **((DMr    r#   r'   r   N)rW   rX   rY   rZ   r[   r   r]   r^   r    r   r   r      s
    2r    r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      z,Adapter for the Beta Cloud NetApp Files API.c                    > [         [        U ]  5         [        R                  R
                  U l        [        R                  " U R                  S9U l	        [        R                  " U R                  S9U l        g rb   )superr   r   r	   r   r   r   r   rc   r#   rd   r'   r   	__class__s    r   r   BetaNetappAdapter.__init__   s]    	
T+-**//D((((DK **((DMr    rf   rW   rX   rY   rZ   r[   r   r]   __classcell__rl   s   @r   r   r      s    4 r    r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      z-Adapter for the Alpha Cloud NetApp Files API.c                    > [         [        U ]  5         [        R                  R
                  U l        [        R                  " U R                  S9U l	        [        R                  " U R                  S9U l        g rb   )rj   r   r   r	   r   r   r   r   rc   r#   rd   r'   rk   s    r   r   AlphaNetappAdapter.__init__   s]    	
d,.**00D((((DK **((DMr    rf   rn   rp   s   @r   r   r      s    5 r    r   N)r[   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.netappr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   API_NAMEALPHA_API_VERSIONobjectr   r   r   r   r^   r    r   <module>r}      s_    G &  ' ' . . ( a)6 a)H
F 
 * r    