
    
                     2   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	  ej                  ej                  j                  ej                  j                  ej                  j                        ej                   G d dej                                       Zy	)
zEnable Identity-Aware Proxy.    )absolute_import)division)unicode_literals)base)utilc                   .    e Zd ZdZddiZed        Zd Zy)EnablezEnable Cloud Identity-Aware Proxy (Cloud IAP) on an IAP resource.

  This command enables Cloud Identity-Aware Proxy on an IAP resource. OAuth 2.0
  credentials must be set, or must have been previously set, to enable IAP.
  EXAMPLESa            To enable IAP on an App Engine application, run:

            $ {command} --resource-type=app-engine
                --oauth2-client-id=CLIENT_ID --oauth2-client-secret=SECRET

          To enable IAP on a global backend service, run:

            $ {command} --resource-type=backend-services
                --oauth2-client-id=CLIENT_ID --oauth2-client-secret=SECRET
                --service=SERVICE_ID

          To enable IAP on a region backend service, run:

            $ {command} --resource-type=backend-services
                --oauth2-client-id=CLIENT_ID --oauth2-client-secret=SECRET
                --service=SERVICE_ID --region=REGION
  c                     t        j                  |       t        j                  |       t        j                  j                  |       y)zRegister flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
          to capture some information, but behaves like an ArgumentParser.
    N)iap_utilAddIapResourceArgsAddOauthClientArgsr   URI_FLAGRemoveFromParser)clsparsers     lib/surface/iap/web/enable.pyArgszEnable.Args:   s2     ''MM""6*    c                     t        j                  | j                         |      }|j                  |j                  |j
                        S )a  This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      The specified function with its description and configured filter.
    )r   ParseIapResourceReleaseTrackr	   oauth2_client_idoauth2_client_secret)selfargsiap_refs      r   Runz
Enable.RunF   s<     ''(9(9(;TBG>>$//1J1JKKr   N)__name__
__module____qualname____doc__detailed_helpclassmethodr   r    r   r   r	   r	      s2    
 -, 	+ 	+Lr   r	   N)r"   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.iapr   r   ReleaseTracksr   ALPHABETAGADefaultUniverseOnlyCommandr	   r%   r   r   <module>r/      s     # &  ' ( ; !2!2!7!79J9J9M9M 3LT\\ 3L 3Lr   