
                         ^    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 r	 " S S	5      r
g
)z1Cloud database migration private connections API.    )absolute_import)division)unicode_literals)api_util)	resourcesc                 r    [         R                  R                  U R                  SS9nUR	                  5       $ )Nz3datamigration.projects.locations.privateConnections)
collection)r   REGISTRYParseRelativeNamenameSelfLink)resourceprivate_connections     Dlib/googlecloudsdk/api_lib/database_migration/private_connections.pyGetPrivateConnectionURIr      s:     ));;mmF < H 
	$	$	&&    c                   8    \ rS rSrSrS	S jrS rS
S jrS rSr	g)PrivateConnectionsClient    z2Client for private connections service in the API.Nc                     U=(       d    [         R                  " U5      U l        U=(       d    [         R                  " U5      U l        U R                  R
                  U l        [         R                  " U5      U l        g N)	r   GetClientInstance_clientGetMessagesModule	_messages%projects_locations_privateConnections_serviceGetResourceParser_resource_parser)selfrelease_trackclientmessagess       r   __init__!PrivateConnectionsClient.__init__#   sT    FX77FDLJ!;!;M!JDNLLFFDM$66}EDr   c                    U R                   R                  U0 UR                  S9nUR                  S5      (       a*  U R                   R	                  UR
                  S9Ul        U$ 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)vpcNamesubnet)r   PrivateConnectiondisplay_nameIsKnownAndSpecifiedPscInterfaceConfigr)   pscInterfaceConfigCONCEPTSvpcParseVpcPeeringConfigRelativeNamer,   vpcPeeringConfig)r    private_connection_idargsprivate_connection_objvpc_peering_refs        r   _GetPrivateConnection.PrivateConnectionsClient._GetPrivateConnection)   s    !^^=="24;L;L > N 455
..
+
+ $ 7 7 ,  / "! ))//1o040O0O!..0 1P 1- "!r   c                 &   U R                  X#5      n[        R                  " 5       nU R                  R                  nU" UUR
                  UUUR                  S9nUR                  S5      (       a  SUl        U R                  R                  U5      $ )a}  Creates a private connection.

Args:
  parent_ref: a Resource reference to a parent
    datamigration.projects.locations resource for this private connection.
  private_connection_id: str, the name of the resource to create.
  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skip_validationT)r<   r   GenerateRequestIdr   =DatamigrationProjectsLocationsPrivateConnectionsCreateRequestr   validate_onlyr/   skipValidationr   Create)r    
parent_refr8   r9   r   
request_idcreate_req_type
create_reqs           r   rI   PrivateConnectionsClient.Create;   s     334IP++-JTT  !,.33'')J  122"&j==
++r   c                     [         R                  " 5       nU R                  R                  nU" XS9nU R                  R                  U5      $ )zDeletes a private connection.

Args:
  private_connection_name: str, the name of the resource to delete.

Returns:
  Operation: the operation for deleting the private connection.
)r   rB   )r   rE   r   =DatamigrationProjectsLocationsPrivateConnectionsDeleteRequestr   Delete)r    private_connection_namerK   delete_req_type
delete_reqs        r   rQ   PrivateConnectionsClient.DeleteZ   sJ     ++-J	F	F  !$<J ==
++r   )r   r   r   r   )NNr   )
__name__
__module____qualname____firstlineno____doc__r$   r<   rI   rQ   __static_attributes__ r   r   r   r       s    :F"$,>,r   r   N)rZ   
__future__r   r   r   )googlecloudsdk.api_lib.database_migrationr   googlecloudsdk.corer   r   r   r\   r   r   <module>r`      s*    8 &  ' > )'K, K,r   