
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  \R2                  " \R4                  R6                  5       " S S\R8                  5      5       r\R2                  " \R4                  R<                  \R4                  R>                  5       " S S\5      5       r g)z)Vertex AI index endpoints create command.    )absolute_import)division)unicode_literals)encoding)
operations)client)base)	constants)endpoint_util)flags)index_endpoints_util)operations_util)region_util)
validation)labels_util)logc                   4    \ rS rSrSr\S 5       rS rS rSr	g)CreateV1$   _  Create a new Vertex AI index endpoint.

## EXAMPLES

To create an index endpoint under project `example` with network
`projects/123/global/networks/test-network` in region
`us-central1`, run:

  $ {command} --display-name=index-endpoint --description=test
  --network=projects/123/global/networks/test-network
  --project=example --region=us-central1
c                 8   [         R                  " U S[        R                  " [        R
                  5      S9  [         R                  " S5      R                  U 5        [         R                  " S5      R                  U 5        [         R                  " 5       R                  U 5        [         R                  " 5       R                  U 5        [        R                  " U 5        [         R                  " U 5        [         R                  " 5       R                  U 5        g )Nzto create index endpoint)prompt_funczindex endpoint)r   AddRegionResourceArgr   GetPromptForRegionFuncr
   SUPPORTED_OP_REGIONSGetDisplayNameArgAddToParserGetDescriptionArgGetNetworkArgGetPublicEndpointEnabledArgr   AddCreateLabelsFlagsAddPrivateServiceConnectConfigGetEncryptionKmsKeyNameArg)parsers    (lib/surface/ai/index_endpoints/create.pyArgsCreateV1.Args3   s    	"66**
 
,-99&A	,-99&A	%%f-	%%'33F;$$V,	((0	$$&226:    c                 *   [         R                  " UR                  5        [         R                  " UR                  UR
                  5        UR                  R                  R                  5       nUR                  5       S   n[        R                  " X$S9   [        R                  " US9nU[        R                  :X  a  UR!                  X15      nOUR#                  X15      n[$        R&                  " [(        R*                  " US9U[,        R.                  " UR0                  5      S9nUbM  [2        R4                  " U5      nSU;   a1  [6        R8                  R;                  SR=                  US   5      5        UsS S S 5        $ ! , (       d  f       g = f)NlocationsId)region)version)operations_clientopop_refnamez%Created Vertex AI index endpoint: {}.)r   ValidateDisplayNamedisplay_nameValidateEndpointArgsnetworkpublic_endpoint_enabledCONCEPTSr+   ParseAsDictr   AiplatformEndpointOverridesr   IndexEndpointsClientr
   
GA_VERSIONCreate
CreateBetar   WaitForOpMayber   OperationsClientr   ParseIndexEndpointOperationr0   r   MessageToPyValuer   statusPrintformat)	selfargsr,   
region_refr+   index_endpoint_client	operationresponse_msgresponses	            r%   _RunCreateV1._RunD   s6   ""4#4#45##DLL$2N2NO%%++-J /F		2	27	J$99'J	I((	()00B	)44ZF	$33&77H%AAnnl
 
	!,,\:X
**

CKKv  !# 
K	J	Js   C#F
Fc                 B    U R                  U[        R                  5      $ N)rL   r
   r;   rE   rF   s     r%   RunCreateV1.Run\   s    99T9//00r(    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr&   rL   rQ   __static_attributes__rS   r(   r%   r   r   $   s%     ; ; 01r(   r   c                       \ rS rSrSrS rSrg)CreateV1Beta1`   r   c                 B    U R                  U[        R                  5      $ rO   )rL   r
   BETA_VERSIONrP   s     r%   rQ   CreateV1Beta1.Runo   s    99T91122r(   rS   N)rT   rU   rV   rW   rX   rQ   rZ   rS   r(   r%   r\   r\   `   s    3r(   r\   N)!rX   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.air   )googlecloudsdk.api_lib.ai.index_endpointsr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.air
   r   r   r   r   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackGACreateCommandr   ALPHABETAr\   rS   r(   r%   <module>ro      s    0 &  ' % 0 < ( 3 7 / > 9 5 4 < # D%%(()81t!! 81 *81v D%%++T->->-C-CD3H 3 E3r(   