
                         @    d Z ddlmZ ddlmZ ddlmZ  G d d      Zy)zConnect Gateway API client.

This does not provide client methods for GatewayService, which expects raw HTTP
requests as provided by e.g. kubectl.
    )Union)util)basec                       e Zd ZdZej
                  fdej                  fdZ	 	 	 	 dde	de
dee	df   dee	df   d	ej                  j                  d
ej                  j                  fdZy)GatewayClienta  Client for the Connect Gateway API with related helper methods.

  If not provided, the default client is for the GA (v1) track. This client
  is a thin wrapper around the base client, and does not handle any exceptions.

  Fields:
    release_track: The release track of the command [ALPHA, BETA, GA].
    client: The raw GKE Hub API client for the specified release track.
    messages: The matching messages module for the client.
  release_trackc                     ||nt         j                  | _        t        j                  |      | _        t        j
                  |      | _        y )N)r   DEFAULT_TRACKr   GetClientInstanceclientGetMessagesModulemessages)selfr   s     Clib/googlecloudsdk/api_lib/container/fleet/connectgateway/client.py__init__zGatewayClient.__init__'   s@    &28J8J 	 ((7DK**=9DM    Nnameforce_use_agentversionkubernetes_namespaceoperating_systemreturnc                     | j                   j                  |||||      }| j                  j                  j	                  |      S )a  Retrieve connection information for accessing a membership through Connect Gateway.

    Args:
      name: The full membership name, in the form
        `projects/*/locations/*/memberships/*`.
      force_use_agent: Whether to force the use of Connect Agent-based
        transport.
      version: The Connect Gateway version to be used in the resulting
        configuration.
      kubernetes_namespace: The namespace to use in the kubeconfig context.
      operating_system: The operating system for which the kubeconfig should be
        generated. The default value of `None` works for supported operating
        systems other than Windows.

    Returns:
      The GenerateCredentialsResponse message.
    )r   forceUseAgentr   kubernetesNamespaceoperatingSystem)r   DConnectgatewayProjectsLocationsMembershipsGenerateCredentialsRequestr   projects_locations_membershipsGenerateCredentials)r   r   r   r   r   r   reqs          r   r   z!GatewayClient.GenerateCredentials.   sJ    2 --
\
\%0( ] C ;;55II#NNr   )FNNN)__name__
__module____qualname____doc__r   r
   r   ReleaseTrackr   strboolr   TYPESOperatingSystemGenerateCredentialsResponser    r   r   r   r      s    	 9=8J8J :D$5$5 : $"&/359 O O  O S$Y	 O
 "#t), O 

22 O zz-- Or   r   N)r$   typingr   5googlecloudsdk.api_lib.container.fleet.connectgatewayr   googlecloudsdk.callioper   r   r+   r   r   <module>r/      s!     F (3O 3Or   