
    9                     j    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 r " S	 S
5      rg)z)Cloud Datastream private connections API.    )absolute_import)division)unicode_literals)util)base)	resourcesc                 r    [         R                  R                  U R                  SS9nUR	                  5       $ )Nz0datastream.projects.locations.privateConnections)
collection)r   REGISTRYParseRelativeNamenameSelfLink)resourceprivate_connections     <lib/googlecloudsdk/api_lib/datastream/private_connections.pyGetPrivateConnectionURIr      s:     ));;mmC < E 
	$	$	&&    c                   2    \ rS rSrSrSS jrS rS	S jrSrg)
PrivateConnectionsClient!   z2Client for private connections service in the API.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    [         R                  " 5       U l        U R                  R
                  U l        [         R                  " 5       U l        g N)	r   GetClientInstance_clientGetMessagesModule	_messages%projects_locations_privateConnections_serviceGetResourceParser_resource_parser)selfclientmessagess      r   __init__!PrivateConnectionsClient.__init__$   sN    5T335DL9!7!7!9DNLLFFDM 224Dr   c                 $   U R                   R                  U0 UR                  S9n[        US5      (       a;  UR                  (       a*  U R                   R                  UR                  S9Ul        U$ U[        R                  R                  :X  a%  UR                  R                  R                  5       nO$UR                  R                  R                  5       nU R                   R                  UR                  5       UR                   S9Ul        U$ )z$Returns a private connection object.)r   labelsdisplayNamenetwork_attachment)networkAttachment)vpcsubnet)r   PrivateConnectiondisplay_namehasattrr)   PscInterfaceConfigpscInterfaceConfigr   ReleaseTrackBETACONCEPTSvpc_nameParser+   VpcPeeringConfigRelativeNamer,   vpcPeeringConfig)r!   private_connection_idrelease_trackargsprivate_connection_objvpc_peering_refs         r   _GetPrivateConnection.PrivateConnectionsClient._GetPrivateConnection*   s    !^^=="24;L;L > N t)**t/F/F
..
+
+ $ 7 7 ,  /  "! 
$++00	0--00668--++113040O0O**,T[[ 1P 1- "!r   c                     U R                  UX45      n[        R                  " 5       nU R                  R                  nU" UUR
                  UUUR                  S9nU R                  R                  U5      $ )a  Creates a private connection.

Args:
  parent_ref: a Resource reference to a parent datastream.projects.locations
    resource for this private connection.
  private_connection_id: str, the name of the resource to create.
  release_track: Some arguments are added based on the command release
    track.
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  Operation: the operation for creating the private connection.
)privateConnectionprivateConnectionIdparent	requestIdvalidateOnly)	r?   r   GenerateRequestIdr   :DatastreamProjectsLocationsPrivateConnectionsCreateRequestr   validate_onlyr   Create)	r!   
parent_refr:   r;   r<   r   
request_idcreate_req_type
create_reqs	            r   rJ   PrivateConnectionsClient.CreateB   s|      334I4AI '')JQQ  !,.33''J ==
++r   )r   r   r    r   )NNr   )	__name__
__module____qualname____firstlineno____doc__r$   r?   rJ   __static_attributes__ r   r   r   r   !   s    :5"0,r   r   N)rT   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   googlecloudsdk.callioper   googlecloudsdk.corer   r   r   rV   r   r   <module>r[      s-    0 &  ' 2 ( )'@, @,r   