
    !                        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  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.    )absolute_import)division)unicode_literals)
list_pager)	constants)util)waiter)base)log)	resources)netapp_v1beta1_messagesc            	       T   \ 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.client7   s    ==r"   c                 .    U R                   R                  $ r$   )r   messagesr&   s    r   r)   VolumesClient.messages;   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_refr7   requestresponselocations         r   ListVolumesVolumesClient.ListVolumesS   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.)r4   volumeIdvolume
collection)r)   +NetappProjectsLocationsVolumesCreateRequestParentRelativeNamer/   r%   r:   Creater   REGISTRYParseRelativeNamenamer   OPERATIONS_COLLECTIONr1   )r   
volume_refasync_configrA   	create_opr0   s          r   CreateVolumeVolumesClient.CreateVolumem   s    mmGG  "//1" H G
 66==gFI&&889#B#B 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$ )zBParses the command line arguments for Create Volume into a config.)rQ   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labelsblock_devices)r   ParseVolumeConfig)r   rQ   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   s                              r   rs   VolumesClient.ParseVolumeConfig|   sn    < ==**!#)!'!-%'-#%-%&C))#5 +  r"   c                     U R                   R                  UR                  5       S9nU R                  R                  R                  U5      $ )z$Get Cloud NetApp Volume information.)rQ   )r)   (NetappProjectsLocationsVolumesGetRequestrM   r%   r:   Get)r   rS   rA   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.)rQ   force)r)   +NetappProjectsLocationsVolumesDeleteRequestrM   _DeleteVolume)r   rS   rT   r{   rA   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      $ )NrI   )
r%   r:   Deleter   rO   rP   rQ   r   rR   r1   )r   rT   rA   	delete_opr0   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)rQ   revertVolumeRequestrI   )r)   +NetappProjectsLocationsVolumesRevertRequestrM   RevertVolumeRequestr%   r:   Revertr   rO   rP   rQ   r   rR   r1   )r   rS   snapshot_idrT   rA   	revert_opr0   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.)rh   fileListrestoreDestinationPath)rQ   restoreBackupFilesRequestrI   )r)   ,NetappProjectsLocationsVolumesRestoreRequestrM   RestoreBackupFilesRequestr%   r:   Restorer   rO   rP   rQ   r   rR   r1   )	r   rS   rh   	file_listrestore_destination_pathrT   rA   
restore_opr0   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                 d    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S9$ )z$Parses updates into a volume config.)r[   rq   r\   r]   r^   r_   rZ   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rp   ro   rr   )r   ParseUpdatedVolumeConfig)r   volume_configr[   rq   r\   r]   r^   r_   rZ   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rp   ro   rr   s                             r   r   &VolumesClient.ParseUpdatedVolumeConfig   sk    : ==11!#)!'!-%'-#%-%))#3 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.
rI   )	r   UpdateVolumer   rO   rP   rQ   r   rR   r1   )r   rS   r   update_maskrT   	update_opr0   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.ParseEstablishVolumePeeringRequestConfigB  sE    $ ==66)!'->)	 7   EG	 7  r"   rS   'establish_volume_peering_request_configrT   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.
)rQ   establishVolumePeeringRequestrI   )r)   5NetappProjectsLocationsVolumesEstablishPeeringRequestrM   r%   r:   EstablishPeeringr   rO   rP   rQ   r   rR   r1   )r   rS   r   rT   rA   establish_peering_opr0   s          r   r   VolumesClient.EstablishPeering[  s    $ mmQQ$$&&M R G
 	..??H  !!&&88!!i.M.M 9 M   //r"   )r   r   r$   NNNNNNNNNNNNNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNN)__name__
__module____qualname____firstlineno____doc__r
   r   r   r    propertyr%   r)   r1   rD   rW   rs   rx   r~   r}   r   r   r   r   strr   r   Volumeboolr   __static_attributes__ r"   r   r   r   %   sf   N#'#4#4#:#:      " "(40" $(79v?/00 00 57r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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                 n   U(       d  gU R                   R                  5       nU GH  nU R                   R                  5       nUR                  5        H  u  pgUS:X  a  Xul        US:X  a4  U R                   R                  R
                  R                  U5      Ul        US:X  a  Xul        US:X  a  Xul	        US:X  a  Xul
        US:X  a  Xul        US:X  a  Xul        US	:X  a  Xul        US
:X  a  Xul        US:X  a  Xul        US:X  d  M  Xul        M     UR"                  R%                  U5        GM	     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nfsv4)r)   ExportPolicySimpleExportPolicyRuleitemsallowedClientsAccessTypeValueValuesEnumlookup_by_name
accessTypehasRootAccesskerberos5ReadOnlykerberos5ReadWritekerberos5iReadOnlykerberos5iReadWritekerberos5pReadOnlykerberos5pReadWriter   r   rulesappendexportPolicy)r   rH   r_   export_policy_configpolicysimple_export_policy_rulekeyvals           r   ParseExportPolicy VolumesAdapter.ParseExportPolicy  s.    ==557"&--"F"F"Hlln(###58
2-151U1U1o1o1~1~2
#
. ##47
1((8;
5))9<
6))9<
6**:=
7))9<
6**:=
7'>,/
)'>,/
)1 %2   ''(AB7  8 /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.NrQ   zhost-groupszos-typezsize-gib)	blockDevicesr)   BlockDevicerQ   get
hostGroupsr   osTypesizeGib)r   rH   rr   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   r]   )r   rH   r]   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   rH   rb   rQ   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.)rH   rQ   
updateMask)r)   *NetappProjectsLocationsVolumesPatchRequestrM   r%   r:   Patch)r   rS   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$ )av  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.
  labels: the parsed labels value.
  block_devices: the block devices for the volume.

Returns:
  the configuration that will be used as the request body for creating a
  Cloud NetApp Files Volume.
N)r)   r   rQ   capacityGibr[   rq   storagePool	shareNamer   r   unixPermissionssmbSettingsr  snapReservesnapshotDirectorysecurityStylekerberosEnabledRestoreParameterssourceSnapshotsourceBackuprestoreParametersrestrictedActionsthroughputMibpsParseBackupConfiglargeCapacitymultipleEndpointsParseTieringPolicy ParseHybridReplicationParametersr   r   ParseCacheParameters)r   rQ   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rH   restore_parameterss                                r   rs    VolumesAdapter.ParseVolumeConfig  s   @ ]]!!#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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Ul        Ub  U R/                  UU5        U$ )z8Parse update information into an updated Volume message.)r[   rq   r  r  r   r  r   r  r  r  r  r  r  r  activeDirectoryParseRestoreParametersr"  r$  r%  r&  r'  r)  r#  r   )r   r   r[   rq   r\   r]   r^   r_   rZ   r`   ra   rb   rc   rd   re   rf   active_directoryrg   rh   ri   rj   rk   rl   rm   rp   ro   rr   s                              r   r   'VolumesAdapter.ParseUpdatedVolumeConfigo  s   < "-#"*".
-3 * 
]:#&6#"."
}>".%(:%!$2!"&5##&6m#v1
!!-6B%(:m% 
]M:!$2m!%(:m%!
m^<#
/?@#&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   rH   rj   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   rH   rg   rh   r*  s        r   r.  %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   rH   rm   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-locationr[   rq   :r   r   )r   value)additionalPropertieszreplication-schedulezhybrid-replication-typezlarge-volume-constituent-countN)r)   HybridReplicationParametersr   rF  r   r   r   r   r   clusterLocationr[   LabelsValueAdditionalPropertysplitrq   replicationSchedulehybridReplicationTypelargeVolumeConstituentCounthybridReplicationParameters)r   rH   rn   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                    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       H&  nSU;   d  M  US   R                  5       S:H  Ul        M(     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
rG  rH  rI  rJ  zenable-global-file-lockzcache-configzcifs-change-notify-enabledtrueN)r)   CacheParametersr   r   r   r   r   r   enableGlobalFileLockCacheConfiglowercifsChangeNotifyEnabledcacheConfigcacheParameters)r   rH   rp   cache_parameters_messagerX  cache_config_messagerU   s          r   r)  #VolumesAdapter.ParseCacheParameters6  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 ; ,@(5r"   r%   r)   r   r   )NNNNNNNNNNNNNNNNNNNNNNNNN)r   r   r   r   r   r    r   r   r   r  r   rs   r   r$  r.  r'  r
   r   r   r(  r)  r   r   r"   r   r   r   |  s    ?M
)/V7$('9R $(7j^ 7N`0(228 %%((	@OD(6r"   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   ia  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__d  sU    	
d,.**//D((t7I7IJDK**9K9KLDMr"   rg  r   r   r   r   r   r    r   __classcell__rl  s   @r   r   r   a  s    DM Mr"   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   ik  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   )rj  r   r    r
   r   r   r   r   r   r%   r   r)   rk  s    r   r    AlphaVolumesAdapter.__init__n  sU    	
t-/**00D((t7I7IJDK**9K9KLDMr"   rg  rn  rp  s   @r   r   r   k  s    EM Mr"   r   N)r   
__future__r   r   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  
!	'	'T0F T0n
b6V b6JM MM, Mr"   