
    *                     F   d Z ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ej                   ej                  ej                  j                          G d dej"                                      Z ej                  ej                  j&                         G d	 d
e             Zy)z(Updates a Cloud NetApp Volume QuotaRule.    )client)base)flags)labels_util)logc                   \    e Zd ZdZej
                  j                  ZdddZe	d        Z
d Zy)Updatez'Update a Cloud NetApp Volume QuotaRule.zY          Update a Cloud NetApp Volume QuotaRule and its specified parameters.
          z          The following command updates a QuotaRule named NAME and its specified parameters:

              $ {command} NAME --location=us-central1 --description="new" --disk-limit-mib=100 --update-labels=key2=val2 --volume=vol1
          )DESCRIPTIONEXAMPLESc                 .    t        j                  |        y )N)quota_rules_flagsAddQuotaRuleUpdateArgs)parsers    0lib/surface/netapp/volumes/quota_rules/update.pyArgszUpdate.Args+   s    ,,V4    c                 0   |j                   j                  j                         }t        j                  | j
                        }t        j                  j                  |      }|j                  |      }|j                         rI|j                  |j                  j                  j                  |j                        j!                         }nd}|j#                  ||j$                  |j&                  |      }g }|j)                  d      r|j+                  d       |D|j)                  d      s"|j)                  d      s|j)                  d      r|j+                  d       |j)                  d      r|j+                  d	       d
j-                  |      }	|j/                  |||	|j0                        }
|j0                  rWdj3                  | j5                         j6                        }t8        j:                  j=                  dj3                  |             |
S )z>Update a Cloud NetApp Volume QuotaRule in the current project.N)disk_limit_mibdescriptionlabelsr   update_labelsremove_labelsclear_labelsr   r   diskLimitMib,z)gcloud {} netapp volumes quota-rules listzNCheck the status of the updated quota rule by listing all quota rules:
  $ {} )CONCEPTS
quota_ruleParsequota_rules_clientQuotaRulesClient_RELEASE_TRACKr   DiffFromUpdateArgsGetQuotaRuleMayHaveUpdatesApplymessages	QuotaRuleLabelsValuer   	GetOrNoneParseUpdatedQuotaRuleConfigr   r   IsSpecifiedappendjoinUpdateQuotaRuleasync_formatReleaseTrackprefixr   statusPrint)selfargsquota_rule_refr   labels_difforiginal_quota_ruler   r   updated_fieldsupdate_maskresultcommands               r   Runz
Update.Run/   s   ]]--335N001D1DEF""11$7K --n= !!#  
//
#
#
/
/1D1K1K	  f33**$$	 4 J N &M*
 	)O,N+H%()N+((>*K##
KF {{;BB




$
$g 
jj#VG_ Mr   N)__name__
__module____qualname____doc__r   r2   GAr!   detailed_helpstaticmethodr   r?    r   r   r	   r	      sB     0$$''.		- 5 55r   r	   c                   <    e Zd ZdZej
                  j                  Zy)
UpdateBetaz(Update a Cloud NetApp Volume Quota Rule.N)r@   rA   rB   rC   r   r2   BETAr!   rG   r   r   rI   rI   g   s    0$$)).r   rI   N)rC   1googlecloudsdk.api_lib.netapp.volumes.quota_rulesr   r   googlecloudsdk.callioper   5googlecloudsdk.command_lib.netapp.volumes.quota_rulesr   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksr2   rD   UpdateCommandr	   rJ   rI   rG   r   r   <module>rS      s     / Z ( \ < # D%%(()IT I * IX D%%**+* * ,*r   