
    @                     j   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dl
mZ dd	lmZ d
ddZe	j                   e	j                   e	j"                  j$                  e	j"                  j&                  e	j"                  j(                         G d de	j*                                      Zee_        y)zCreate endpoint group command.    )absolute_import)division)unicode_literalsN)api)base)endpoint_group_flags)labels_utilaV  
          Create a intercept endpoint group. Successful creation of an endpoint group results
          in an endpoint group in ACTIVE state. Check the progress of endpoint group creation
          by using `gcloud network-security intercept-endpoint-groups list`.

          For more examples, refer to the EXAMPLES section below.

        a  
            To create a intercept endpoint group called `my-endpoint-group`, in project ID `my-project`, run:
            $ {command} my-endpoint-group --project=my-project --location=global --intercept-deployment-group=my-deployment-group

            OR

            $ {command} my-endpoint-group --project=my-project --location=global
            --intercept-deployment-group=projects/my-project/locations/global/interceptDeploymentGroups/my-deployment-group

            OR

            $ {command} projects/my-project/locations/global/interceptEndpointGroups/my-endpoint-group
            --intercept-deployment-group=projects/my-project/locations/global/interceptDeploymentGroups/my-deployment-group

            OR

            $ {command} my-endpoint-group --project=my-project --location=global
            --mirroring-deployment-group=projects/my-project/locations/global/interceptDeploymentGroups/my-deployment-group
            --description='new description'

        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Createz"Create a Intercept Endpoint Group.c                    t        j                  | j                         |       t        j                  | j                         |       t        j                  |d       t        j
                  |       t        j                  j                  |       t        j                  j                  |d       t        j                  |       y )N20mT)r   AddEndpointGroupResourceReleaseTrack#AddInterceptDeploymentGroupResource
AddMaxWaitAddDescriptionArgr   
ASYNC_FLAGAddToParser
SetDefaultr	   AddCreateLabelsFlags)clsparsers     @lib/surface/network_security/intercept_endpoint_groups/create.pyArgszCreate.ArgsD   s    11#2B2B2DfM<<F ## **62OO'OOvt,$$V,    c                    t        j                  | j                               }|j                  j                  j                         }|j                  j                  j                         }t        j                  ||j                  j                  j                        }|j                  }t        j                  |j                        }|j!                  |j#                         |j%                         j'                         |j'                         |t)        |dd            }|r|j+                  d      sd|_        |S |j/                  |j1                  |      dj-                  |j'                               d|	      S )
N)secondsdescription )endpoint_group_idparentintercept_deployment_grouplabelsr    formatdefaultz7waiting for intercept endpoint group [{}] to be createdT)operation_refmessage
has_resultmax_wait)r   Clientr   CONCEPTSintercept_endpoint_groupParser$   r	   ParseCreateArgsmessagesInterceptEndpointGroupLabelsValueasync_datetime	timedeltar+   CreateEndpointGroupNameParentRelativeNamegetattrIsSpecifiedr&   WaitForOperationGetOperationRef)	selfargsclientendpoint_groupr$   r%   is_asyncr+   	operations	            r   Runz
Create.RunS   sO   ZZ))+,F]];;AACN00668  ((foo44@@F {{H!!$--8H **(--/$$&335#=#J#J#LD-4 + I  h'"",,Y7ELL++-  # 	 	r   N)__name__
__module____qualname____doc__classmethodr   rE    r   r   r   r   =   s    
 +- -'r   r   )rI   
__future__r   r   r   r5   Agooglecloudsdk.api_lib.network_security.intercept_endpoint_groupsr   googlecloudsdk.callioper   5googlecloudsdk.command_lib.network_security.interceptr   $googlecloudsdk.command_lib.util.argsr	   DETAILED_HELPDefaultUniverseOnlyReleaseTracksr   ALPHABETAGACreateCommandr   detailed_helprK   r   r   <module>rY      s    % &  '  Q ( V <B T..33T5F5F5I5I9T 9 9x % r   