
    3                        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rSrSr\	R*                  \	R,                  " \	R.                  R0                  5       " S S\	R2                  5      5       5       r\	R6                  " SSS9\	R,                  " \	R.                  R8                  5       " S S\5      5       5       rg)z2Command to create a datastream private connection.    )absolute_import)division)unicode_literals)private_connections)util)base)flags)resource_args)concept_parsers)presentation_specsz&Create a Datastream private connectiona      To create a privateConnection with VPC Peering called 'my-privateConnection', run:

        $ {command} my-privateConnection --location=us-central1 --display-name=my-privateConnection --vpc=vpc-example --subnet=10.0.0.0/29

    To create a privateConnection with PSC Interface called 'my-privateConnection', run:

        $ {command} my-privateConnection --location=us-central1 --display-name=my-privateConnection --network-attachment=network-attachment-example
   z    To create a privateConnection with VPC Peering called 'my-privateConnection', run:

        $ {command} my-privateConnection --location=us-central1 --display-name=my-privateConnection --vpc-name=vpc-example --subnet=10.0.0.0/29


   c                   H    \ rS rSrSr\\S.r\S 5       r	\S 5       r
S rSrg)	Create2   'Create a Datastream private connection.DESCRIPTIONEXAMPLESc                    [         R                  " U S5        [        R                  " U 5        [        R                  " U 5        [
        R                  " U 5        U R                  SSS9nUR                  SS9nUR                  SSSS9  S	nU[        R                  R                  :X  a  S
n[        R                  " SU-  [         R                  " 5       SSS9n[        R                   " U/5      R#                  U5        U[        R                  R$                  :X  a&  UR                  SS9n[        R&                  " U5        gg)a  Common arguments for all release tracks.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
  release_track: Some arguments are added based on the command release
    track.
z	to createT)mutexrequiredz(Arguments for VPC Peering configuration.)helpz--subnetz)A free subnet for peering. (CIDR of /29).)r   r   vpczvpc-namez--%sz,Resource ID of the VPC network to peer with.)r   z>Arguments for Private Service Connect Interface configuration.N)r
   AddPrivateConnectionResourceArgpc_flagsAddDisplayNameFlagAddValidateOnlyFlagr	   AddLabelsCreateFlags	add_groupadd_argumentr   ReleaseTrackBETAr   ResourcePresentationSpecGetVpcResourceSpecr   ConceptParserAddToParserGAAddNetworkAttachmentFlag)parserrelease_trackconfig_groupvpc_peering_groupvpc_field_namevpc_spec	psc_groups          4lib/surface/datastream/private_connections/create.py
CommonArgsCreate.CommonArgs8   s5    11&+F'  (	v&##$#>L$..7 /  ""< #  N))...!n!::((*6	H !!8*-99:KL )),,,((O ) i ''	2	 -    c                 `    [         R                  U [        R                  R                  5        gz@Args is called by calliope to gather arguments for this command.N)r   r0   r   r    r&   r(   s    r/   ArgsCreate.Argsg   s      fd//223r2   c                 H   UR                   R                  R                  5       nUR                  5       R	                  5       n[
        R                  " 5       nUR                  X2R                  U R                  5       U5      n[        R                  " 5       n[        R                  " 5       n[        R                  " 5       nUR                  SUR                  UR                  UR                   S9n	UR"                  R%                  UR'                  U	R(                  S95      $ )a   Create a Datastream private connection.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  A dict object representing the operations resource describing the create
  operation if the create was successful.
z(datastream.projects.locations.operations)operationsId
projectsIdlocationsId)name)CONCEPTSprivate_connectionParseParentRelativeNamer   PrivateConnectionsClientr   privateConnectionsIdr    r   GetClientInstanceGetMessagesModuleGetResourceParserr<   r:   r;   projects_locations_operationsGet/DatastreamProjectsLocationsOperationsGetRequestr9   )
selfargsprivate_connection_ref
parent_ref	pc_clientresult_operationclientmessagesresource_parseroperation_refs
             r/   Run
Create.Runl   s    "]]==CCE'..0==?J#<<>I ''??T# ##%F%%'H,,.O#**2%**)44*66	 + 8M //33@@++ 	A 	-. .r2    N)__name__
__module____qualname____firstlineno____doc__r   r   detailed_helpstaticmethodr0   r6   rT   __static_attributes__rV   r2   r/   r   r   2   s=     0"-8D-,3 ,3\ 4 4.r2   r   FzpDatastream beta version is deprecated. Please use`gcloud datastream private-connections create` command instead.)
is_removedwarningc                   2    \ rS rSrSr\\S.r\S 5       r	Sr
g)
CreateBeta   r   r   c                 `    [         R                  U [        R                  R                  5        gr4   )r   r0   r   r    r!   r5   s    r/   r6   CreateBeta.Args   s      fd//445r2   rV   N)rW   rX   rY   rZ   r[   r   EXAMPLES_BETAr\   r]   r6   r^   rV   r2   r/   rb   rb      s#     0"-=I-6 6r2   rb   N)r[   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr	   r
   9googlecloudsdk.command_lib.datastream.private_connectionsr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   rf   DefaultUniverseOnlyReleaseTracksr    r&   Commandr   	Deprecater!   rb   rV   r2   r/   <module>rq      s    9 &  ' A 2 ( 7 ? W D G 8 D%%(()W.T\\ W. * W.t G
 D%%**+6 6 ,6r2   