
                             S 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.    )
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.messages-   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.GetOperation1   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   r.   s     r   WaitForOperationNetAppClient.WaitForOperation>   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+   Cancelr-   s      r   CancelOperationNetAppClient.CancelOperationO   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_refr/   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    r?   )r   project_refrH   r/   s       r   ListLocationsNetAppClient.ListLocations`   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'   
operationsrE   rF   )r$   ,NetappProjectsLocationsOperationsListRequestr   rK   r    r+   )r   r@   rH   r/   s       r   ListOperationsNetAppClient.ListOperationsj   sM     mmHH I G##11') )r   )r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   propertyr    r$   r0   r6   r;   rA   rM   rR   __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)rT   rU   rV   rW   rX   r   rZ   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 r_   )superr   r   r   r   r   r   r   r`   r    ra   r$   r   	__class__s    r   r   BetaNetappAdapter.__init__   s]    	
T+-**//D((((DK **((DMr   rc   rT   rU   rV   rW   rX   r   rZ   __classcell__ri   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 r_   )rg   r   r   r   r   r   r   r   r`   r    ra   r$   rh   s    r   r   AlphaNetappAdapter.__init__   s]    	
d,.**00D((((DK **((DMr   rc   rk   rm   s   @r   r   r      s    5 r   r   N)rX   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>ry      sX    G ( . . ( a)6 a)H
F 
 * r   