
    <                         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)	z=Implementation of enable command for enabling management hub.    )management_hub_api)base)flags)logc                   0    e Zd ZdZdddZed        Zd Zy)EnablezEnables Management Hub.zv
          Enable management hub plan for the organization, sub-folder or project
          along with filters.
      a   
          To remove buckets from the management hub plan, Use the following
          command with ``--exclude-bucket-ids'' and ``--exclude-bucket-regexes'' flags
          to specify list of bucket ids and bucket id regexes.,

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

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

            ${command} --sub-folder=123456 --include-locations="us-east1","us-west1"
      )DESCRIPTIONEXAMPLESc                 z    |j                  d       t        j                  |       t        j                  |       y )NF)SetSortArgsr   add_management_hub_level_flagsadd_management_hub_filter_flags)clsparsers     ,lib/surface/storage/management_hub/enable.pyArgszEnable.Args2   s,    
u	((0	))&1    c           
      P   |j                   rrt        j                         j                  |j                   d |j                  |j
                  |j                  |j                  |j                  |j                        }n|j                  rrt        j                         j                  |j                  d |j                  |j
                  |j                  |j                  |j                  |j                        }nqt        j                         j                  |j                  d |j                  |j
                  |j                  |j                  |j                  |j                        }t        j                  j!                  dj#                  |j$                               |S )N)inherit_from_parentinclude_locationsexclude_locationsinclude_bucket_idsexclude_bucket_idsinclude_bucket_id_regexesexclude_bucket_id_regexesz1Successfully enabled management hub plan for {}.
)projectr   ManagementHubApiupdate_project_management_hubr   r   r   r   r   r   
sub_folder update_sub_folder_management_hub"update_organization_management_huborganizationr   statusPrintformatname)selfargsmanagement_hubs      r   Runz
Enable.Run8   si   ||

-
-
/
M
Mll"& $ 6 6 $ 6 6!%!8!8!%!8!8(,(F(F(,(F(F N 	  
)::<]]
//" 22 22!44!44$($B$B$($B$B ^ 	n *::<__


" 22 22!44!44$($B$B$($B$B ` 	n JJ<CC	

 r   N)__name__
__module____qualname____doc__detailed_helpclassmethodr   r*    r   r   r   r      s1      

-( 2 2
+r   r   N)r.   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHACommandr   r1   r   r   <module>r;      s`    D = ( 4 #
 D%%++,HT\\ H - Hr   