
                             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)	zCImplementation of enable command for enabling storage intelligence.    )storage_intelligence_api)base)flags)logc                   0    e Zd ZdZdddZed        Zd Zy)EnablezEnables storage intelligence.z
          Enable storage intelligence plan for the organization, sub-folder or project
          along with filters. The command sets `STANDARD` edition by default if
          no other edition flags like ``--trial-edition`` are specified.
      a  
          To remove buckets from the storage intelligence plan, Use the following
          command with ``--exclude-bucket-id-regexes'' flag.
          to specify list of bucket id regexes.,

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

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

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

          The following command enables storage intelligence with Trial edition
          for the given project,

            $ {command} --project=my-project --trial-edition
      )DESCRIPTIONEXAMPLESc                     |j                  d       t        j                  |       |j                  d      }t        j                  |       y )NFSETTINGS)category)SetSortArgsr   ,add_storage_intelligence_configs_level_flags	add_group/add_storage_intelligence_configs_settings_flags)clsparsersettingss      2lib/surface/storage/intelligence_configs/enable.pyArgszEnable.Args9   s?    
u	66v>4H	99(C    c           	         t        j                         }|j                  rU|j                  |j                  d |j                  |j
                  |j                  |j                  |j                        }n|j                  rU|j                  |j                  d |j                  |j
                  |j                  |j                  |j                        }nT|j                  |j                  d |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 enabled storage intelligence plan for {}.
)r   StorageIntelligenceApiproject"update_project_intelligence_configr   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
Enable.Run@   sB   %<<>F||

3
3ll"& .. $ 6 6 $ 6 6(,(F(F(,(F(F 4   
"HH
//"** 22 22$($B$B$($B$B I  #JJ


"** 22 22$($B$B$($B$B K  JJBII$$	

 r   N)__name__
__module____qualname____doc__detailed_helpclassmethodr   r.    r   r   r   r      s3     &


-2 D D)r   r   N)r2   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHACommandr   r5   r   r   <module>r?      s`     J C ( 4 # D%%++,KT\\ K - Kr   