
    
                         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  SSKJr  \	R                  " \	R                  R                   5       " S S	\	R"                  5      5       rg
)z0Implements command to create a new guest policy.    )absolute_import)division)unicode_literals)utils)base)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)Create   zCreate a guest policy for a project.

## EXAMPLES

  To create a guest policy `policy1` in the current project, run:

        $ {command} policy1 --file=path_to_config_file

c                 P    U R                  S[        SS9  U R                  SSSS9  g)	See base class.	POLICY_IDz        Name of the guest policy to create.

        This name must contain only lowercase letters, numbers, and hyphens,
        start with a letter, end with a number or a letter, be between 1-63
        characters, and unique within the project.)typehelpz--fileTz        The JSON or YAML file with the guest policy to create. For information
        about the guest policy format, see https://cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies.)requiredr   N)add_argumentstr)parsers    6lib/surface/compute/os_config/guest_policies/create.pyArgsCreate.Args'   sC     6  	 A      c                    U R                  5       n[        R                  " U5      n[        R                  " U5      n[        R
                  " UR                  UR                  5      u  nn[        R                  R                  R                  R                  5       n[        R                  " U5      nUR                  UUR                  US9n	UR                   n
U
R#                  U	5      $ )r   )guestPolicyguestPolicyIdparent)ReleaseTrackosconfig_api_utilsGetClientInstanceGetClientMessagesosconfig_command_utils"GetResourceAndUpdateFieldsFromFilefileGuestPolicyr   VALUEScoreproject	GetOrFailGetProjectUriPath*OsconfigProjectsGuestPoliciesCreateRequestr   projects_guestPoliciesr
   )selfargsrelease_trackclientmessagesguest_policy_r'   parent_pathrequestservices              r   Run
Create.Run<   s     %%'M11-@F!33MBH !
C
C	H((*\ $$,,668G(::7CKAA nn B G
 ++G>>'""r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r6   __static_attributes__r8   r   r   r
   r
      s       (#r   r
   N)r=   
__future__r   r   r   (googlecloudsdk.api_lib.compute.os_configr   r   googlecloudsdk.callioper   ,googlecloudsdk.command_lib.compute.os_configr!   googlecloudsdk.corer   ReleaseTracksr   BETACommandr
   r8   r   r   <module>rH      sU    7 &  ' P ( X * D%%**+4#T\\ 4# ,4#r   