
                             d 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y)	zQImplementation of update command for updating storage intelligence configuration.    )storage_intelligence_api)base)flags)logc                   0    e Zd ZdZdddZed        Zd Zy)Updatez+Updates storage intelligence configuration.a  
          Update storage intelligence configuration for the organization, sub-folder
          or project. The command sets `STANDARD` edition by default if no other
          edition flags like ``--trial-edition`` or ``--inherit-from-parent``
          are specified.
      a  
          To limit buckets in the storage intelligence configuration, Use the following
          command with ``--include-bucket-id-regexes'' flag.
          to specify list of bucket ids and bucket id regexes.,

            $ {command} --organization=my-org --include-bucket-id-regexes=my-bucket-.*

          To apply location based filters in the storage intelligence configuration, Use
          ``--include-locations'' or ``--exclude-locations'' flags to specify allowed
          list of locations or excluded list of locations. The following
          command updates storage intelligence configuration of sub-folder `123456` with the
          specified list of excluded locations.,

            $ {command} --sub-folder=123456 --exclude-locations=us-east1,us-west1

          The following command updates storage intelligence for the given project by
          inheriting existing storage intelligence configuration from the hierarchical parent
          resource.,

            $ {command} --project=my-project --inherit-from-parent

          To clear included locations from the project storage intelligence, Use the
          following command.,

            $ {command} --project=my-project --include-locations=

      )DESCRIPTIONEXAMPLESc                     |j                  d       t        j                  |       |j                  ddd      }|j	                  ddd       |j                  d	
      }t        j
                  |       y )NFUPDATET)categorymutexrequiredz--inherit-from-parent
store_truezBSpecifies storage intelligence config to be inherited from parent.)actionhelpSETTINGS)r   )SetSortArgsr   ,add_storage_intelligence_configs_level_flags	add_groupadd_argument/add_storage_intelligence_configs_settings_flags)clsparserupdate_groupsettingss       2lib/surface/storage/intelligence_configs/update.pyArgszUpdate.Args>   s{    
u	66v>## $ L P	   %%z%:H	99(C    c           	         t        j                         }|j                  r_|j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                        }n|j                  r_|j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                        }n^|j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                        }t        j                  j!                  dj#                  |j$                               |S )N)inherit_from_parenttrial_editioninclude_locationsexclude_locationsinclude_bucket_id_regexesexclude_bucket_id_regexesz7Successfully updated storage intelligence plan for {}.
)r   StorageIntelligenceApiproject"update_project_intelligence_configr!   r"   r#   r$   r%   r&   
sub_folder%update_sub_folder_intelligence_config'update_organization_intelligence_configorganizationr   statusPrintformatname)selfargsclientintelligence_configs       r   Runz
Update.RunO   sT   %<<>F||

3
3ll"&":": .. $ 6 6 $ 6 6(,(F(F(,(F(F 4   
"HH
//"66** 22 22$($B$B$($B$B I  #JJ


"66** 22 22$($B$B$($B$B K  JJBII$$	

 r   N)__name__
__module____qualname____doc__detailed_helpclassmethodr   r6    r   r   r   r      s4     4

-@ D D )r   r   N)r:   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHACommandr   r=   r   r   <module>rG      s`    X C ( 4 #
 D%%++,]T\\ ] - ]r   