
    U                     J    S r SSKJr  SSKJr   " S S\R
                  5      rg)Cloud vmware datastores client.    )
list_pager)utilc                   b   ^  \ rS rSrSrU 4S jrS rS rS
S jrS
S jr	      SS jr
S	rU =r$ )DatastoresClient   r   c                 `   > [         [        U ]  5         U R                  R                  U l        g N)superr   __init__clientprojects_locations_datastoresservice)self	__class__s    /lib/googlecloudsdk/api_lib/vmware/datastores.pyr   DatastoresClient.__init__   s"    	
D*,;;<<DL    c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )zGets a datastore.)name)messages1VmwareengineProjectsLocationsDatastoresGetRequestRelativeNamer   Get)r   resourcerequests      r   r   DatastoresClient.Get   s?    mmMM""$ N G <<G$$r   c                     UR                  5       nU R                  R                  US9n[        R                  " U R
                  USSS9$ )z%Lists datastores in a given location.)parentpageSize
datastores)batch_size_attributefield)r   r   2VmwareengineProjectsLocationsDatastoresListRequestr   YieldFromListr   )r   location_resourcelocationr   s       r   ListDatastoresClient.List$   sR     --/HmmNN O G ##'	 r   c                     U R                   R                  UR                  5       US9nU R                  R	                  U5      $ )N)r   etag)r   4VmwareengineProjectsLocationsDatastoresDeleteRequestr   r   Delete)r   r   r+   r   s       r   r-   DatastoresClient.Delete1   sD    JJ&&(t 	K 	
 
 <<w''r   c                    U R                  U5      n/ nUb  X#l        UR                  S5        U R                  R	                  UUR                  5       SR                  U5      S9nU R                  R                  U5      $ )Ndescription,)	datastorer   
updateMask)	r   r0   appendr   3VmwareengineProjectsLocationsDatastoresPatchRequestr   joinr   Patch)r   r   r0   r2   update_maskr   s         r   UpdateDatastoresClient.Update9   s{    "IK)'mmOO""$88K( P G
 <<g&&r   c                 V   UR                  5       R                  5       nUR                  5       n	U R                  R	                  US9n
U R                  R                  5       nU(       a  U R                  R                  US9Ul        OgU(       a  U R                  R                  US9Ul        OAU(       a:  U R                  R                  UUSR                  UR                  U5      S9Ul        Xl        U R                  R                  UU	U
S9nU R                  R                  U5      $ )zCreates a datastore.)r0   )netappVolume)filestoreInstancezprojects/{}/global/networks/{})servers	fileSharenetwork)r   datastoreIdr2   )Parentr   Namer   	DatastoreNfsDatastoreGoogleFileServicegoogleFileServiceThirdPartyFileServiceformat
projectsIdthirdPartyFileServicenfsDatastore4VmwareengineProjectsLocationsDatastoresCreateRequestr   Create)r   r   r0   netapp_volumefilestore_instancethird_party_nfs_networkthird_party_nfs_file_sharethird_party_nfs_serversr   datastore_idr2   nfs_datastorer   s                r   rN   DatastoresClient.CreateF   s    __++-F==?L''K'@IMM..0M(,(G(G$ )H )m% 
(,(G(G. )H )m% 
!,0MM,O,O).299!!#: -P -m) +JJ$ 	K 	
  <<w''r   )r   r
   )NNNNNN)__name__
__module____qualname____firstlineno____doc__r   r   r(   r-   r9   rN   __static_attributes____classcell__)r   s   @r   r   r      s=    '=%('  "!%"'( '(r   r   N)r[   apitools.base.pyr   googlecloudsdk.api_lib.vmwarer   VmwareClientBaser    r   r   <module>rb      s&    & ( .W(t,, W(r   