44import typing as t
55import uuid
66
7- from globus_sdk import client , exc , paging , response
8- from globus_sdk ._missing import MISSING
7+ from globus_sdk import client , paging , response
98from globus_sdk .response import IterableJSONAPIResponse
109from globus_sdk .scopes import TransferScopes
1110from globus_sdk .services .transfer .errors import TransferAPIError
1211from globus_sdk .transport import RetryConfig
1312
14- from .data import CreateTunnelData
13+ from .data import TunnelCreateDocument , TunnelUpdateDocument
1514from .transport import TRANSFER_V2_DEFAULT_RETRY_CHECKS
1615
1716log = logging .getLogger (__name__ )
@@ -46,7 +45,7 @@ class TransferClientV2(client.BaseClient):
4645 for stream_access_point in page:
4746 print(stream_access_point["attributes"]["display_name"])
4847
49- .. automethodlist:: globus_sdk.TransferClient
48+ .. automethodlist:: globus_sdk.experimental.TransferClientV2
5049 """
5150
5251 service_name = "transfer"
@@ -62,7 +61,7 @@ def _register_standard_retry_checks(self, retry_config: RetryConfig) -> None:
6261
6362 def create_tunnel (
6463 self ,
65- data : dict [str , t .Any ] | CreateTunnelData ,
64+ data : dict [str , t .Any ] | TunnelCreateDocument ,
6665 ) -> response .GlobusHTTPResponse :
6766 """
6867 :param data: Parameters for the tunnel creation
@@ -73,7 +72,8 @@ def create_tunnel(
7372
7473 .. code-block:: python
7574
76- tc = globus_sdk.TrasferClientV2(...)
75+ tc = globus_sdk.experimental.TrasferClientV2(...)
76+ data = globus_sdk.experimental.TunnelCreateDocument(...)
7777 result = tc.create_tunnel(data)
7878 print(result["data"]["id"])
7979
@@ -82,30 +82,13 @@ def create_tunnel(
8282 ``POST /v2/tunnels``
8383 """
8484 log .debug ("TransferClientV2.create_tunnel(...)" )
85- try :
86- data_element = data ["data" ]
87- except KeyError as e :
88- raise exc .GlobusSDKUsageError (
89- "create_tunnel() body was malformed (missing the 'data' key). "
90- "Use CreateTunnelData to easily create correct documents."
91- ) from e
92-
93- try :
94- attributes = data_element ["attributes" ]
95- except KeyError :
96- data_element ["attributes" ] = {}
97- attributes = data_element ["attributes" ]
98- if attributes .get ("submission_id" , MISSING ) is MISSING :
99- log .debug ("create_tunnel auto-creating submission_id" )
100- attributes ["submission_id" ] = str (uuid .uuid1 ())
101-
10285 r = self .post ("/v2/tunnels" , data = data )
10386 return r
10487
10588 def update_tunnel (
10689 self ,
10790 tunnel_id : str | uuid .UUID ,
108- update_doc : dict [str , t .Any ],
91+ update_doc : dict [str , t .Any ] | TunnelUpdateDocument ,
10992 ) -> response .GlobusHTTPResponse :
11093 r"""
11194 :param tunnel_id: The ID of the Tunnel.
@@ -117,13 +100,8 @@ def update_tunnel(
117100
118101 .. code-block:: python
119102
120- tc = globus_sdk.TrasferClientV2(...)
121- "data" = {
122- "type": "Tunnel",
123- "attributes": {
124- "state": "STOPPING",
125- },
126- }
103+ tc = globus_sdk.experimental.TrasferClientV2(...)
104+ data = globus_sdk.experimental.TunnelUpdateDocument(...)
127105 result = tc.update_tunnel(tunnel_id, data)
128106 print(result["data"])
129107
@@ -152,7 +130,7 @@ def get_tunnel(
152130
153131 .. code-block:: python
154132
155- tc = globus_sdk.TrasferClientV2(...)
133+ tc = globus_sdk.experimental. TrasferClientV2(...)
156134 result = tc.show_tunnel(tunnel_id)
157135 print(result["data"])
158136
@@ -180,7 +158,7 @@ def delete_tunnel(
180158
181159 .. code-block:: python
182160
183- tc = globus_sdk.TrasferClientV2(...)
161+ tc = globus_sdk.experimental. TrasferClientV2(...)
184162 tc.delete_tunnel(tunnel_id)
185163
186164 .. tab-item:: API Info
@@ -208,7 +186,7 @@ def list_tunnels(
208186
209187 .. code-block:: python
210188
211- tc = globus_sdk.TrasferClientV2(...)
189+ tc = globus_sdk.experimental. TrasferClientV2(...)
212190 tc.list_tunnels(tunnel_id)
213191
214192 .. tab-item:: API Info
@@ -236,7 +214,7 @@ def get_tunnel_events(
236214
237215 .. code-block:: python
238216
239- tc = globus_sdk.TrasferClientV2(...)
217+ tc = globus_sdk.experimental. TrasferClientV2(...)
240218 result = tc.get_tunnel_events(tunnel_id)
241219 print(result["data"])
242220
@@ -269,7 +247,7 @@ def get_stream_access_point(
269247
270248 .. code-block:: python
271249
272- tc = globus_sdk.TrasferClientV2(...)
250+ tc = globus_sdk.experimental. TrasferClientV2(...)
273251 tc.get_stream_access_point(stream_ap_id)
274252
275253 .. tab-item:: API Info
@@ -302,7 +280,7 @@ def list_stream_access_points(
302280
303281 .. code-block:: python
304282
305- tc = globus_sdk.TrasferClientV2(...)
283+ tc = globus_sdk.experimental. TrasferClientV2(...)
306284 tc.list_stream_access_points()
307285
308286 .. tab-item:: API Info
0 commit comments