
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ  e
j                  e
j                  j                   e
j                  j"                         G d
 de
j$                               Z e
j                  e
j                  j(                         G d de             ZddddZee_        ee_        y)zD`gcloud access-context-manager perimeters dry-run describe` command.    )absolute_import)division)print_function)unicode_literals)zones)base)
perimeters)policiesc                   *    e Zd ZdZdZed        Zd Zy)DescribePerimeterDryRun@Displays the dry-run mode configuration for a Service Perimeter.v1c                 0    t        j                  | d       y )Nzto describe)r	   AddResourceArg)parsers    Alib/surface/access_context_manager/perimeters/dry_run/describe.pyArgszDescribePerimeterDryRun.Args!   s    fm4    c                    t        j                  | j                        }|j                  j                  j                         }t        j                  ||       |j                  |      }t        j                  || j                         y )N)version)	zones_apiClient_API_VERSIONCONCEPTS	perimeterParser
   ValidateAccessPolicyArgGetr	   GenerateDryRunConfigDiff)selfargsclientperimeter_refr   s        r   RunzDescribePerimeterDryRun.Run%   sd    d&7&78FMM++113M$$]D9

=)I''	43D3DEr   N)__name__
__module____qualname____doc__r   staticmethodr   r$    r   r   r   r      s"    H,5 5Fr   r   c                       e Zd ZdZdZy)DescribePerimeterDryRunAlphar   v1alphaN)r%   r&   r'   r(   r   r*   r   r   r,   r,   -   s
    H,r   r,   z?Display the dry-run mode configuration for a Service Perimeter.a  The dry-run mode configuration is presented as a diff against the enforcement mode configuration. '+' indicates additions in `spec`,'-' indicates removals from `status` and entries without either of those indicate that they are the same across the dry-run and the enforcement mode configurations. When a particular field is completely empty, it will not be displayed.

Note: When this command is executed on a Service Perimeter with no explicit dry-run mode configuration, the effective dry-run mode configuration is inherited from the enforcement mode configuration, and thus, the enforcement mode configuration is displayed in such cases.a  To display the dry-run mode configuration for a Service Perimeter:

  $ {command} my-perimeter

Sample output:

 ===
   name: my_perimeter
   title: My Perimeter
   type: PERIMETER_TYPE_REGULAR
   resources:
 +   projects/123
 -   projects/456
     projects/789
   restrictedServices:
 +   bigquery.googleapis.com
 -   storage.googleapis.com
     bigtable.googleapis.com
   vpcAccessibleServices:
 +   allowedServices:
 +     bigquery.googleapis.com
 -     storage.googleapis.com
 +   enableRestriction: true
)briefDESCRIPTIONEXAMPLESN)r(   
__future__r   r   r   r   +googlecloudsdk.api_lib.accesscontextmanagerr   r   googlecloudsdk.callioper   /googlecloudsdk.command_lib.accesscontextmanagerr	   r
   ReleaseTracksReleaseTrackBETAGADescribeCommandr   ALPHAr,   detailed_helpr*   r   r   <module>r<      s    K &  % ' J ( F D D%%**D,=,=,@,@AFd22 F BF  D%%++,#:  - 	J	
F'R .;  *(5  %r   