
                            S r SSKJr  SSKJr  SSKJr  SSK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  \R.                  " \R0                  R2                  5       " S S\R4                  5      5       rg)zExport ssl policies command.    )absolute_import)division)unicode_literalsN)base_classes)ssl_policies_utils)base)flags)scope)util)filesc                   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)
Export   z|Export an SSL policy.

Exports an SSL policy's configuration to a file.
This configuration can be imported at a later time.
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/export.pyGetApiVersionExport.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"   Export.GetSchemaPath2   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export)operation_typeTr   )r	   GetSslPolicyMultiScopeArgumentSSL_POLICY_ARGAddArgumentr!   AddExportFlagsr"   )r   parsers     r   ArgsExport.Args8   sH    ==?C""6("Cv'8'8$'8'GHr   c                    [         R                  " U R                  5       5      n[        R                  " U5      nUR
                  nU R                  R                  UUR                  [        R                  " U5      [        R                  R                  S9nUR                  U5      nUR                  (       aM  [         R"                  " UR                  5       n[$        R&                  " XgU R)                  5       S9  S S S 5        g [$        R&                  " U[*        R,                  U R)                  5       S9  g ! , (       d  f       g = f)N)scope_listerdefault_scope)messagestreamschema_path)r   ComputeApiHolderr   r   SslPolicyHelperclientr(   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListercompute_scope	ScopeEnumGLOBALDescribedestinationr   
FileWriterr!   r   r"   sysstdout)selfargsholderhelperr6   ssl_policy_ref
ssl_policyr2   s           r   Run
Export.Run>   s    **4+<+<+>?F//7F]]F((::"88@#--44	 ; 6N 0JD,,-4;M;M;O	Q .- ((*,	 .-s   $D;;
E	 )F)__name__
__module____qualname____firstlineno____doc__r(   classmethodr   r"   r,   rI   __static_attributes__rK   r   r   r   r      sQ     .  H H
 I I
,r   r   )rP   
__future__r   r   r   rA   googlecloudsdk.api_lib.computer   +googlecloudsdk.api_lib.compute.ssl_policiesr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r9   r
   r;   /googlecloudsdk.command_lib.compute.ssl_policies!googlecloudsdk.command_lib.exportr   r!   googlecloudsdk.core.utilr   ReleaseTracksr   r   Commandr   rK   r   r   <module>r]      sd    # &  ' 
 7 J ( E E A A * D%%++,3,T\\ 3, -3,r   