
    	                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  \R                   " S S	\R                  5      5       rg
)zCImplementation of create command for making folders in HNS buckets.    )api_factory)base)errors_util)flags)storage_url)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Create   z1Create folders for hierarchical namespace bucket.zCreate folders.aA  
      The following command creates a folder called `folder/` in a bucket
      named `my-bucket`:

        $ {command} gs://my-bucket/folder/

      The following command creates all folders in the path `A/B/C/D` in a
      bucket named `my-bucket`:

        $ {command} --recursive gs://my-bucket/folder/A/B/C/D
      )DESCRIPTIONEXAMPLESc                 ~    U R                  S[        SSS9  U R                  SSSS9  [        R                  " U 5        g	)
z2Adds arguments specific to this command to parser.url+z"The URLs of the folders to create.)typenargshelpz--recursive
store_truezLRecursively create all folders in a given path if they do not alraedy exist.)actionr   N)add_argumentstrr   add_additional_headers_flag)parsers    %lib/surface/storage/folders/create.pyArgsCreate.Args-   sQ     Cs)M   	   
%%f-    c                    / nUR                    HL  n[        R                  " U5      n[        R                  " UR
                  US5        UR                  U5        MN     U H  n[        R                  " UR                  5      n[        R                  R                  SR                  U5      5        UR                  UR                  UR                   UR"                  5        M     g )NfolderzCreating {}...)r   r   storage_url_from_stringr   "raise_error_if_not_gcs_folder_typecommand_pathappendr   get_apischemer   statusPrintformatcreate_folderbucket_nameresource_name	recursive)selfargsurls
url_stringr   clients         r   Run
Create.Run@   s    Dhh
//
;c44


S( kk#  ""3::.f	jj'..s343??C,=,=t~~N r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r2   __static_attributes__r4   r   r   r
   r
      s0    9 '

- . .$Or   r
   N)r9   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r   r   googlecloudsdk.corer   DefaultUniverseOnlyCommandr
   r4   r   r   <module>rC      sG    J 7 ( : 4 : # 1OT\\ 1O 1Or   