
                             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S	KJr  \R                  r\R                   r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      rg)zICommands for interacting with the Cloud NetApp Files Volume API resource.    )
list_pager)	constants)util)waiter)base)log)	resources)netapp_v1beta1_messagesc            	       Z   \ rS rSrSr\R                  R                  4S jr\	S 5       r
\	S 5       rS rSS jrS	 r                            SS
 jrS rS rS rS rS r                         SS jrS r SS\S\S\S\4S jjrS\S\S\4S jrSrg)VolumesClient"   zFWrapper for working with volumes in the Cloud NetApp Files API Client.c                    Xl         U R                   [        R                  R                  :X  a  [	        5       U l        g U R                   [        R                  R                  :X  a  [        5       U l        g U R                   [        R                  R                  :X  a  [        5       U l        g [        SR                  [        R                  U   5      5      e)Nz [{}] is not a valid API version.)release_trackr   ReleaseTrackALPHAAlphaVolumesAdapter_adapterBETABetaVolumesAdapterGAVolumesAdapter
ValueErrorformatr   VERSION_MAP)selfr   s     3lib/googlecloudsdk/api_lib/netapp/volumes/client.py__init__VolumesClient.__init__%   s    &T..444)+dm			t0055	5(*dm			t0033	3$&dm
,
3
3}-     c                 .    U R                   R                  $ N)r   clientr   s    r   r"   VolumesClient.client4   s    ==r   c                 .    U R                   R                  $ r!   )r   messagesr#   s    r   r&   VolumesClient.messages8   s    ==!!!r   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"   projects_locations_operationsr   Name)r   operation_refs     r   WaitForOperationVolumesClient.WaitForOperation<   sL     >>..KK55	
 	%,,]-?-?-AB r   Nc                 b   U R                   R                  US9nU R                  R                  R	                  U5      nUR
                   H(  n[        R                  " SR                  U5      5        M*     [        R                  " U R                  R                  U[        R                  USS9$ )aG  Make API calls to List active Cloud NetApp Volumes.

Args:
  location_ref: The parsed location of the listed NetApp Volumes.
  limit: The number of Cloud NetApp Volumes 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 Volumes.
)parentzLocation {} may be unreachable.pageSize)fieldlimitbatch_size_attribute)r&   )NetappProjectsLocationsVolumesListRequestr"   projects_locations_volumesListunreachabler   warningr   r   YieldFromListr   VOLUME_RESOURCE)r   location_refr4   requestresponselocations         r   ListVolumesVolumesClient.ListVolumesP   s     mmEE F G {{55::7CH((	kk3::8DE )##..''' r   c                 v   U R                   R                  UR                  5       R                  5       UR	                  5       US9nU R
                  R                  R                  U5      nU(       a  U$ [        R                  R                  UR                  [        R                  S9nU R                  U5      $ )zCreate a Cloud NetApp Volume.)r1   volumeIdvolume
collection)r&   +NetappProjectsLocationsVolumesCreateRequestParentRelativeNamer,   r"   r7   Creater	   REGISTRYParseRelativeNamenamer   OPERATIONS_COLLECTIONr.   )r   
volume_refasync_configr>   	create_opr-   s          r   CreateVolumeVolumesClient.CreateVolumej   s    mmGG  "//1" H G
 66==gFI&&889#B#B 9 M   //r   c                 j    U R                   R                  UUUUUUUUU	U
UUUUUUUUUUUUUUUUUUS9$ )zBParses the command line arguments for Create Volume into a config.)rN   capacitydescriptionstorage_pool	protocols
share_nameexport_policyunix_permissionssmb_settingssnapshot_policysnap_reservesnapshot_directorysecurity_styleenable_kerberossnapshotbackuprestricted_actionsbackup_configlarge_capacitymultiple_endpointstiering_policyhybrid_replication_parametersthroughput_mibpscache_parameterscache_pre_populatelabelsblock_deviceslarge_capacity_config)r   ParseVolumeConfig)r   rN   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   s                                r   rr   VolumesClient.ParseVolumeConfigy   su    @ ==**!#)!'!-%'-#%-%&C))-#39 +  r   c                     U R                   R                  UR                  5       S9nU R                  R                  R                  U5      $ )z$Get Cloud NetApp Volume information.)rN   )r&   (NetappProjectsLocationsVolumesGetRequestrJ   r"   r7   Get)r   rP   r>   s      r   	GetVolumeVolumesClient.GetVolume   sE    mmDD$$& E G ;;1155g>>r   c                 t    U R                   R                  UR                  5       US9nU R                  X$5      $ )z(Deletes an existing Cloud NetApp Volume.)rN   force)r&   +NetappProjectsLocationsVolumesDeleteRequestrJ   _DeleteVolume)r   rP   rQ   rz   r>   s        r   DeleteVolumeVolumesClient.DeleteVolume   s=    mmGG$$&e H G f..r   c                     U R                   R                  R                  U5      nU(       a  U$ [        R                  R                  UR                  [        R                  S9nU R                  U5      $ )NrF   )
r"   r7   Deleter	   rL   rM   rN   r   rO   r.   )r   rQ   r>   	delete_opr-   s        r   r|   VolumesClient._DeleteVolume   sb    66==gFI&&889#B#B 9 M   //r   c                 j   U R                   R                  UR                  5       U R                   R                  US9S9nU R                  R
                  R                  U5      nU(       a  U$ [        R                  R                  UR                  [        R                  S9nU R                  U5      $ )z(Reverts an existing Cloud NetApp Volume.)
snapshotId)rN   revertVolumeRequestrF   )r&   +NetappProjectsLocationsVolumesRevertRequestrJ   RevertVolumeRequestr"   r7   Revertr	   rL   rM   rN   r   rO   r.   )r   rP   snapshot_idrQ   r>   	revert_opr-   s          r   RevertVolumeVolumesClient.RevertVolume   s    mmGG$$& MM==" > 
 H G 66==gFI&&889#B#B 9 M   //r   c           	      n   U R                   R                  UR                  5       U R                   R                  UUUS9S9nU R                  R
                  R                  U5      nU(       a  U$ [        R                  R                  UR                  [        R                  S9nU R                  U5      $ )z2Restores specific files from a backup to a volume.)re   fileListrestoreDestinationPath)rN   restoreBackupFilesRequestrF   )r&   ,NetappProjectsLocationsVolumesRestoreRequestrJ   RestoreBackupFilesRequestr"   r7   Restorer	   rL   rM   rN   r   rO   r.   )	r   rP   re   	file_listrestore_destination_pathrQ   r>   
restore_opr-   s	            r   RestoreVolumeVolumesClient.RestoreVolume   s     mmHH$$&"&--"I"I#; #J #
 I G 77??HJ&&88I$C$C 9 M   //r   c                 f    U R                   R                  UUUUUUUUU	U
UUUUUUUUUUUUUUUUS9$ )z$Parses updates into a volume config.)rX   ro   rY   rZ   r[   r\   rW   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rm   rn   rl   rp   )r   ParseUpdatedVolumeConfig)r   volume_configrX   ro   rY   rZ   r[   r\   rW   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rm   rn   rl   rp   s                              r   r   &VolumesClient.ParseUpdatedVolumeConfig   sn    < ==11!#)!'!-%'-#%-%)-)#5 2  r   c                     U R                   R                  XU5      nU(       a  U$ [        R                  R	                  UR
                  [        R                  S9nU R                  U5      $ )a-  Updates a Cloud NetApp Volume.

Args:
  volume_ref: the reference to the Volume.
  volume_config: Volume config, the updated volume.
  update_mask: str, a comma-separated list of updated fields.
  async_: bool, if False, wait for the operation to complete.

Returns:
  an Operation or Volume message.
rF   )	r   UpdateVolumer	   rL   rM   rN   r   rO   r.   )r   rP   r   update_maskrQ   	update_opr-   s          r   r   VolumesClient.UpdateVolume/  se     **;I &&889#B#B 9 M   //r   peer_cluster_namepeer_svm_namepeer_volume_namereturnc                 P    U R                   R                  UUUU(       a  US9$ / S9$ )aF  Parses the command line arguments for EstablishPeering into a config.

Args:
  peer_cluster_name: The name of the peer cluster.
  peer_svm_name: The name of the peer SVM.
  peer_volume_name: The name of the peer volume.
  peer_ip_addresses: The list of peer IP addresses.

Returns:
  An EstablishVolumePeeringRequest message.
)peerClusterNamepeerSvmNamepeerVolumeNamepeerIpAddresses)r&   EstablishVolumePeeringRequest)r   r   r   r   peer_ip_addressess        r   (ParseEstablishVolumePeeringRequestConfig6VolumesClient.ParseEstablishVolumePeeringRequestConfigE  sE    $ ==66)!'->)	 7   EG	 7  r   rP   'establish_volume_peering_request_configrQ   c                 <   U R                   R                  UR                  5       US9nU R                  R                  R                  U5      nU(       a  U$ [        R                  R                  UR                  [        R                  S9nU R                  U5      $ )a[  Establish peering between GCNV volume and an onprem ONTAP volume.

Args:
  volume_ref: The reference to the volume.
  establish_volume_peering_request_config: The config for the peering
    request.
  async_: If true, the call will return immediately, otherwise wait for
    operation to complete.

Returns:
  An EstablishVolumePeering operation.
)rN   establishVolumePeeringRequestrF   )r&   5NetappProjectsLocationsVolumesEstablishPeeringRequestrJ   r"   r7   EstablishPeeringr	   rL   rM   rN   r   rO   r.   )r   rP   r   rQ   r>   establish_peering_opr-   s          r   r   VolumesClient.EstablishPeering^  s    $ mmQQ$$&&M R G
 	..??H  !!&&88!!i.M.M 9 M   //r   )r   r   r!   NNNNNNNNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNNN)__name__
__module____qualname____firstlineno____doc__r   r   r   r   propertyr"   r&   r.   rA   rT   rr   rw   r}   r|   r   r   r   r   strr   r   Volumeboolr   __static_attributes__ r   r   r   r   "   so   N#'#4#4#:#:      " "(40" $( ;=~?/00 00 79v06   	 %200 0M0 	0r   r   c                      \ rS rSrSrS rS rS rS rS r	S r
                            SS
 jr                          SS jrS rS rS r\R"                  R$                  4S jrS rS rSrg	)r   i  z7Adapter for the Cloud NetApp Files API Volume resource.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   VolumesAdapter.__init__  sF    **--D((t7I7IJDK**9K9KLDMr   c                    U(       d  gU R                   R                  5       nU GH6  nU R                   R                  5       nUR                  5        H  u  pgUS:X  a  Xul        M  US:X  a6  U R                   R                  R
                  R                  U5      Ul        MO  US:X  a  Xul        M]  US:X  a  Xul	        Mk  US:X  a  Xul
        My  US:X  a  Xul        M  US:X  a  Xul        M  US	:X  a  Xul        M  US
:X  a  Xul        M  US:X  a  Xul        M  US:X  a  Xul        M  US:X  a  Xul        M  US:X  d  M  Xul        M     UR&                  R)                  U5        GM9     X1l        g)zParses Export Policy for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object
  export_policy: the Export Policy message object.

Returns:
  Volume message populated with Export Policy values.
Nzallowed-clientszaccess-typezhas-root-accesszkerberos-5-read-onlyzkerberos-5-read-writezkerberos-5i-read-onlyzkerberos-5i-read-writezkerberos-5p-read-onlyzkerberos-5p-read-writenfsv3nfsv4zsquash-modezanon-uid)r&   ExportPolicySimpleExportPolicyRuleitemsallowedClientsAccessTypeValueValuesEnumlookup_by_name
accessTypehasRootAccesskerberos5ReadOnlykerberos5ReadWritekerberos5iReadOnlykerberos5iReadWritekerberos5pReadOnlykerberos5pReadWriter   r   
squashModeanonUidrulesappendexportPolicy)r   rE   r\   export_policy_configpolicysimple_export_policy_rulekeyvals           r   ParseExportPolicy VolumesAdapter.ParseExportPolicy  sR    ==557"&--"F"F"Hlln(# ##58
2M!mm22LL[[ $
.
 %%47
1**8;
5++9<
6++9<
6,,:=
7++9<
6,,:=
7G^,/
)G^,/
)M!14
.J.1
+C %D   ''(ABI  J /r   c                 ^   / Ul         Uc  gU H  nU R                  R                  5       nSU;   a
  US   Ul        UR	                  S/ 5       H  nUR
                  R                  U5        M      SU;   a
  US   Ul        SU;   a
  US   Ul        UR                   R                  U5        M     g)z.Parses Block Devices for Volume into a config.NrN   zhost-groupszos-typezsize-gib)	blockDevicesr&   BlockDevicerN   get
hostGroupsr   osTypesizeGib)r   rE   rp   block_device_argsblock_device_message
host_groups         r   ParseBlockDevices VolumesAdapter.ParseBlockDevices  s     F*!]]668	$	$$5f$=!)--mR@*''..z: A	'	'&7	&B#	(	('8'D$  !56 +r   c                 H    / nU H  nUR                  U5        M     X1l        g)zParses Protocols from a list of Protocol Enums into the given volume.

Args:
  volume: The Cloud NetApp Volume message object
  protocols: A list of protocol enums

Returns:
  Volume message populated with protocol values.
N)r   rZ   )r   rE   rZ   protocols_configprotocols        r   ParseProtocolsVolumesAdapter.ParseProtocols  s(     h' 'r   c                    U(       d  gU R                   R                  5       Ul        SUR                  l        UR	                  5        GH  u  p4US:X  aY  U R                   R                  5       nUR                  S5      Ul        UR                  SS5      Ul        XQR                  l	        Me  US:X  ap  U R                   R                  5       nUR                  S5      Ul        UR                  SS5      Ul        UR                  SS5      Ul        XQR                  l        M  US	:X  a  U R                   R                  5       nUR                  S5      Ul        UR                  SS5      Ul        UR                  SS5      Ul        UR                  S
S5      Ul        XQR                  l        GMi  US:X  d  GMr  U R                   R!                  5       nUR                  S5      Ul        UR                  SS5      Ul        UR                  SS5      Ul        UR                  S
S5      Ul        XQR                  l        GM     g)a
  Parses Snapshot Policy from a list of snapshot schedules into a given Volume.

Args:
  volume: The Cloud NetApp Volume message object
  snapshot_policy: A list of snapshot policies (schedules) to parse

Returns:
  Volume messages populated with snapshotPolicy field
NThourly_snapshotzsnapshots-to-keepminuter   daily_snapshothourweekly_snapshotdaySundayzmonthly-snapshot   )r&   SnapshotPolicysnapshotPolicyenabledr   HourlyScheduler   snapshotsToKeepr   hourlyScheduleDailyScheduler   dailyScheduleWeeklyScheduler   weeklyScheduleMonthlySchedulemonthlySchedule)r   rE   r_   rN   snapshot_scheduleschedules         r   ParseSnapshotPolicy"VolumesAdapter.ParseSnapshotPolicy  s     MM88:F$(F!#2#8#8#:	"	"==//1#4#8#89L#M +//!</7,##==..0#4#8#89L#M +//!<)--fa8.6+$$==//1#4#8#89L#M +//!<)--fa8(,,UH=/7,%%==002#4#8#89L#M +//!<)--fa8(,,UA608-3 $;r   c                     U R                   R                  UUR                  5       US9nU R                  R                  R                  U5      nU$ )z1Send a Patch request for the Cloud NetApp Volume.)rE   rN   
updateMask)r&   *NetappProjectsLocationsVolumesPatchRequestrJ   r"   r7   Patch)r   rP   r   r   update_requestr   s         r   r   VolumesAdapter.UpdateVolume  sP    ]]MM$$& N N
 66<<^LIr   Nc                    U R                   R                  5       nUUl        UUl        UUl        UUl        UUl        UUl        U R                  UU5        U R                  UU5        UUl
        U	Ul        U R                  UU
5        UUl        UUl        UUl        UUl        U R                   R#                  5       nUb  UUl        Ub  UUl        Uc  Uc  SnUUl        UUl        UUl        Ub  U R/                  UU5        Ub  UUl        Ub  UUl        Ub  U R5                  UU5        Ub  U R7                  UUU R8                  5        Ub  U R;                  UU5        Ub  U R=                  UU5        Ub  U R?                  UU5        Ub1  U R                   RA                  5       nSU;   a
  US   Ul!        UUl"        U$ )a  Parses the command line arguments for Create Volume into a config.

Args:
  name: the name of the Volume
  capacity: the storage capacity of the Volume.
  description: the description of the Volume.
  storage_pool: the Storage Pool the Volume is attached to.
  protocols: the type of fileshare protocol of the Volume.
  share_name: the share name or mount point of the Volume.
  export_policy: the export policy of the Volume if NFS.
  unix_permissions: the Unix permissions for the Volume.
  smb_settings: the SMB settings for the Volume.
  snapshot_policy: the Snapshot Policy for the Volume
  snap_reserve: the snap reserve (double) for the Volume
  snapshot_directory: Bool on whether to use snapshot directory for Volume
  security_style: the security style of the Volume
  enable_kerberos: Bool on whether to use kerberos for Volume
  snapshot: the snapshot name to create Volume from
  backup: the backup to create the Volume from.
  restricted_actions: the actions to be restricted on a Volume
  backup_config: the Backup Config attached to the Volume
  large_capacity: Bool on whether to use large capacity for Volume
  multiple_endpoints: Bool on whether to use multiple endpoints for Volume
  tiering_policy: the tiering policy for the volume.
  hybrid_replication_parameters: the hybrid replication parameters for the
    volume.
  throughput_mibps: throughput of the Volume (in MiB/s).
  cache_parameters: the cache parameters for the volume.
  cache_pre_populate: the cache pre-populate parameters for the volume.
  labels: the parsed labels value.
  block_devices: the block devices for the volume.
  large_capacity_config: The large capacity config for the volume.

Returns:
  the configuration that will be used as the request body for creating a
  Cloud NetApp Files Volume.
Nzconstituent-count)#r&   r   rN   capacityGibrX   ro   storagePool	shareNamer   r   unixPermissionssmbSettingsr  snapReservesnapshotDirectorysecurityStylekerberosEnabledRestoreParameterssourceSnapshotsourceBackuprestoreParametersrestrictedActionsthroughputMibpsParseBackupConfiglargeCapacitymultipleEndpointsParseTieringPolicy ParseHybridReplicationParametersr   r   ParseCacheParametersParseCachePrePopulateLargeCapacityConfigconstituentCountlargeCapacityConfig) r   rN   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rE   restore_parameterslarge_capacity_config_messages                                    r   rr    VolumesAdapter.ParseVolumeConfig  s   H ]]!!#FFK!F$FFM%F!F6=1	*-F%FV_5%F1F)F,F88:*2'(.%~(*1F1F-F 
V]3!+f%!3f!
fn5$0
++
/1C1C  
V]3#
(89%
  );<(&*mm&G&G&I#	 5	59N:
%6 $Af Mr   c                    Ub  X!l         Ub  X1l        Ub  Xl        Ub  XAl        Ub  U R	                  X5        Ub  Xal        Ub  U R                  X5        U	b  Xl        U
b  Xl        Ub  U R                  X5        Ub  Xl
        Ub  Xl        Ub  Xl        Ub  Xl        Ub  UUl        Uc  Ub  U R                  UUU5        Ub  UUl        Ub  U R#                  UU5        Ub  UUl        Ub  UUl        Ub  U R)                  UU5        Ub  U R+                  UU5        Ub  U R-                  UU5        Ub  UUl        Ub  U R1                  UU5        U$ )z8Parse update information into an updated Volume message.)rX   ro   r  r  r   r  r   r  r  r  r  r  r  r  activeDirectoryParseRestoreParametersr#  r%  r&  r'  r(  r*  r+  r$  r   )r   r   rX   ro   rY   rZ   r[   r\   rW   r]   r^   r_   r`   ra   rb   rc   active_directoryrd   re   rf   rg   rh   ri   rj   rm   rn   rl   rp   s                               r   r   'VolumesAdapter.ParseUpdatedVolumeConfig  s   > "-#"*".
-3 * 
]:#&6#"."
}>".%(:%!$2!"&5##&6m#v1
!!-6B%(:m% 
]M:!$2m!%(:m%!
m^<#
/?@%
  0BC#&6m# 
]M:r   c                    U R                   R                  5       nUR                  S/ 5       H  nUR                  R	                  U5        M      UR                  SS5      Ul        UR                  SS5      Ul        X1l        g)zParses Backup Config for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object.
  backup_config: the Backup Config message object.

Returns:
  Volume message populated with Backup Config values.
zbackup-policieszbackup-vault zenable-scheduled-backupsN)r&   BackupConfigr   backupPoliciesr   backupVaultscheduledBackupEnabledbackupConfig)r   rE   rg   backup_config_messagebackup_policys        r   r%   VolumesAdapter.ParseBackupConfig  s{     !MM668&**+<bA**11-@ B(5(9(9."(M%3@3D3D"D40 0r   c                 x    U R                   R                  5       nU(       a  X$l        U(       a  X4l        XAl        g)z3Parses Restore Parameters for Volume into a config.N)r&   r  r   r!  r"  )r   rE   rd   re   r/  s        r   r4  %VolumesAdapter.ParseRestoreParameters  s-    88:*2'(.%1r   c                 h   U R                   R                  5       nUR                  S5      Ul        UR                  S5      Ul        U R
                  [        R                  R                  :X  d(  U R
                  [        R                  R                  :X  a  UR                  S5      Ul
        X1l        g)zParses Tiering Policy for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object.
  tiering_policy: the tiering policy message object.

Returns:
  Volume message populated with Tiering Policy values.
ztier-actionzcooling-threshold-dayszenable-hot-tier-bypass-modeN)r&   TieringPolicyr   
tierActioncoolingThresholdDaysr   r   r   r   r   hotTierBypassModeEnabledtieringPolicy)r   rE   rj   tiering_policy_messages       r   r(  !VolumesAdapter.ParseTieringPolicy  s     "]]88:(6(:(:=(I%2@2D2D 3/ 	d//444!2!2!8!888F8J8J
'95 2r   c                 v   AU R                   R                  5       nUR                  S5      Ul        UR                  S5      Ul        UR                  S5      Ul        UR                  S5      Ul        UR                  S/ 5       H  nUR                  R                  U5        M      UR                  S5      Ul	        UR                  S5      Ul
        U R                   R                  R                  UR                  S/ 5       Vs/ s HU  nU R                   R                  R                  R                  UR                  S	5      S
   UR                  S	5      S   S9PMW     snS9Ul        UR                  S5      Ul        UR                  S5      Ul        UR                  S5      Ul        XAl        gs  snf )aF  Parses Hybrid Replication Parameters for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object.
  hybrid_replication_parameters: The hybrid replication params message
    object.
  release_track: The release track of the command.

Returns:
  Volume message populated with Hybrid Replication Parameters
replicationpeer-volume-namepeer-cluster-namepeer-svm-namepeer-ip-addresseszcluster-locationrX   ro   :r   r   )r   value)additionalPropertieszreplication-schedulezhybrid-replication-typezlarge-volume-constituent-countN)r&   HybridReplicationParametersr   rL  r   r   r   r   r   clusterLocationrX   LabelsValueAdditionalPropertysplitro   replicationSchedulehybridReplicationTypelargeVolumeConstituentCounthybridReplicationParameters)r   rE   rk   r   %hybrid_replication_parameters_message
ip_addresskey_value_pairs          r   r)  /VolumesAdapter.ParseHybridReplicationParameters  s   " 	113 * 	&))-8 *5 	&))*<= *8 	&))*=> *9 	&))/: *5 477R
 ,;;BB:N
 	&))*<= *9 	&))-8 *5 48==3\3\3h3h #@"C"C"#

#	 MM55AATT"((-a0$**3/2 U #
 4i 
4)0 	&))*@A *= 	&))*CD *? 	&))*JK *E *O&)
s   AF6c                 V   U R                   R                  5       nUR                  S5      Ul        UR                  S5      Ul        UR                  S5      Ul        UR                  S/ 5       H  nUR                  R                  U5        M      UR                  S5      Ul        U R                   R                  5       nUR                  S/ 5       HG  nSU;   a  US   R                  5       S:H  Ul        S	U;   d  M,  US	   R                  5       S:H  Ul        MI     XSl        X1l        g
)zParses Cache Parameters for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object.
  cache_parameters: The cache params message object.

Returns:
  Volume message populated with Cache Parameters
rM  rN  rO  rP  zenable-global-file-lockzcache-configzcifs-change-notify-enabledtruezwrite-back-enabledN)r&   CacheParametersr   r   r   r   r   r   enableGlobalFileLockCacheConfiglowercifsChangeNotifyEnabledwritebackEnabledcacheConfigcacheParameters)r   rE   rm   cache_parameters_messager^  cache_config_messagerR   s          r   r*  #VolumesAdapter.ParseCacheParametersR  s-     $}}<<>.>.B.B/+ 0@/C/C0, ,<+?+?+P(&**+>C
..55jA D4D4H4H!51  ==446"&&~r:	%	//0668FB 	4 
	''(..0F: 	- ; ,@(5r   c                 B   U R                   R                  5       nUR                  S/ 5       H  nUR                  R	                  U5        M      UR                  S/ 5       H  nUR
                  R	                  U5        M      UR                  S5      Ul        UR                  c  U R                   R                  5       Ul        UR                  R                  c)  U R                   R                  5       UR                  l	        UUR                  R                  l        g)zParses Cache Pre-populate for Volume into a config.

Args:
  volume: The Cloud NetApp Volume message object.
  cache_pre_populate: The cache pre-populate params message object.

Returns:
  Volume message populated with Cache Pre-populate Parameters
z	path-listzexclude-path-list	recursionN)r&   CachePrePopulater   pathListr   excludePathListro  rj  rc  ri  re  cachePrePopulate)r   rE   rn   cache_pre_populate_messagepaths        r   r+  $VolumesAdapter.ParseCachePrePopulatev  s     "&!?!?!A"&&{B7 ))006 8"&&':B? 0077= @+=+A+A,( %#}}<<>f))1+/==+D+D+Ff(" &&7r   r"   r&   r   r   )NNNNNNNNNNNNNNNNNNNNNNNNNN)r   r   r   r   r   r   r   r   r   r  r   rr   r   r%  r4  r(  r   r   r   r)  r*  r+  r   r   r   r   r   r     s   ?M
2/h7$('9R $( ;wx 9Qf0(228 %%((	@OD"6Hr   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   i  z<Adapter for the Beta Cloud NetApp Files API Volume resource.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"   r   r&   r   	__class__s    r   r   BetaVolumesAdapter.__init__  sU    	
d,.**//D((t7I7IJDK**9K9KLDMr   rw  r   r   r   r   r   r   r   __classcell__r|  s   @r   r   r     s    DM Mr   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   i  z=Adapter for the Alpha Cloud NetApp Files API Volume resource.c                    > [         [        U ]  5         [        R                  R
                  U l        [        R                  " U R                  S9U l	        [        R                  " U R                  S9U l        g r   )rz  r   r   r   r   r   r   r   r   r"   r   r&   r{  s    r   r   AlphaVolumesAdapter.__init__  sU    	
t-/**00D((t7I7IJDK**9K9KLDMr   rw  r~  r  s   @r   r   r     s    EM Mr   r   N)r   apitools.base.pyr   googlecloudsdk.api_lib.netappr   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.corer   r	   4googlecloudsdk.generated_clients.apis.netapp.v1beta1r
   r   r   objectr   r   r   r   r   r   r   <module>r     s}    P ( 3 . . ( # ) X 99  
!	'	'Z0F Z0z
OV OdM MM, Mr   