
                             S 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                  5       " S S\R                  5      5       5       rg)	z=Implementation of update command for updating management hub.    )management_hub_api)base)flags)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Update   zUpdates Management Hub.zd
          Update management hub plan for the organization, sub-folder
           or project.
      a  
          To limit buckets in the management hub plan, Use the following
          command with ``--include-bucket-ids'' and ``--include-bucket-regexes'' flags
          to specify list of bucket ids and bucket id regexes.,

            ${command} --organization=my-org --include-bucket-ids=my-bucket --include-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 excluded locations.,

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

          The following command updates management hub for the given project by
          inheriting existing management hub plan from the hierarchical parent
          resource.,

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

          To clear included locations from the project management hub, Use the
          following command.,

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

          To clear excluded bucket ids from the project management hub and to
          replace existing excluded bucket ids regexes, Use the following
          command.,

            ${command} --project=my-project --exclude-bucket-id-regexes="test1*","test2*" --exclude-bucket-ids=""

          Alternatively, use the following command to do same operation since
          the absense of cloud storage bucket filter flags will be considered
          as empty list,

            ${command} --project=my-project --exclude-bucket-id-regexes="test1*","test2*"
      )DESCRIPTIONEXAMPLESc                     UR                  S5        [        R                  " U5        UR                  SSSS9nUR	                  SSSS9  UR                  S	S
9n[        R
                  " U5        g )NFUPDATET)categorymutexrequiredz--inherit-from-parent
store_truez<Specifies management hub config to be inherited from parent.)actionhelpFILTER)r   )SetSortArgsr   add_management_hub_level_flags	add_groupadd_argumentadd_management_hub_filter_flags)clsparserupdate_groupfilterss       ,lib/surface/storage/management_hub/update.pyArgsUpdate.ArgsE   s{    
u	((0## $ L K  
 $$h$7G	))'2    c                    UR                   (       a{  [        R                  " 5       R                  UR                   UR                  UR
                  UR                  UR                  UR                  UR                  UR                  S9nGOUR                  (       az  [        R                  " 5       R                  UR                  UR                  UR
                  UR                  UR                  UR                  UR                  UR                  S9nOy[        R                  " 5       R                  UR                  UR                  UR
                  UR                  UR                  UR                  UR                  UR                  S9n[        R                   R#                  SR%                  UR&                  5      5        U$ )N)inherit_from_parentinclude_locationsexclude_locationsinclude_bucket_idsexclude_bucket_idsinclude_bucket_id_regexesexclude_bucket_id_regexesz1Successfully updated management hub plan for {}.
)projectr   ManagementHubApiupdate_project_management_hubr#   r$   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   Run
Update.RunT   s   ||

-
-
/
M
Mll"&":": $ 6 6 $ 6 6!%!8!8!%!8!8(,(F(F(,(F(F N 	  


-
-
/
P
Poo"&":": $ 6 6 $ 6 6!%!8!8!%!8!8(,(F(F(,(F(F Q 	  
-
-
/
R
R"&":": $ 6 6 $ 6 6!%!8!8!%!8!8(,(F(F(,(F(F S 	  JJ<CC	

 r!    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   r8   __static_attributes__r:   r!   r   r   r      s2      

%-N 3 3/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>rL      s^    D = ( 4 #
 D%%++,hT\\ h - hr!   