
                         6   d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 dZ
e	j                  j                  d	e	j                  j                  d
e	j                  j                  diZd Z G d de      Z G d de      Z G d de      Z G d de      Zy)z(Utilities for Policy Troubleshooter API.    )absolute_import)division)unicode_literalsN)apis)basepolicytroubleshooterv3alphav3betav3c                 ,    t         j                  |       S )z<Return the api version of the Policy Troubleshooter service.)VERSION_MAPget)release_tracks    Glib/googlecloudsdk/api_lib/policy_intelligence/policy_troubleshooter.pyGetApiVersionr   #   s    		''    c                       e Zd ZdZ fdZd Zej                  d        Zej                  	 	 	 	 d
d       Z	ej                  	 dd       Z
ej                  	 dd       Zej                  dd       Zej                  	 dd	       Z xZS )PolicyTroubleshooterApiz)Base Class for Policy Troubleshooter API.c                 >   |t         j                  j                  k(  rt        t        |   t              S |t         j                  j                  k(  rt        t        |   t              S |t         j                  j                  k(  rt        t        |   t              S y N)r   ReleaseTrackALPHAsuperr   __new__PolicyTroubleshooterApiAlphaBETAPolicyTroubleshooterApiBetaGAPolicyTroubleshooterApiGA)clsr   	__class__s     r   r   zPolicyTroubleshooterApi.__new__+   s    ))///*C8
&  ))...*C8
%  )),,,*C8
#  -r   c                     t        |      }t        j                  t        |      | _        t        j
                  t        |      | _        y r   )r   r   GetClientInstance	_API_NAMEclientGetMessagesModulemessages)selfr   api_versions      r   __init__z PolicyTroubleshooterApi.__init__9   s4    .K((K@DK**9kBDMr   c                      y r    )r(   access_tuples     r   TroubleshootIAMPoliciesz/PolicyTroubleshooterApi.TroubleshootIAMPolicies>       r   c                      y r   r,   r(   condition_contextfull_resource_nameprincipal_email
permissions        r   "GetPolicyTroubleshooterAccessTuplez:PolicyTroubleshooterApi.GetPolicyTroubleshooterAccessTupleB   s     	r   c                      y r   r,   r(   destinationrequestresources       r   'GetPolicyTroubleshooterConditionContextz?PolicyTroubleshooterApi.GetPolicyTroubleshooterConditionContextL        	r   c                      y r   r,   r(   destination_ipdestination_ports      r   GetPolicyTroubleshooterPeerz3PolicyTroubleshooterApi.GetPolicyTroubleshooterPeerR   r=   r   c                      y r   r,   r(   request_times     r   GetPolicyTroubleshooterRequestz6PolicyTroubleshooterApi.GetPolicyTroubleshooterRequestX   r/   r   c                      y r   r,   r(   resource_nameresource_serviceresource_types       r   GetPolicyTroubleshooterResourcez7PolicyTroubleshooterApi.GetPolicyTroubleshooterResource\   r=   r   NNNNNNNNNr   )__name__
__module____qualname____doc__r   r*   abcabstractmethodr.   r6   r<   rB   rF   rL   __classcell__)r!   s   @r   r   r   (   s    1C
 	 	  	 	 59	 	
 26	 	
 	 	 EI	 	r   r   c                   L    e Zd ZdZd Z	 	 	 	 d	dZd
dZ	 ddZ	 ddZ	 ddZ	y)r   z/Base Class for Policy Troubleshooter API Alpha.c                     | j                   j                  |      }| j                  j                  j	                  |      S N)accessTuple)r'   EGoogleCloudPolicytroubleshooterIamV3alphaTroubleshootIamPolicyRequestr%   iamTroubleshootr(   r-   r:   s      r   r.   z4PolicyTroubleshooterApiAlpha.TroubleshootIAMPoliciesf   s:    mmaa  b G ;;??''00r   Nc                 @    | j                   j                  ||||      S N)fullResourceName	principalr5   conditionContext)r'   4GoogleCloudPolicytroubleshooterIamV3alphaAccessTupler1   s        r   r6   z?PolicyTroubleshooterApiAlpha.GetPolicyTroubleshooterAccessTuplel   s-     ==MM+!*	 N  r   c                 :    | j                   j                  |      S N)receiveTime)r'   @GoogleCloudPolicytroubleshooterIamV3alphaConditionContextRequestrD   s     r   rF   z;PolicyTroubleshooterApiAlpha.GetPolicyTroubleshooterRequestz   s"    ==YY  Z  r   c                 >    | j                   j                  |||      S N)nameservicetype)r'   AGoogleCloudPolicytroubleshooterIamV3alphaConditionContextResourcerH   s       r   rL   z<PolicyTroubleshooterApiAlpha.GetPolicyTroubleshooterResource   s)     ==ZZ$4= [  r   c                 <    | j                   j                  ||      S N)ipport)r'   =GoogleCloudPolicytroubleshooterIamV3alphaConditionContextPeerr?   s      r   rB   z8PolicyTroubleshooterApiAlpha.GetPolicyTroubleshooterPeer   s'     ==VV 0 W  r   c                 >    | j                   j                  |||      S N)r9   r:   r;   )r'   9GoogleCloudPolicytroubleshooterIamV3alphaConditionContextr8   s       r   r<   zDPolicyTroubleshooterApiAlpha.GetPolicyTroubleshooterConditionContext   s(     	OO#Wx 	P 	
r   rM   r   rN   rO   
rP   rQ   rR   rS   r.   r6   rF   rL   rB   r<   r,   r   r   r   r   c   sB    71  FJ 37 6:r   r   c                   L    e Zd ZdZd Z	 	 	 	 d	dZd
dZ	 ddZ	 ddZ	 ddZ	y)r   z.Base Class for Policy Troubleshooter API Beta.c                     | j                   j                  |      }| j                  j                  j	                  |      S rY   )r'   DGoogleCloudPolicytroubleshooterIamV3betaTroubleshootIamPolicyRequestr%   r\   r]   r^   s      r   r.   z3PolicyTroubleshooterApiBeta.TroubleshootIAMPolicies   s:    mm``  a G ;;??''00r   Nc                 @    | j                   j                  ||||      S r`   )r'   3GoogleCloudPolicytroubleshooterIamV3betaAccessTupler1   s        r   r6   z>PolicyTroubleshooterApiBeta.GetPolicyTroubleshooterAccessTuple   s-     ==LL+!*	 M  r   c                 :    | j                   j                  |      S rf   )r'   ?GoogleCloudPolicytroubleshooterIamV3betaConditionContextRequestrD   s     r   rF   z:PolicyTroubleshooterApiBeta.GetPolicyTroubleshooterRequest   s"    ==XX  Y  r   c                 >    | j                   j                  |||      S rj   )r'   @GoogleCloudPolicytroubleshooterIamV3betaConditionContextResourcerH   s       r   rL   z;PolicyTroubleshooterApiBeta.GetPolicyTroubleshooterResource   s)     ==YY$4= Z  r   c                 <    | j                   j                  ||      S rp   )r'   <GoogleCloudPolicytroubleshooterIamV3betaConditionContextPeerr?   s      r   rB   z7PolicyTroubleshooterApiBeta.GetPolicyTroubleshooterPeer   s'     ==UU 0 V  r   c                 >    | j                   j                  |||      S ru   )r'   8GoogleCloudPolicytroubleshooterIamV3betaConditionContextr8   s       r   r<   zCPolicyTroubleshooterApiBeta.GetPolicyTroubleshooterConditionContext   s(     	NN#Wx 	O 	
r   rM   r   rN   rO   rw   r,   r   r   r   r      sB    61  FJ 37 6:r   r   c                   L    e Zd ZdZd Z	 	 	 	 d	dZd
dZ	 ddZ	 ddZ	 ddZ	y)r   z,Base Class for Policy Troubleshooter API GA.c                     | j                   j                  |      }| j                  j                  j	                  |      S rY   )r'   @GoogleCloudPolicytroubleshooterIamV3TroubleshootIamPolicyRequestr%   r\   r]   r^   s      r   r.   z1PolicyTroubleshooterApiGA.TroubleshootIAMPolicies   s:    mm\\  ] G ;;??''00r   Nc                 @    | j                   j                  ||||      S r`   )r'   /GoogleCloudPolicytroubleshooterIamV3AccessTupler1   s        r   r6   z<PolicyTroubleshooterApiGA.GetPolicyTroubleshooterAccessTuple   s-     ==HH+!*	 I  r   c                 :    | j                   j                  |      S rf   )r'   ;GoogleCloudPolicytroubleshooterIamV3ConditionContextRequestrD   s     r   rF   z8PolicyTroubleshooterApiGA.GetPolicyTroubleshooterRequest   s"    ==TT  U  r   c                 >    | j                   j                  |||      S rj   )r'   <GoogleCloudPolicytroubleshooterIamV3ConditionContextResourcerH   s       r   rL   z9PolicyTroubleshooterApiGA.GetPolicyTroubleshooterResource   s)     ==UU$4= V  r   c                 <    | j                   j                  ||      S rp   )r'   8GoogleCloudPolicytroubleshooterIamV3ConditionContextPeerr?   s      r   rB   z5PolicyTroubleshooterApiGA.GetPolicyTroubleshooterPeer   s'     	NN$4 	O 	
r   c                 >    | j                   j                  |||      S ru   )r'   4GoogleCloudPolicytroubleshooterIamV3ConditionContextr8   s       r   r<   zAPolicyTroubleshooterApiGA.GetPolicyTroubleshooterConditionContext   s(     ==MM8 N  r   rM   r   rN   rO   rw   r,   r   r   r   r      sB    41  FJ 37 6:r   r   )rS   
__future__r   r   r   rT   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r$   r   r   r   r   r   r   objectr   r   r   r   r,   r   r   <module>r      s    / &  ' 
 , ("	YH$(
8	f 8	v1#: 1h1"9 1h1 7 1r   