
    A                     ,   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  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  \R8                  " \R:                  R<                  5       " S S\R>                  5      5       r g)zImport ssl policy command.    )absolute_import)division)unicode_literals)
exceptions)base_classes)ssl_policies_utils)base)flags)scope)util)yaml_validator)
console_ioc                   V    \ rS rSrSrSr\S 5       r\S	S j5       r\S 5       r	S r
Srg)
Import"   a  Import an SSL policy.

If the specified SSL policy already exists, it will be overwritten.
Otherwise, a new SSL policy will be created.
To edit an SSL policy you can export the SSL policy to a file,
edit its configuration, and then import the new configuration.
Nc                     U R                  5       [        R                   R                  :X  a  gU R                  5       [        R                   R                  :X  a  gg)z3Returns the API version based on the release track.alphabetav1)ReleaseTrackr	   ALPHABETA)clss    *lib/surface/compute/ssl_policies/import.pyGetApiVersionImport.GetApiVersion.   sG     T..444				t0055	5    c                 L    [         R                  " SU R                  5       SUS9$ )z!Returns the resource schema path.compute	SslPolicyfor_help)export_utilGetSchemaPathr   )r   r"   s     r   r$   Import.GetSchemaPath7   s+     $$3$$&hH Hr   c                     [         R                  " 5       U l        U R                  R                  USS9  [        R
                  " XR                  SS95        g )Nimport)operation_typeTr!   )r
   GetSslPolicyMultiScopeArgumentSSL_POLICY_ARGAddArgumentr#   AddImportFlagsr$   )r   parsers     r   ArgsImport.Args=   sH    ==?C""6("Cv'8'8$'8'GHr   c                 J   [         R                  " U R                  5       5      n[        R                  " U5      nUR
                  nU R                  R                  UUR                  [        R                  " UR
                  5      [        R                  R                  S9n[        R                  " UR                   =(       d    SSS9n ["        R$                  " UR&                  R(                  UU R+                  5       S9n UR5                  U5      n	X:X  a  g [        R@                  " SRC                  URE                  5       5      S	S
9  U	RF                  Ul#        U	RH                  Ul$        URK                  XWS5      nUR?                  X[S5      $ ! [,        R.                   a$  n[0        R.                  " [3        U5      5      eS nAff = f! [6        R8                   a?  n
U
R:                  S:w  a  U
eUR=                  XW5      nUR?                  X[S5      s S n
A
$ S n
A
ff = f)N)scope_listerdefault_scope-F)binary)message_typestreamschema_pathi  zCreating SSL policyz%SSL Policy [{0}] will be overwritten.T)messagecancel_on_nozUpdating SSL policy)&r   ComputeApiHolderr   r   SslPolicyHelperclientr*   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListercompute_scope	ScopeEnumGLOBALr   ReadFromFileOrStdinsourcer#   r   messagesr    r$   r   ValidationErrorcompute_exceptionsstrDescribeapitools_exceptions	HttpErrorstatus_codeCreateWaitForOperationPromptContinueformatNameidfingerprintPatch)selfargsholderhelperr<   ssl_policy_refdata
ssl_policyessl_policy_olderroroperation_refs               r   Run
Import.RunC   s   **4+<+<+>?F//7F]]F((::"88G#--44	 ; 6N ))$++*<UKD7%%00((*,j<~6n #8@@!# #%%JM+77JLLUCM"">#8: :; )) 7..s1v667 (( <			c	!mmN?m$$^%:< <<s6   8F G G(GGH"#4HH"H" )F)__name__
__module____qualname____firstlineno____doc__r*   classmethodr   r$   r.   ra   __static_attributes__rc   r   r   r   r   "   sQ     .  H H
 I I
0:r   r   N)!rh   
__future__r   r   r   apitools.base.pyr   rK   googlecloudsdk.api_lib.computer   +googlecloudsdk.api_lib.compute.ssl_policiesr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computerH   r
   r?   r   rA   /googlecloudsdk.command_lib.compute.ssl_policies!googlecloudsdk.command_lib.exportr   r#   googlecloudsdk.corer   googlecloudsdk.core.consoler   ReleaseTracksr   r   UpdateCommandr   rc   r   r   <module>rw      so    ! &  ' > 7 J ( O E E A A . 2 D%%++,P:T P: -P:r   