stackit-vpn 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. src/stackit/vpn/__init__.py +145 -0
  2. src/stackit/vpn/api/__init__.py +4 -0
  3. src/stackit/vpn/api/default_api.py +3947 -0
  4. src/stackit/vpn/api_client.py +652 -0
  5. src/stackit/vpn/api_response.py +23 -0
  6. src/stackit/vpn/configuration.py +164 -0
  7. src/stackit/vpn/exceptions.py +217 -0
  8. src/stackit/vpn/models/__init__.py +58 -0
  9. src/stackit/vpn/models/api_error.py +104 -0
  10. src/stackit/vpn/models/api_error_detail.py +99 -0
  11. src/stackit/vpn/models/api_error_response.py +86 -0
  12. src/stackit/vpn/models/bgp_gateway_config.py +94 -0
  13. src/stackit/vpn/models/bgp_status.py +112 -0
  14. src/stackit/vpn/models/bgp_status_peers.py +97 -0
  15. src/stackit/vpn/models/bgp_status_routes.py +93 -0
  16. src/stackit/vpn/models/bgp_tunnel_config.py +84 -0
  17. src/stackit/vpn/models/connection_list.py +98 -0
  18. src/stackit/vpn/models/connection_response.py +149 -0
  19. src/stackit/vpn/models/connection_status_response.py +113 -0
  20. src/stackit/vpn/models/create_gateway_connection_payload.py +139 -0
  21. src/stackit/vpn/models/create_vpn_gateway_payload.py +124 -0
  22. src/stackit/vpn/models/create_vpn_gateway_payload_availability_zones.py +82 -0
  23. src/stackit/vpn/models/gateway.py +124 -0
  24. src/stackit/vpn/models/gateway_list.py +98 -0
  25. src/stackit/vpn/models/gateway_response.py +144 -0
  26. src/stackit/vpn/models/gateway_status.py +38 -0
  27. src/stackit/vpn/models/gateway_status_response.py +122 -0
  28. src/stackit/vpn/models/peering_config.py +103 -0
  29. src/stackit/vpn/models/phase.py +122 -0
  30. src/stackit/vpn/models/phase1_status.py +99 -0
  31. src/stackit/vpn/models/phase2_status.py +143 -0
  32. src/stackit/vpn/models/plan.py +101 -0
  33. src/stackit/vpn/models/plan_list.py +98 -0
  34. src/stackit/vpn/models/quota.py +82 -0
  35. src/stackit/vpn/models/quota_list.py +88 -0
  36. src/stackit/vpn/models/quota_list_response.py +88 -0
  37. src/stackit/vpn/models/region.py +36 -0
  38. src/stackit/vpn/models/routing_type.py +37 -0
  39. src/stackit/vpn/models/tunnel_configuration.py +124 -0
  40. src/stackit/vpn/models/tunnel_configuration_phase1.py +126 -0
  41. src/stackit/vpn/models/tunnel_configuration_phase2.py +165 -0
  42. src/stackit/vpn/models/tunnel_status.py +110 -0
  43. src/stackit/vpn/models/update_gateway_connection_payload.py +139 -0
  44. src/stackit/vpn/models/update_vpn_gateway_payload.py +124 -0
  45. src/stackit/vpn/models/vpn_tunnels.py +114 -0
  46. src/stackit/vpn/py.typed +0 -0
  47. src/stackit/vpn/rest.py +164 -0
  48. stackit_vpn-0.1.0.dist-info/METADATA +53 -0
  49. stackit_vpn-0.1.0.dist-info/RECORD +52 -0
  50. stackit_vpn-0.1.0.dist-info/WHEEL +4 -0
  51. stackit_vpn-0.1.0.dist-info/licenses/LICENSE.md +201 -0
  52. stackit_vpn-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
@@ -0,0 +1,3947 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT VPN API
5
+
6
+ Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec
7
+
8
+ The version of the OpenAPI document: 1beta1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from typing import Any, Dict, List, Optional, Tuple, Union
15
+ from uuid import UUID
16
+
17
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
+ from stackit.core.configuration import Configuration
19
+ from typing_extensions import Annotated
20
+
21
+ from stackit.vpn.api_client import ApiClient, RequestSerialized
22
+ from stackit.vpn.api_response import ApiResponse
23
+ from stackit.vpn.models.connection_list import ConnectionList
24
+ from stackit.vpn.models.connection_response import ConnectionResponse
25
+ from stackit.vpn.models.connection_status_response import ConnectionStatusResponse
26
+ from stackit.vpn.models.create_gateway_connection_payload import (
27
+ CreateGatewayConnectionPayload,
28
+ )
29
+ from stackit.vpn.models.create_vpn_gateway_payload import CreateVPNGatewayPayload
30
+ from stackit.vpn.models.gateway_list import GatewayList
31
+ from stackit.vpn.models.gateway_response import GatewayResponse
32
+ from stackit.vpn.models.gateway_status_response import GatewayStatusResponse
33
+ from stackit.vpn.models.plan_list import PlanList
34
+ from stackit.vpn.models.quota_list_response import QuotaListResponse
35
+ from stackit.vpn.models.region import Region
36
+ from stackit.vpn.models.update_gateway_connection_payload import (
37
+ UpdateGatewayConnectionPayload,
38
+ )
39
+ from stackit.vpn.models.update_vpn_gateway_payload import UpdateVPNGatewayPayload
40
+ from stackit.vpn.rest import RESTResponseType
41
+
42
+
43
+ class DefaultApi:
44
+ """NOTE: This class is auto generated by OpenAPI Generator
45
+ Ref: https://openapi-generator.tech
46
+
47
+ Do not edit the class manually.
48
+ """
49
+
50
+ def __init__(self, configuration: Configuration = None) -> None:
51
+ if configuration is None:
52
+ configuration = Configuration()
53
+ self.configuration = configuration
54
+ self.api_client = ApiClient(self.configuration)
55
+
56
+ @validate_call
57
+ def create_gateway_connection(
58
+ self,
59
+ project_id: StrictStr,
60
+ region: Region,
61
+ gateway_id: UUID,
62
+ create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None,
63
+ _request_timeout: Union[
64
+ None,
65
+ Annotated[StrictFloat, Field(gt=0)],
66
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
67
+ ] = None,
68
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
69
+ _content_type: Optional[StrictStr] = None,
70
+ _headers: Optional[Dict[StrictStr, Any]] = None,
71
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
72
+ ) -> ConnectionResponse:
73
+ """Create a new connection on an existing VPN gateway.
74
+
75
+ Create a new connection on an existing VPN gateway.
76
+
77
+ :param project_id: (required)
78
+ :type project_id: str
79
+ :param region: (required)
80
+ :type region: Region
81
+ :param gateway_id: (required)
82
+ :type gateway_id: UUID
83
+ :param create_gateway_connection_payload:
84
+ :type create_gateway_connection_payload: CreateGatewayConnectionPayload
85
+ :param _request_timeout: timeout setting for this request. If one
86
+ number provided, it will be total request
87
+ timeout. It can also be a pair (tuple) of
88
+ (connection, read) timeouts.
89
+ :type _request_timeout: int, tuple(int, int), optional
90
+ :param _request_auth: set to override the auth_settings for an a single
91
+ request; this effectively ignores the
92
+ authentication in the spec for a single request.
93
+ :type _request_auth: dict, optional
94
+ :param _content_type: force content-type for the request.
95
+ :type _content_type: str, Optional
96
+ :param _headers: set to override the headers for a single
97
+ request; this effectively ignores the headers
98
+ in the spec for a single request.
99
+ :type _headers: dict, optional
100
+ :param _host_index: set to override the host_index for a single
101
+ request; this effectively ignores the host_index
102
+ in the spec for a single request.
103
+ :type _host_index: int, optional
104
+ :return: Returns the result object.
105
+ """ # noqa: E501
106
+
107
+ _param = self._create_gateway_connection_serialize(
108
+ project_id=project_id,
109
+ region=region,
110
+ gateway_id=gateway_id,
111
+ create_gateway_connection_payload=create_gateway_connection_payload,
112
+ _request_auth=_request_auth,
113
+ _content_type=_content_type,
114
+ _headers=_headers,
115
+ _host_index=_host_index,
116
+ )
117
+
118
+ _response_types_map: Dict[str, Optional[str]] = {
119
+ "200": "ConnectionResponse",
120
+ "400": "APIErrorResponse",
121
+ "401": "APIErrorResponse",
122
+ "403": "APIErrorResponse",
123
+ "404": "APIErrorResponse",
124
+ "500": "APIErrorResponse",
125
+ }
126
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
127
+ response_data.read()
128
+ return self.api_client.response_deserialize(
129
+ response_data=response_data,
130
+ response_types_map=_response_types_map,
131
+ ).data
132
+
133
+ @validate_call
134
+ def create_gateway_connection_with_http_info(
135
+ self,
136
+ project_id: StrictStr,
137
+ region: Region,
138
+ gateway_id: UUID,
139
+ create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None,
140
+ _request_timeout: Union[
141
+ None,
142
+ Annotated[StrictFloat, Field(gt=0)],
143
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
144
+ ] = None,
145
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
146
+ _content_type: Optional[StrictStr] = None,
147
+ _headers: Optional[Dict[StrictStr, Any]] = None,
148
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
149
+ ) -> ApiResponse[ConnectionResponse]:
150
+ """Create a new connection on an existing VPN gateway.
151
+
152
+ Create a new connection on an existing VPN gateway.
153
+
154
+ :param project_id: (required)
155
+ :type project_id: str
156
+ :param region: (required)
157
+ :type region: Region
158
+ :param gateway_id: (required)
159
+ :type gateway_id: UUID
160
+ :param create_gateway_connection_payload:
161
+ :type create_gateway_connection_payload: CreateGatewayConnectionPayload
162
+ :param _request_timeout: timeout setting for this request. If one
163
+ number provided, it will be total request
164
+ timeout. It can also be a pair (tuple) of
165
+ (connection, read) timeouts.
166
+ :type _request_timeout: int, tuple(int, int), optional
167
+ :param _request_auth: set to override the auth_settings for an a single
168
+ request; this effectively ignores the
169
+ authentication in the spec for a single request.
170
+ :type _request_auth: dict, optional
171
+ :param _content_type: force content-type for the request.
172
+ :type _content_type: str, Optional
173
+ :param _headers: set to override the headers for a single
174
+ request; this effectively ignores the headers
175
+ in the spec for a single request.
176
+ :type _headers: dict, optional
177
+ :param _host_index: set to override the host_index for a single
178
+ request; this effectively ignores the host_index
179
+ in the spec for a single request.
180
+ :type _host_index: int, optional
181
+ :return: Returns the result object.
182
+ """ # noqa: E501
183
+
184
+ _param = self._create_gateway_connection_serialize(
185
+ project_id=project_id,
186
+ region=region,
187
+ gateway_id=gateway_id,
188
+ create_gateway_connection_payload=create_gateway_connection_payload,
189
+ _request_auth=_request_auth,
190
+ _content_type=_content_type,
191
+ _headers=_headers,
192
+ _host_index=_host_index,
193
+ )
194
+
195
+ _response_types_map: Dict[str, Optional[str]] = {
196
+ "200": "ConnectionResponse",
197
+ "400": "APIErrorResponse",
198
+ "401": "APIErrorResponse",
199
+ "403": "APIErrorResponse",
200
+ "404": "APIErrorResponse",
201
+ "500": "APIErrorResponse",
202
+ }
203
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
204
+ response_data.read()
205
+ return self.api_client.response_deserialize(
206
+ response_data=response_data,
207
+ response_types_map=_response_types_map,
208
+ )
209
+
210
+ @validate_call
211
+ def create_gateway_connection_without_preload_content(
212
+ self,
213
+ project_id: StrictStr,
214
+ region: Region,
215
+ gateway_id: UUID,
216
+ create_gateway_connection_payload: Optional[CreateGatewayConnectionPayload] = None,
217
+ _request_timeout: Union[
218
+ None,
219
+ Annotated[StrictFloat, Field(gt=0)],
220
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
221
+ ] = None,
222
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
223
+ _content_type: Optional[StrictStr] = None,
224
+ _headers: Optional[Dict[StrictStr, Any]] = None,
225
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
226
+ ) -> RESTResponseType:
227
+ """Create a new connection on an existing VPN gateway.
228
+
229
+ Create a new connection on an existing VPN gateway.
230
+
231
+ :param project_id: (required)
232
+ :type project_id: str
233
+ :param region: (required)
234
+ :type region: Region
235
+ :param gateway_id: (required)
236
+ :type gateway_id: UUID
237
+ :param create_gateway_connection_payload:
238
+ :type create_gateway_connection_payload: CreateGatewayConnectionPayload
239
+ :param _request_timeout: timeout setting for this request. If one
240
+ number provided, it will be total request
241
+ timeout. It can also be a pair (tuple) of
242
+ (connection, read) timeouts.
243
+ :type _request_timeout: int, tuple(int, int), optional
244
+ :param _request_auth: set to override the auth_settings for an a single
245
+ request; this effectively ignores the
246
+ authentication in the spec for a single request.
247
+ :type _request_auth: dict, optional
248
+ :param _content_type: force content-type for the request.
249
+ :type _content_type: str, Optional
250
+ :param _headers: set to override the headers for a single
251
+ request; this effectively ignores the headers
252
+ in the spec for a single request.
253
+ :type _headers: dict, optional
254
+ :param _host_index: set to override the host_index for a single
255
+ request; this effectively ignores the host_index
256
+ in the spec for a single request.
257
+ :type _host_index: int, optional
258
+ :return: Returns the result object.
259
+ """ # noqa: E501
260
+
261
+ _param = self._create_gateway_connection_serialize(
262
+ project_id=project_id,
263
+ region=region,
264
+ gateway_id=gateway_id,
265
+ create_gateway_connection_payload=create_gateway_connection_payload,
266
+ _request_auth=_request_auth,
267
+ _content_type=_content_type,
268
+ _headers=_headers,
269
+ _host_index=_host_index,
270
+ )
271
+
272
+ _response_types_map: Dict[str, Optional[str]] = {
273
+ "200": "ConnectionResponse",
274
+ "400": "APIErrorResponse",
275
+ "401": "APIErrorResponse",
276
+ "403": "APIErrorResponse",
277
+ "404": "APIErrorResponse",
278
+ "500": "APIErrorResponse",
279
+ }
280
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
281
+ return response_data.response
282
+
283
+ def _create_gateway_connection_serialize(
284
+ self,
285
+ project_id,
286
+ region,
287
+ gateway_id,
288
+ create_gateway_connection_payload,
289
+ _request_auth,
290
+ _content_type,
291
+ _headers,
292
+ _host_index,
293
+ ) -> RequestSerialized:
294
+
295
+ _host = None
296
+
297
+ _collection_formats: Dict[str, str] = {}
298
+
299
+ _path_params: Dict[str, str] = {}
300
+ _query_params: List[Tuple[str, str]] = []
301
+ _header_params: Dict[str, Optional[str]] = _headers or {}
302
+ _form_params: List[Tuple[str, str]] = []
303
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
304
+ _body_params: Optional[bytes] = None
305
+
306
+ # process the path parameters
307
+ if project_id is not None:
308
+ _path_params["projectId"] = project_id
309
+ if region is not None:
310
+ _path_params["region"] = region.value
311
+ if gateway_id is not None:
312
+ _path_params["gatewayId"] = gateway_id
313
+ # process the query parameters
314
+ # process the header parameters
315
+ # process the form parameters
316
+ # process the body parameter
317
+ if create_gateway_connection_payload is not None:
318
+ _body_params = create_gateway_connection_payload
319
+
320
+ # set the HTTP header `Accept`
321
+ if "Accept" not in _header_params:
322
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
323
+
324
+ # set the HTTP header `Content-Type`
325
+ if _content_type:
326
+ _header_params["Content-Type"] = _content_type
327
+ else:
328
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
329
+ if _default_content_type is not None:
330
+ _header_params["Content-Type"] = _default_content_type
331
+
332
+ # authentication setting
333
+ _auth_settings: List[str] = []
334
+
335
+ return self.api_client.param_serialize(
336
+ method="POST",
337
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
338
+ path_params=_path_params,
339
+ query_params=_query_params,
340
+ header_params=_header_params,
341
+ body=_body_params,
342
+ post_params=_form_params,
343
+ files=_files,
344
+ auth_settings=_auth_settings,
345
+ collection_formats=_collection_formats,
346
+ _host=_host,
347
+ _request_auth=_request_auth,
348
+ )
349
+
350
+ @validate_call
351
+ def create_vpn_gateway(
352
+ self,
353
+ project_id: StrictStr,
354
+ region: Region,
355
+ create_vpn_gateway_payload: CreateVPNGatewayPayload,
356
+ _request_timeout: Union[
357
+ None,
358
+ Annotated[StrictFloat, Field(gt=0)],
359
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
360
+ ] = None,
361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
362
+ _content_type: Optional[StrictStr] = None,
363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
365
+ ) -> GatewayResponse:
366
+ """Create a VPN gateway in a project.
367
+
368
+ Provision a new VPN gateway.
369
+
370
+ :param project_id: (required)
371
+ :type project_id: str
372
+ :param region: (required)
373
+ :type region: Region
374
+ :param create_vpn_gateway_payload: (required)
375
+ :type create_vpn_gateway_payload: CreateVPNGatewayPayload
376
+ :param _request_timeout: timeout setting for this request. If one
377
+ number provided, it will be total request
378
+ timeout. It can also be a pair (tuple) of
379
+ (connection, read) timeouts.
380
+ :type _request_timeout: int, tuple(int, int), optional
381
+ :param _request_auth: set to override the auth_settings for an a single
382
+ request; this effectively ignores the
383
+ authentication in the spec for a single request.
384
+ :type _request_auth: dict, optional
385
+ :param _content_type: force content-type for the request.
386
+ :type _content_type: str, Optional
387
+ :param _headers: set to override the headers for a single
388
+ request; this effectively ignores the headers
389
+ in the spec for a single request.
390
+ :type _headers: dict, optional
391
+ :param _host_index: set to override the host_index for a single
392
+ request; this effectively ignores the host_index
393
+ in the spec for a single request.
394
+ :type _host_index: int, optional
395
+ :return: Returns the result object.
396
+ """ # noqa: E501
397
+
398
+ _param = self._create_vpn_gateway_serialize(
399
+ project_id=project_id,
400
+ region=region,
401
+ create_vpn_gateway_payload=create_vpn_gateway_payload,
402
+ _request_auth=_request_auth,
403
+ _content_type=_content_type,
404
+ _headers=_headers,
405
+ _host_index=_host_index,
406
+ )
407
+
408
+ _response_types_map: Dict[str, Optional[str]] = {
409
+ "201": "GatewayResponse",
410
+ "400": "APIErrorResponse",
411
+ "401": "APIErrorResponse",
412
+ "403": "APIErrorResponse",
413
+ "409": "APIErrorResponse",
414
+ "500": "APIErrorResponse",
415
+ }
416
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
417
+ response_data.read()
418
+ return self.api_client.response_deserialize(
419
+ response_data=response_data,
420
+ response_types_map=_response_types_map,
421
+ ).data
422
+
423
+ @validate_call
424
+ def create_vpn_gateway_with_http_info(
425
+ self,
426
+ project_id: StrictStr,
427
+ region: Region,
428
+ create_vpn_gateway_payload: CreateVPNGatewayPayload,
429
+ _request_timeout: Union[
430
+ None,
431
+ Annotated[StrictFloat, Field(gt=0)],
432
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
433
+ ] = None,
434
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
435
+ _content_type: Optional[StrictStr] = None,
436
+ _headers: Optional[Dict[StrictStr, Any]] = None,
437
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
438
+ ) -> ApiResponse[GatewayResponse]:
439
+ """Create a VPN gateway in a project.
440
+
441
+ Provision a new VPN gateway.
442
+
443
+ :param project_id: (required)
444
+ :type project_id: str
445
+ :param region: (required)
446
+ :type region: Region
447
+ :param create_vpn_gateway_payload: (required)
448
+ :type create_vpn_gateway_payload: CreateVPNGatewayPayload
449
+ :param _request_timeout: timeout setting for this request. If one
450
+ number provided, it will be total request
451
+ timeout. It can also be a pair (tuple) of
452
+ (connection, read) timeouts.
453
+ :type _request_timeout: int, tuple(int, int), optional
454
+ :param _request_auth: set to override the auth_settings for an a single
455
+ request; this effectively ignores the
456
+ authentication in the spec for a single request.
457
+ :type _request_auth: dict, optional
458
+ :param _content_type: force content-type for the request.
459
+ :type _content_type: str, Optional
460
+ :param _headers: set to override the headers for a single
461
+ request; this effectively ignores the headers
462
+ in the spec for a single request.
463
+ :type _headers: dict, optional
464
+ :param _host_index: set to override the host_index for a single
465
+ request; this effectively ignores the host_index
466
+ in the spec for a single request.
467
+ :type _host_index: int, optional
468
+ :return: Returns the result object.
469
+ """ # noqa: E501
470
+
471
+ _param = self._create_vpn_gateway_serialize(
472
+ project_id=project_id,
473
+ region=region,
474
+ create_vpn_gateway_payload=create_vpn_gateway_payload,
475
+ _request_auth=_request_auth,
476
+ _content_type=_content_type,
477
+ _headers=_headers,
478
+ _host_index=_host_index,
479
+ )
480
+
481
+ _response_types_map: Dict[str, Optional[str]] = {
482
+ "201": "GatewayResponse",
483
+ "400": "APIErrorResponse",
484
+ "401": "APIErrorResponse",
485
+ "403": "APIErrorResponse",
486
+ "409": "APIErrorResponse",
487
+ "500": "APIErrorResponse",
488
+ }
489
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
490
+ response_data.read()
491
+ return self.api_client.response_deserialize(
492
+ response_data=response_data,
493
+ response_types_map=_response_types_map,
494
+ )
495
+
496
+ @validate_call
497
+ def create_vpn_gateway_without_preload_content(
498
+ self,
499
+ project_id: StrictStr,
500
+ region: Region,
501
+ create_vpn_gateway_payload: CreateVPNGatewayPayload,
502
+ _request_timeout: Union[
503
+ None,
504
+ Annotated[StrictFloat, Field(gt=0)],
505
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
506
+ ] = None,
507
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
508
+ _content_type: Optional[StrictStr] = None,
509
+ _headers: Optional[Dict[StrictStr, Any]] = None,
510
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
511
+ ) -> RESTResponseType:
512
+ """Create a VPN gateway in a project.
513
+
514
+ Provision a new VPN gateway.
515
+
516
+ :param project_id: (required)
517
+ :type project_id: str
518
+ :param region: (required)
519
+ :type region: Region
520
+ :param create_vpn_gateway_payload: (required)
521
+ :type create_vpn_gateway_payload: CreateVPNGatewayPayload
522
+ :param _request_timeout: timeout setting for this request. If one
523
+ number provided, it will be total request
524
+ timeout. It can also be a pair (tuple) of
525
+ (connection, read) timeouts.
526
+ :type _request_timeout: int, tuple(int, int), optional
527
+ :param _request_auth: set to override the auth_settings for an a single
528
+ request; this effectively ignores the
529
+ authentication in the spec for a single request.
530
+ :type _request_auth: dict, optional
531
+ :param _content_type: force content-type for the request.
532
+ :type _content_type: str, Optional
533
+ :param _headers: set to override the headers for a single
534
+ request; this effectively ignores the headers
535
+ in the spec for a single request.
536
+ :type _headers: dict, optional
537
+ :param _host_index: set to override the host_index for a single
538
+ request; this effectively ignores the host_index
539
+ in the spec for a single request.
540
+ :type _host_index: int, optional
541
+ :return: Returns the result object.
542
+ """ # noqa: E501
543
+
544
+ _param = self._create_vpn_gateway_serialize(
545
+ project_id=project_id,
546
+ region=region,
547
+ create_vpn_gateway_payload=create_vpn_gateway_payload,
548
+ _request_auth=_request_auth,
549
+ _content_type=_content_type,
550
+ _headers=_headers,
551
+ _host_index=_host_index,
552
+ )
553
+
554
+ _response_types_map: Dict[str, Optional[str]] = {
555
+ "201": "GatewayResponse",
556
+ "400": "APIErrorResponse",
557
+ "401": "APIErrorResponse",
558
+ "403": "APIErrorResponse",
559
+ "409": "APIErrorResponse",
560
+ "500": "APIErrorResponse",
561
+ }
562
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
563
+ return response_data.response
564
+
565
+ def _create_vpn_gateway_serialize(
566
+ self,
567
+ project_id,
568
+ region,
569
+ create_vpn_gateway_payload,
570
+ _request_auth,
571
+ _content_type,
572
+ _headers,
573
+ _host_index,
574
+ ) -> RequestSerialized:
575
+
576
+ _host = None
577
+
578
+ _collection_formats: Dict[str, str] = {}
579
+
580
+ _path_params: Dict[str, str] = {}
581
+ _query_params: List[Tuple[str, str]] = []
582
+ _header_params: Dict[str, Optional[str]] = _headers or {}
583
+ _form_params: List[Tuple[str, str]] = []
584
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
585
+ _body_params: Optional[bytes] = None
586
+
587
+ # process the path parameters
588
+ if project_id is not None:
589
+ _path_params["projectId"] = project_id
590
+ if region is not None:
591
+ _path_params["region"] = region.value
592
+ # process the query parameters
593
+ # process the header parameters
594
+ # process the form parameters
595
+ # process the body parameter
596
+ if create_vpn_gateway_payload is not None:
597
+ _body_params = create_vpn_gateway_payload
598
+
599
+ # set the HTTP header `Accept`
600
+ if "Accept" not in _header_params:
601
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
602
+
603
+ # set the HTTP header `Content-Type`
604
+ if _content_type:
605
+ _header_params["Content-Type"] = _content_type
606
+ else:
607
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
608
+ if _default_content_type is not None:
609
+ _header_params["Content-Type"] = _default_content_type
610
+
611
+ # authentication setting
612
+ _auth_settings: List[str] = []
613
+
614
+ return self.api_client.param_serialize(
615
+ method="POST",
616
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways",
617
+ path_params=_path_params,
618
+ query_params=_query_params,
619
+ header_params=_header_params,
620
+ body=_body_params,
621
+ post_params=_form_params,
622
+ files=_files,
623
+ auth_settings=_auth_settings,
624
+ collection_formats=_collection_formats,
625
+ _host=_host,
626
+ _request_auth=_request_auth,
627
+ )
628
+
629
+ @validate_call
630
+ def delete_gateway_connection(
631
+ self,
632
+ project_id: StrictStr,
633
+ region: Region,
634
+ gateway_id: UUID,
635
+ connection_id: StrictStr,
636
+ _request_timeout: Union[
637
+ None,
638
+ Annotated[StrictFloat, Field(gt=0)],
639
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
640
+ ] = None,
641
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
642
+ _content_type: Optional[StrictStr] = None,
643
+ _headers: Optional[Dict[StrictStr, Any]] = None,
644
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
645
+ ) -> None:
646
+ """Delete a certain connection from an existing VPN gateway.
647
+
648
+ Delete a certain connection from an existing VPN gateway.
649
+
650
+ :param project_id: (required)
651
+ :type project_id: str
652
+ :param region: (required)
653
+ :type region: Region
654
+ :param gateway_id: (required)
655
+ :type gateway_id: UUID
656
+ :param connection_id: (required)
657
+ :type connection_id: str
658
+ :param _request_timeout: timeout setting for this request. If one
659
+ number provided, it will be total request
660
+ timeout. It can also be a pair (tuple) of
661
+ (connection, read) timeouts.
662
+ :type _request_timeout: int, tuple(int, int), optional
663
+ :param _request_auth: set to override the auth_settings for an a single
664
+ request; this effectively ignores the
665
+ authentication in the spec for a single request.
666
+ :type _request_auth: dict, optional
667
+ :param _content_type: force content-type for the request.
668
+ :type _content_type: str, Optional
669
+ :param _headers: set to override the headers for a single
670
+ request; this effectively ignores the headers
671
+ in the spec for a single request.
672
+ :type _headers: dict, optional
673
+ :param _host_index: set to override the host_index for a single
674
+ request; this effectively ignores the host_index
675
+ in the spec for a single request.
676
+ :type _host_index: int, optional
677
+ :return: Returns the result object.
678
+ """ # noqa: E501
679
+
680
+ _param = self._delete_gateway_connection_serialize(
681
+ project_id=project_id,
682
+ region=region,
683
+ gateway_id=gateway_id,
684
+ connection_id=connection_id,
685
+ _request_auth=_request_auth,
686
+ _content_type=_content_type,
687
+ _headers=_headers,
688
+ _host_index=_host_index,
689
+ )
690
+
691
+ _response_types_map: Dict[str, Optional[str]] = {
692
+ "200": None,
693
+ "400": "APIErrorResponse",
694
+ "401": "APIErrorResponse",
695
+ "403": "APIErrorResponse",
696
+ "404": "APIErrorResponse",
697
+ "500": "APIErrorResponse",
698
+ }
699
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
700
+ response_data.read()
701
+ return self.api_client.response_deserialize(
702
+ response_data=response_data,
703
+ response_types_map=_response_types_map,
704
+ ).data
705
+
706
+ @validate_call
707
+ def delete_gateway_connection_with_http_info(
708
+ self,
709
+ project_id: StrictStr,
710
+ region: Region,
711
+ gateway_id: UUID,
712
+ connection_id: StrictStr,
713
+ _request_timeout: Union[
714
+ None,
715
+ Annotated[StrictFloat, Field(gt=0)],
716
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
717
+ ] = None,
718
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
719
+ _content_type: Optional[StrictStr] = None,
720
+ _headers: Optional[Dict[StrictStr, Any]] = None,
721
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
722
+ ) -> ApiResponse[None]:
723
+ """Delete a certain connection from an existing VPN gateway.
724
+
725
+ Delete a certain connection from an existing VPN gateway.
726
+
727
+ :param project_id: (required)
728
+ :type project_id: str
729
+ :param region: (required)
730
+ :type region: Region
731
+ :param gateway_id: (required)
732
+ :type gateway_id: UUID
733
+ :param connection_id: (required)
734
+ :type connection_id: str
735
+ :param _request_timeout: timeout setting for this request. If one
736
+ number provided, it will be total request
737
+ timeout. It can also be a pair (tuple) of
738
+ (connection, read) timeouts.
739
+ :type _request_timeout: int, tuple(int, int), optional
740
+ :param _request_auth: set to override the auth_settings for an a single
741
+ request; this effectively ignores the
742
+ authentication in the spec for a single request.
743
+ :type _request_auth: dict, optional
744
+ :param _content_type: force content-type for the request.
745
+ :type _content_type: str, Optional
746
+ :param _headers: set to override the headers for a single
747
+ request; this effectively ignores the headers
748
+ in the spec for a single request.
749
+ :type _headers: dict, optional
750
+ :param _host_index: set to override the host_index for a single
751
+ request; this effectively ignores the host_index
752
+ in the spec for a single request.
753
+ :type _host_index: int, optional
754
+ :return: Returns the result object.
755
+ """ # noqa: E501
756
+
757
+ _param = self._delete_gateway_connection_serialize(
758
+ project_id=project_id,
759
+ region=region,
760
+ gateway_id=gateway_id,
761
+ connection_id=connection_id,
762
+ _request_auth=_request_auth,
763
+ _content_type=_content_type,
764
+ _headers=_headers,
765
+ _host_index=_host_index,
766
+ )
767
+
768
+ _response_types_map: Dict[str, Optional[str]] = {
769
+ "200": None,
770
+ "400": "APIErrorResponse",
771
+ "401": "APIErrorResponse",
772
+ "403": "APIErrorResponse",
773
+ "404": "APIErrorResponse",
774
+ "500": "APIErrorResponse",
775
+ }
776
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
777
+ response_data.read()
778
+ return self.api_client.response_deserialize(
779
+ response_data=response_data,
780
+ response_types_map=_response_types_map,
781
+ )
782
+
783
+ @validate_call
784
+ def delete_gateway_connection_without_preload_content(
785
+ self,
786
+ project_id: StrictStr,
787
+ region: Region,
788
+ gateway_id: UUID,
789
+ connection_id: StrictStr,
790
+ _request_timeout: Union[
791
+ None,
792
+ Annotated[StrictFloat, Field(gt=0)],
793
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
794
+ ] = None,
795
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
796
+ _content_type: Optional[StrictStr] = None,
797
+ _headers: Optional[Dict[StrictStr, Any]] = None,
798
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
799
+ ) -> RESTResponseType:
800
+ """Delete a certain connection from an existing VPN gateway.
801
+
802
+ Delete a certain connection from an existing VPN gateway.
803
+
804
+ :param project_id: (required)
805
+ :type project_id: str
806
+ :param region: (required)
807
+ :type region: Region
808
+ :param gateway_id: (required)
809
+ :type gateway_id: UUID
810
+ :param connection_id: (required)
811
+ :type connection_id: str
812
+ :param _request_timeout: timeout setting for this request. If one
813
+ number provided, it will be total request
814
+ timeout. It can also be a pair (tuple) of
815
+ (connection, read) timeouts.
816
+ :type _request_timeout: int, tuple(int, int), optional
817
+ :param _request_auth: set to override the auth_settings for an a single
818
+ request; this effectively ignores the
819
+ authentication in the spec for a single request.
820
+ :type _request_auth: dict, optional
821
+ :param _content_type: force content-type for the request.
822
+ :type _content_type: str, Optional
823
+ :param _headers: set to override the headers for a single
824
+ request; this effectively ignores the headers
825
+ in the spec for a single request.
826
+ :type _headers: dict, optional
827
+ :param _host_index: set to override the host_index for a single
828
+ request; this effectively ignores the host_index
829
+ in the spec for a single request.
830
+ :type _host_index: int, optional
831
+ :return: Returns the result object.
832
+ """ # noqa: E501
833
+
834
+ _param = self._delete_gateway_connection_serialize(
835
+ project_id=project_id,
836
+ region=region,
837
+ gateway_id=gateway_id,
838
+ connection_id=connection_id,
839
+ _request_auth=_request_auth,
840
+ _content_type=_content_type,
841
+ _headers=_headers,
842
+ _host_index=_host_index,
843
+ )
844
+
845
+ _response_types_map: Dict[str, Optional[str]] = {
846
+ "200": None,
847
+ "400": "APIErrorResponse",
848
+ "401": "APIErrorResponse",
849
+ "403": "APIErrorResponse",
850
+ "404": "APIErrorResponse",
851
+ "500": "APIErrorResponse",
852
+ }
853
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
854
+ return response_data.response
855
+
856
+ def _delete_gateway_connection_serialize(
857
+ self,
858
+ project_id,
859
+ region,
860
+ gateway_id,
861
+ connection_id,
862
+ _request_auth,
863
+ _content_type,
864
+ _headers,
865
+ _host_index,
866
+ ) -> RequestSerialized:
867
+
868
+ _host = None
869
+
870
+ _collection_formats: Dict[str, str] = {}
871
+
872
+ _path_params: Dict[str, str] = {}
873
+ _query_params: List[Tuple[str, str]] = []
874
+ _header_params: Dict[str, Optional[str]] = _headers or {}
875
+ _form_params: List[Tuple[str, str]] = []
876
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
877
+ _body_params: Optional[bytes] = None
878
+
879
+ # process the path parameters
880
+ if project_id is not None:
881
+ _path_params["projectId"] = project_id
882
+ if region is not None:
883
+ _path_params["region"] = region.value
884
+ if gateway_id is not None:
885
+ _path_params["gatewayId"] = gateway_id
886
+ if connection_id is not None:
887
+ _path_params["connectionId"] = connection_id
888
+ # process the query parameters
889
+ # process the header parameters
890
+ # process the form parameters
891
+ # process the body parameter
892
+
893
+ # set the HTTP header `Accept`
894
+ if "Accept" not in _header_params:
895
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
896
+
897
+ # authentication setting
898
+ _auth_settings: List[str] = []
899
+
900
+ return self.api_client.param_serialize(
901
+ method="DELETE",
902
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
903
+ path_params=_path_params,
904
+ query_params=_query_params,
905
+ header_params=_header_params,
906
+ body=_body_params,
907
+ post_params=_form_params,
908
+ files=_files,
909
+ auth_settings=_auth_settings,
910
+ collection_formats=_collection_formats,
911
+ _host=_host,
912
+ _request_auth=_request_auth,
913
+ )
914
+
915
+ @validate_call
916
+ def delete_vpn_gateway(
917
+ self,
918
+ project_id: StrictStr,
919
+ region: Region,
920
+ gateway_id: UUID,
921
+ _request_timeout: Union[
922
+ None,
923
+ Annotated[StrictFloat, Field(gt=0)],
924
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
925
+ ] = None,
926
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
927
+ _content_type: Optional[StrictStr] = None,
928
+ _headers: Optional[Dict[StrictStr, Any]] = None,
929
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
930
+ ) -> None:
931
+ """Delete a existing VPN gateway in a project.
932
+
933
+ Permanently remove a VPN gateway and all its associated connections. This operation is irreversible.
934
+
935
+ :param project_id: (required)
936
+ :type project_id: str
937
+ :param region: (required)
938
+ :type region: Region
939
+ :param gateway_id: (required)
940
+ :type gateway_id: UUID
941
+ :param _request_timeout: timeout setting for this request. If one
942
+ number provided, it will be total request
943
+ timeout. It can also be a pair (tuple) of
944
+ (connection, read) timeouts.
945
+ :type _request_timeout: int, tuple(int, int), optional
946
+ :param _request_auth: set to override the auth_settings for an a single
947
+ request; this effectively ignores the
948
+ authentication in the spec for a single request.
949
+ :type _request_auth: dict, optional
950
+ :param _content_type: force content-type for the request.
951
+ :type _content_type: str, Optional
952
+ :param _headers: set to override the headers for a single
953
+ request; this effectively ignores the headers
954
+ in the spec for a single request.
955
+ :type _headers: dict, optional
956
+ :param _host_index: set to override the host_index for a single
957
+ request; this effectively ignores the host_index
958
+ in the spec for a single request.
959
+ :type _host_index: int, optional
960
+ :return: Returns the result object.
961
+ """ # noqa: E501
962
+
963
+ _param = self._delete_vpn_gateway_serialize(
964
+ project_id=project_id,
965
+ region=region,
966
+ gateway_id=gateway_id,
967
+ _request_auth=_request_auth,
968
+ _content_type=_content_type,
969
+ _headers=_headers,
970
+ _host_index=_host_index,
971
+ )
972
+
973
+ _response_types_map: Dict[str, Optional[str]] = {
974
+ "200": None,
975
+ "400": "APIErrorResponse",
976
+ "401": "APIErrorResponse",
977
+ "403": "APIErrorResponse",
978
+ "500": "APIErrorResponse",
979
+ }
980
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
981
+ response_data.read()
982
+ return self.api_client.response_deserialize(
983
+ response_data=response_data,
984
+ response_types_map=_response_types_map,
985
+ ).data
986
+
987
+ @validate_call
988
+ def delete_vpn_gateway_with_http_info(
989
+ self,
990
+ project_id: StrictStr,
991
+ region: Region,
992
+ gateway_id: UUID,
993
+ _request_timeout: Union[
994
+ None,
995
+ Annotated[StrictFloat, Field(gt=0)],
996
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
997
+ ] = None,
998
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
999
+ _content_type: Optional[StrictStr] = None,
1000
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1001
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1002
+ ) -> ApiResponse[None]:
1003
+ """Delete a existing VPN gateway in a project.
1004
+
1005
+ Permanently remove a VPN gateway and all its associated connections. This operation is irreversible.
1006
+
1007
+ :param project_id: (required)
1008
+ :type project_id: str
1009
+ :param region: (required)
1010
+ :type region: Region
1011
+ :param gateway_id: (required)
1012
+ :type gateway_id: UUID
1013
+ :param _request_timeout: timeout setting for this request. If one
1014
+ number provided, it will be total request
1015
+ timeout. It can also be a pair (tuple) of
1016
+ (connection, read) timeouts.
1017
+ :type _request_timeout: int, tuple(int, int), optional
1018
+ :param _request_auth: set to override the auth_settings for an a single
1019
+ request; this effectively ignores the
1020
+ authentication in the spec for a single request.
1021
+ :type _request_auth: dict, optional
1022
+ :param _content_type: force content-type for the request.
1023
+ :type _content_type: str, Optional
1024
+ :param _headers: set to override the headers for a single
1025
+ request; this effectively ignores the headers
1026
+ in the spec for a single request.
1027
+ :type _headers: dict, optional
1028
+ :param _host_index: set to override the host_index for a single
1029
+ request; this effectively ignores the host_index
1030
+ in the spec for a single request.
1031
+ :type _host_index: int, optional
1032
+ :return: Returns the result object.
1033
+ """ # noqa: E501
1034
+
1035
+ _param = self._delete_vpn_gateway_serialize(
1036
+ project_id=project_id,
1037
+ region=region,
1038
+ gateway_id=gateway_id,
1039
+ _request_auth=_request_auth,
1040
+ _content_type=_content_type,
1041
+ _headers=_headers,
1042
+ _host_index=_host_index,
1043
+ )
1044
+
1045
+ _response_types_map: Dict[str, Optional[str]] = {
1046
+ "200": None,
1047
+ "400": "APIErrorResponse",
1048
+ "401": "APIErrorResponse",
1049
+ "403": "APIErrorResponse",
1050
+ "500": "APIErrorResponse",
1051
+ }
1052
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1053
+ response_data.read()
1054
+ return self.api_client.response_deserialize(
1055
+ response_data=response_data,
1056
+ response_types_map=_response_types_map,
1057
+ )
1058
+
1059
+ @validate_call
1060
+ def delete_vpn_gateway_without_preload_content(
1061
+ self,
1062
+ project_id: StrictStr,
1063
+ region: Region,
1064
+ gateway_id: UUID,
1065
+ _request_timeout: Union[
1066
+ None,
1067
+ Annotated[StrictFloat, Field(gt=0)],
1068
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1069
+ ] = None,
1070
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1071
+ _content_type: Optional[StrictStr] = None,
1072
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1073
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1074
+ ) -> RESTResponseType:
1075
+ """Delete a existing VPN gateway in a project.
1076
+
1077
+ Permanently remove a VPN gateway and all its associated connections. This operation is irreversible.
1078
+
1079
+ :param project_id: (required)
1080
+ :type project_id: str
1081
+ :param region: (required)
1082
+ :type region: Region
1083
+ :param gateway_id: (required)
1084
+ :type gateway_id: UUID
1085
+ :param _request_timeout: timeout setting for this request. If one
1086
+ number provided, it will be total request
1087
+ timeout. It can also be a pair (tuple) of
1088
+ (connection, read) timeouts.
1089
+ :type _request_timeout: int, tuple(int, int), optional
1090
+ :param _request_auth: set to override the auth_settings for an a single
1091
+ request; this effectively ignores the
1092
+ authentication in the spec for a single request.
1093
+ :type _request_auth: dict, optional
1094
+ :param _content_type: force content-type for the request.
1095
+ :type _content_type: str, Optional
1096
+ :param _headers: set to override the headers for a single
1097
+ request; this effectively ignores the headers
1098
+ in the spec for a single request.
1099
+ :type _headers: dict, optional
1100
+ :param _host_index: set to override the host_index for a single
1101
+ request; this effectively ignores the host_index
1102
+ in the spec for a single request.
1103
+ :type _host_index: int, optional
1104
+ :return: Returns the result object.
1105
+ """ # noqa: E501
1106
+
1107
+ _param = self._delete_vpn_gateway_serialize(
1108
+ project_id=project_id,
1109
+ region=region,
1110
+ gateway_id=gateway_id,
1111
+ _request_auth=_request_auth,
1112
+ _content_type=_content_type,
1113
+ _headers=_headers,
1114
+ _host_index=_host_index,
1115
+ )
1116
+
1117
+ _response_types_map: Dict[str, Optional[str]] = {
1118
+ "200": None,
1119
+ "400": "APIErrorResponse",
1120
+ "401": "APIErrorResponse",
1121
+ "403": "APIErrorResponse",
1122
+ "500": "APIErrorResponse",
1123
+ }
1124
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1125
+ return response_data.response
1126
+
1127
+ def _delete_vpn_gateway_serialize(
1128
+ self,
1129
+ project_id,
1130
+ region,
1131
+ gateway_id,
1132
+ _request_auth,
1133
+ _content_type,
1134
+ _headers,
1135
+ _host_index,
1136
+ ) -> RequestSerialized:
1137
+
1138
+ _host = None
1139
+
1140
+ _collection_formats: Dict[str, str] = {}
1141
+
1142
+ _path_params: Dict[str, str] = {}
1143
+ _query_params: List[Tuple[str, str]] = []
1144
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1145
+ _form_params: List[Tuple[str, str]] = []
1146
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1147
+ _body_params: Optional[bytes] = None
1148
+
1149
+ # process the path parameters
1150
+ if project_id is not None:
1151
+ _path_params["projectId"] = project_id
1152
+ if region is not None:
1153
+ _path_params["region"] = region.value
1154
+ if gateway_id is not None:
1155
+ _path_params["gatewayId"] = gateway_id
1156
+ # process the query parameters
1157
+ # process the header parameters
1158
+ # process the form parameters
1159
+ # process the body parameter
1160
+
1161
+ # set the HTTP header `Accept`
1162
+ if "Accept" not in _header_params:
1163
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1164
+
1165
+ # authentication setting
1166
+ _auth_settings: List[str] = []
1167
+
1168
+ return self.api_client.param_serialize(
1169
+ method="DELETE",
1170
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
1171
+ path_params=_path_params,
1172
+ query_params=_query_params,
1173
+ header_params=_header_params,
1174
+ body=_body_params,
1175
+ post_params=_form_params,
1176
+ files=_files,
1177
+ auth_settings=_auth_settings,
1178
+ collection_formats=_collection_formats,
1179
+ _host=_host,
1180
+ _request_auth=_request_auth,
1181
+ )
1182
+
1183
+ @validate_call
1184
+ def get_gateway_connection(
1185
+ self,
1186
+ project_id: StrictStr,
1187
+ region: Region,
1188
+ gateway_id: UUID,
1189
+ connection_id: StrictStr,
1190
+ _request_timeout: Union[
1191
+ None,
1192
+ Annotated[StrictFloat, Field(gt=0)],
1193
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1194
+ ] = None,
1195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1196
+ _content_type: Optional[StrictStr] = None,
1197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1199
+ ) -> ConnectionResponse:
1200
+ """Get a certain connection for an existing VPN gateway.
1201
+
1202
+ Get a certain connection for an existing VPN gateway.
1203
+
1204
+ :param project_id: (required)
1205
+ :type project_id: str
1206
+ :param region: (required)
1207
+ :type region: Region
1208
+ :param gateway_id: (required)
1209
+ :type gateway_id: UUID
1210
+ :param connection_id: (required)
1211
+ :type connection_id: str
1212
+ :param _request_timeout: timeout setting for this request. If one
1213
+ number provided, it will be total request
1214
+ timeout. It can also be a pair (tuple) of
1215
+ (connection, read) timeouts.
1216
+ :type _request_timeout: int, tuple(int, int), optional
1217
+ :param _request_auth: set to override the auth_settings for an a single
1218
+ request; this effectively ignores the
1219
+ authentication in the spec for a single request.
1220
+ :type _request_auth: dict, optional
1221
+ :param _content_type: force content-type for the request.
1222
+ :type _content_type: str, Optional
1223
+ :param _headers: set to override the headers for a single
1224
+ request; this effectively ignores the headers
1225
+ in the spec for a single request.
1226
+ :type _headers: dict, optional
1227
+ :param _host_index: set to override the host_index for a single
1228
+ request; this effectively ignores the host_index
1229
+ in the spec for a single request.
1230
+ :type _host_index: int, optional
1231
+ :return: Returns the result object.
1232
+ """ # noqa: E501
1233
+
1234
+ _param = self._get_gateway_connection_serialize(
1235
+ project_id=project_id,
1236
+ region=region,
1237
+ gateway_id=gateway_id,
1238
+ connection_id=connection_id,
1239
+ _request_auth=_request_auth,
1240
+ _content_type=_content_type,
1241
+ _headers=_headers,
1242
+ _host_index=_host_index,
1243
+ )
1244
+
1245
+ _response_types_map: Dict[str, Optional[str]] = {
1246
+ "200": "ConnectionResponse",
1247
+ "400": "APIErrorResponse",
1248
+ "401": "APIErrorResponse",
1249
+ "403": "APIErrorResponse",
1250
+ "404": "APIErrorResponse",
1251
+ "500": "APIErrorResponse",
1252
+ }
1253
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1254
+ response_data.read()
1255
+ return self.api_client.response_deserialize(
1256
+ response_data=response_data,
1257
+ response_types_map=_response_types_map,
1258
+ ).data
1259
+
1260
+ @validate_call
1261
+ def get_gateway_connection_with_http_info(
1262
+ self,
1263
+ project_id: StrictStr,
1264
+ region: Region,
1265
+ gateway_id: UUID,
1266
+ connection_id: StrictStr,
1267
+ _request_timeout: Union[
1268
+ None,
1269
+ Annotated[StrictFloat, Field(gt=0)],
1270
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1271
+ ] = None,
1272
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1273
+ _content_type: Optional[StrictStr] = None,
1274
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1275
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1276
+ ) -> ApiResponse[ConnectionResponse]:
1277
+ """Get a certain connection for an existing VPN gateway.
1278
+
1279
+ Get a certain connection for an existing VPN gateway.
1280
+
1281
+ :param project_id: (required)
1282
+ :type project_id: str
1283
+ :param region: (required)
1284
+ :type region: Region
1285
+ :param gateway_id: (required)
1286
+ :type gateway_id: UUID
1287
+ :param connection_id: (required)
1288
+ :type connection_id: str
1289
+ :param _request_timeout: timeout setting for this request. If one
1290
+ number provided, it will be total request
1291
+ timeout. It can also be a pair (tuple) of
1292
+ (connection, read) timeouts.
1293
+ :type _request_timeout: int, tuple(int, int), optional
1294
+ :param _request_auth: set to override the auth_settings for an a single
1295
+ request; this effectively ignores the
1296
+ authentication in the spec for a single request.
1297
+ :type _request_auth: dict, optional
1298
+ :param _content_type: force content-type for the request.
1299
+ :type _content_type: str, Optional
1300
+ :param _headers: set to override the headers for a single
1301
+ request; this effectively ignores the headers
1302
+ in the spec for a single request.
1303
+ :type _headers: dict, optional
1304
+ :param _host_index: set to override the host_index for a single
1305
+ request; this effectively ignores the host_index
1306
+ in the spec for a single request.
1307
+ :type _host_index: int, optional
1308
+ :return: Returns the result object.
1309
+ """ # noqa: E501
1310
+
1311
+ _param = self._get_gateway_connection_serialize(
1312
+ project_id=project_id,
1313
+ region=region,
1314
+ gateway_id=gateway_id,
1315
+ connection_id=connection_id,
1316
+ _request_auth=_request_auth,
1317
+ _content_type=_content_type,
1318
+ _headers=_headers,
1319
+ _host_index=_host_index,
1320
+ )
1321
+
1322
+ _response_types_map: Dict[str, Optional[str]] = {
1323
+ "200": "ConnectionResponse",
1324
+ "400": "APIErrorResponse",
1325
+ "401": "APIErrorResponse",
1326
+ "403": "APIErrorResponse",
1327
+ "404": "APIErrorResponse",
1328
+ "500": "APIErrorResponse",
1329
+ }
1330
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1331
+ response_data.read()
1332
+ return self.api_client.response_deserialize(
1333
+ response_data=response_data,
1334
+ response_types_map=_response_types_map,
1335
+ )
1336
+
1337
+ @validate_call
1338
+ def get_gateway_connection_without_preload_content(
1339
+ self,
1340
+ project_id: StrictStr,
1341
+ region: Region,
1342
+ gateway_id: UUID,
1343
+ connection_id: StrictStr,
1344
+ _request_timeout: Union[
1345
+ None,
1346
+ Annotated[StrictFloat, Field(gt=0)],
1347
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1348
+ ] = None,
1349
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1350
+ _content_type: Optional[StrictStr] = None,
1351
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1352
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1353
+ ) -> RESTResponseType:
1354
+ """Get a certain connection for an existing VPN gateway.
1355
+
1356
+ Get a certain connection for an existing VPN gateway.
1357
+
1358
+ :param project_id: (required)
1359
+ :type project_id: str
1360
+ :param region: (required)
1361
+ :type region: Region
1362
+ :param gateway_id: (required)
1363
+ :type gateway_id: UUID
1364
+ :param connection_id: (required)
1365
+ :type connection_id: str
1366
+ :param _request_timeout: timeout setting for this request. If one
1367
+ number provided, it will be total request
1368
+ timeout. It can also be a pair (tuple) of
1369
+ (connection, read) timeouts.
1370
+ :type _request_timeout: int, tuple(int, int), optional
1371
+ :param _request_auth: set to override the auth_settings for an a single
1372
+ request; this effectively ignores the
1373
+ authentication in the spec for a single request.
1374
+ :type _request_auth: dict, optional
1375
+ :param _content_type: force content-type for the request.
1376
+ :type _content_type: str, Optional
1377
+ :param _headers: set to override the headers for a single
1378
+ request; this effectively ignores the headers
1379
+ in the spec for a single request.
1380
+ :type _headers: dict, optional
1381
+ :param _host_index: set to override the host_index for a single
1382
+ request; this effectively ignores the host_index
1383
+ in the spec for a single request.
1384
+ :type _host_index: int, optional
1385
+ :return: Returns the result object.
1386
+ """ # noqa: E501
1387
+
1388
+ _param = self._get_gateway_connection_serialize(
1389
+ project_id=project_id,
1390
+ region=region,
1391
+ gateway_id=gateway_id,
1392
+ connection_id=connection_id,
1393
+ _request_auth=_request_auth,
1394
+ _content_type=_content_type,
1395
+ _headers=_headers,
1396
+ _host_index=_host_index,
1397
+ )
1398
+
1399
+ _response_types_map: Dict[str, Optional[str]] = {
1400
+ "200": "ConnectionResponse",
1401
+ "400": "APIErrorResponse",
1402
+ "401": "APIErrorResponse",
1403
+ "403": "APIErrorResponse",
1404
+ "404": "APIErrorResponse",
1405
+ "500": "APIErrorResponse",
1406
+ }
1407
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1408
+ return response_data.response
1409
+
1410
+ def _get_gateway_connection_serialize(
1411
+ self,
1412
+ project_id,
1413
+ region,
1414
+ gateway_id,
1415
+ connection_id,
1416
+ _request_auth,
1417
+ _content_type,
1418
+ _headers,
1419
+ _host_index,
1420
+ ) -> RequestSerialized:
1421
+
1422
+ _host = None
1423
+
1424
+ _collection_formats: Dict[str, str] = {}
1425
+
1426
+ _path_params: Dict[str, str] = {}
1427
+ _query_params: List[Tuple[str, str]] = []
1428
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1429
+ _form_params: List[Tuple[str, str]] = []
1430
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1431
+ _body_params: Optional[bytes] = None
1432
+
1433
+ # process the path parameters
1434
+ if project_id is not None:
1435
+ _path_params["projectId"] = project_id
1436
+ if region is not None:
1437
+ _path_params["region"] = region.value
1438
+ if gateway_id is not None:
1439
+ _path_params["gatewayId"] = gateway_id
1440
+ if connection_id is not None:
1441
+ _path_params["connectionId"] = connection_id
1442
+ # process the query parameters
1443
+ # process the header parameters
1444
+ # process the form parameters
1445
+ # process the body parameter
1446
+
1447
+ # set the HTTP header `Accept`
1448
+ if "Accept" not in _header_params:
1449
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1450
+
1451
+ # authentication setting
1452
+ _auth_settings: List[str] = []
1453
+
1454
+ return self.api_client.param_serialize(
1455
+ method="GET",
1456
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
1457
+ path_params=_path_params,
1458
+ query_params=_query_params,
1459
+ header_params=_header_params,
1460
+ body=_body_params,
1461
+ post_params=_form_params,
1462
+ files=_files,
1463
+ auth_settings=_auth_settings,
1464
+ collection_formats=_collection_formats,
1465
+ _host=_host,
1466
+ _request_auth=_request_auth,
1467
+ )
1468
+
1469
+ @validate_call
1470
+ def get_gateway_connection_status(
1471
+ self,
1472
+ project_id: StrictStr,
1473
+ region: Region,
1474
+ gateway_id: UUID,
1475
+ connection_id: StrictStr,
1476
+ _request_timeout: Union[
1477
+ None,
1478
+ Annotated[StrictFloat, Field(gt=0)],
1479
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1480
+ ] = None,
1481
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1482
+ _content_type: Optional[StrictStr] = None,
1483
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1484
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1485
+ ) -> ConnectionStatusResponse:
1486
+ """Gets the status for a specific connection.
1487
+
1488
+ Get the status for a specific connection.
1489
+
1490
+ :param project_id: (required)
1491
+ :type project_id: str
1492
+ :param region: (required)
1493
+ :type region: Region
1494
+ :param gateway_id: (required)
1495
+ :type gateway_id: UUID
1496
+ :param connection_id: (required)
1497
+ :type connection_id: str
1498
+ :param _request_timeout: timeout setting for this request. If one
1499
+ number provided, it will be total request
1500
+ timeout. It can also be a pair (tuple) of
1501
+ (connection, read) timeouts.
1502
+ :type _request_timeout: int, tuple(int, int), optional
1503
+ :param _request_auth: set to override the auth_settings for an a single
1504
+ request; this effectively ignores the
1505
+ authentication in the spec for a single request.
1506
+ :type _request_auth: dict, optional
1507
+ :param _content_type: force content-type for the request.
1508
+ :type _content_type: str, Optional
1509
+ :param _headers: set to override the headers for a single
1510
+ request; this effectively ignores the headers
1511
+ in the spec for a single request.
1512
+ :type _headers: dict, optional
1513
+ :param _host_index: set to override the host_index for a single
1514
+ request; this effectively ignores the host_index
1515
+ in the spec for a single request.
1516
+ :type _host_index: int, optional
1517
+ :return: Returns the result object.
1518
+ """ # noqa: E501
1519
+
1520
+ _param = self._get_gateway_connection_status_serialize(
1521
+ project_id=project_id,
1522
+ region=region,
1523
+ gateway_id=gateway_id,
1524
+ connection_id=connection_id,
1525
+ _request_auth=_request_auth,
1526
+ _content_type=_content_type,
1527
+ _headers=_headers,
1528
+ _host_index=_host_index,
1529
+ )
1530
+
1531
+ _response_types_map: Dict[str, Optional[str]] = {
1532
+ "200": "ConnectionStatusResponse",
1533
+ "400": "APIErrorResponse",
1534
+ "401": "APIErrorResponse",
1535
+ "403": "APIErrorResponse",
1536
+ "404": "APIErrorResponse",
1537
+ "500": "APIErrorResponse",
1538
+ }
1539
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1540
+ response_data.read()
1541
+ return self.api_client.response_deserialize(
1542
+ response_data=response_data,
1543
+ response_types_map=_response_types_map,
1544
+ ).data
1545
+
1546
+ @validate_call
1547
+ def get_gateway_connection_status_with_http_info(
1548
+ self,
1549
+ project_id: StrictStr,
1550
+ region: Region,
1551
+ gateway_id: UUID,
1552
+ connection_id: StrictStr,
1553
+ _request_timeout: Union[
1554
+ None,
1555
+ Annotated[StrictFloat, Field(gt=0)],
1556
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1557
+ ] = None,
1558
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1559
+ _content_type: Optional[StrictStr] = None,
1560
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1561
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1562
+ ) -> ApiResponse[ConnectionStatusResponse]:
1563
+ """Gets the status for a specific connection.
1564
+
1565
+ Get the status for a specific connection.
1566
+
1567
+ :param project_id: (required)
1568
+ :type project_id: str
1569
+ :param region: (required)
1570
+ :type region: Region
1571
+ :param gateway_id: (required)
1572
+ :type gateway_id: UUID
1573
+ :param connection_id: (required)
1574
+ :type connection_id: str
1575
+ :param _request_timeout: timeout setting for this request. If one
1576
+ number provided, it will be total request
1577
+ timeout. It can also be a pair (tuple) of
1578
+ (connection, read) timeouts.
1579
+ :type _request_timeout: int, tuple(int, int), optional
1580
+ :param _request_auth: set to override the auth_settings for an a single
1581
+ request; this effectively ignores the
1582
+ authentication in the spec for a single request.
1583
+ :type _request_auth: dict, optional
1584
+ :param _content_type: force content-type for the request.
1585
+ :type _content_type: str, Optional
1586
+ :param _headers: set to override the headers for a single
1587
+ request; this effectively ignores the headers
1588
+ in the spec for a single request.
1589
+ :type _headers: dict, optional
1590
+ :param _host_index: set to override the host_index for a single
1591
+ request; this effectively ignores the host_index
1592
+ in the spec for a single request.
1593
+ :type _host_index: int, optional
1594
+ :return: Returns the result object.
1595
+ """ # noqa: E501
1596
+
1597
+ _param = self._get_gateway_connection_status_serialize(
1598
+ project_id=project_id,
1599
+ region=region,
1600
+ gateway_id=gateway_id,
1601
+ connection_id=connection_id,
1602
+ _request_auth=_request_auth,
1603
+ _content_type=_content_type,
1604
+ _headers=_headers,
1605
+ _host_index=_host_index,
1606
+ )
1607
+
1608
+ _response_types_map: Dict[str, Optional[str]] = {
1609
+ "200": "ConnectionStatusResponse",
1610
+ "400": "APIErrorResponse",
1611
+ "401": "APIErrorResponse",
1612
+ "403": "APIErrorResponse",
1613
+ "404": "APIErrorResponse",
1614
+ "500": "APIErrorResponse",
1615
+ }
1616
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1617
+ response_data.read()
1618
+ return self.api_client.response_deserialize(
1619
+ response_data=response_data,
1620
+ response_types_map=_response_types_map,
1621
+ )
1622
+
1623
+ @validate_call
1624
+ def get_gateway_connection_status_without_preload_content(
1625
+ self,
1626
+ project_id: StrictStr,
1627
+ region: Region,
1628
+ gateway_id: UUID,
1629
+ connection_id: StrictStr,
1630
+ _request_timeout: Union[
1631
+ None,
1632
+ Annotated[StrictFloat, Field(gt=0)],
1633
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1634
+ ] = None,
1635
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1636
+ _content_type: Optional[StrictStr] = None,
1637
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1638
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1639
+ ) -> RESTResponseType:
1640
+ """Gets the status for a specific connection.
1641
+
1642
+ Get the status for a specific connection.
1643
+
1644
+ :param project_id: (required)
1645
+ :type project_id: str
1646
+ :param region: (required)
1647
+ :type region: Region
1648
+ :param gateway_id: (required)
1649
+ :type gateway_id: UUID
1650
+ :param connection_id: (required)
1651
+ :type connection_id: str
1652
+ :param _request_timeout: timeout setting for this request. If one
1653
+ number provided, it will be total request
1654
+ timeout. It can also be a pair (tuple) of
1655
+ (connection, read) timeouts.
1656
+ :type _request_timeout: int, tuple(int, int), optional
1657
+ :param _request_auth: set to override the auth_settings for an a single
1658
+ request; this effectively ignores the
1659
+ authentication in the spec for a single request.
1660
+ :type _request_auth: dict, optional
1661
+ :param _content_type: force content-type for the request.
1662
+ :type _content_type: str, Optional
1663
+ :param _headers: set to override the headers for a single
1664
+ request; this effectively ignores the headers
1665
+ in the spec for a single request.
1666
+ :type _headers: dict, optional
1667
+ :param _host_index: set to override the host_index for a single
1668
+ request; this effectively ignores the host_index
1669
+ in the spec for a single request.
1670
+ :type _host_index: int, optional
1671
+ :return: Returns the result object.
1672
+ """ # noqa: E501
1673
+
1674
+ _param = self._get_gateway_connection_status_serialize(
1675
+ project_id=project_id,
1676
+ region=region,
1677
+ gateway_id=gateway_id,
1678
+ connection_id=connection_id,
1679
+ _request_auth=_request_auth,
1680
+ _content_type=_content_type,
1681
+ _headers=_headers,
1682
+ _host_index=_host_index,
1683
+ )
1684
+
1685
+ _response_types_map: Dict[str, Optional[str]] = {
1686
+ "200": "ConnectionStatusResponse",
1687
+ "400": "APIErrorResponse",
1688
+ "401": "APIErrorResponse",
1689
+ "403": "APIErrorResponse",
1690
+ "404": "APIErrorResponse",
1691
+ "500": "APIErrorResponse",
1692
+ }
1693
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1694
+ return response_data.response
1695
+
1696
+ def _get_gateway_connection_status_serialize(
1697
+ self,
1698
+ project_id,
1699
+ region,
1700
+ gateway_id,
1701
+ connection_id,
1702
+ _request_auth,
1703
+ _content_type,
1704
+ _headers,
1705
+ _host_index,
1706
+ ) -> RequestSerialized:
1707
+
1708
+ _host = None
1709
+
1710
+ _collection_formats: Dict[str, str] = {}
1711
+
1712
+ _path_params: Dict[str, str] = {}
1713
+ _query_params: List[Tuple[str, str]] = []
1714
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1715
+ _form_params: List[Tuple[str, str]] = []
1716
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1717
+ _body_params: Optional[bytes] = None
1718
+
1719
+ # process the path parameters
1720
+ if project_id is not None:
1721
+ _path_params["projectId"] = project_id
1722
+ if region is not None:
1723
+ _path_params["region"] = region.value
1724
+ if gateway_id is not None:
1725
+ _path_params["gatewayId"] = gateway_id
1726
+ if connection_id is not None:
1727
+ _path_params["connectionId"] = connection_id
1728
+ # process the query parameters
1729
+ # process the header parameters
1730
+ # process the form parameters
1731
+ # process the body parameter
1732
+
1733
+ # set the HTTP header `Accept`
1734
+ if "Accept" not in _header_params:
1735
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1736
+
1737
+ # authentication setting
1738
+ _auth_settings: List[str] = []
1739
+
1740
+ return self.api_client.param_serialize(
1741
+ method="GET",
1742
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}/status",
1743
+ path_params=_path_params,
1744
+ query_params=_query_params,
1745
+ header_params=_header_params,
1746
+ body=_body_params,
1747
+ post_params=_form_params,
1748
+ files=_files,
1749
+ auth_settings=_auth_settings,
1750
+ collection_formats=_collection_formats,
1751
+ _host=_host,
1752
+ _request_auth=_request_auth,
1753
+ )
1754
+
1755
+ @validate_call
1756
+ def get_vpn_gateway(
1757
+ self,
1758
+ project_id: StrictStr,
1759
+ region: Region,
1760
+ gateway_id: UUID,
1761
+ _request_timeout: Union[
1762
+ None,
1763
+ Annotated[StrictFloat, Field(gt=0)],
1764
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1765
+ ] = None,
1766
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1767
+ _content_type: Optional[StrictStr] = None,
1768
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1769
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1770
+ ) -> GatewayResponse:
1771
+ """Get details of a VPN Gateway in a project.
1772
+
1773
+ Get details of a VPN Gateway in a project.
1774
+
1775
+ :param project_id: (required)
1776
+ :type project_id: str
1777
+ :param region: (required)
1778
+ :type region: Region
1779
+ :param gateway_id: (required)
1780
+ :type gateway_id: UUID
1781
+ :param _request_timeout: timeout setting for this request. If one
1782
+ number provided, it will be total request
1783
+ timeout. It can also be a pair (tuple) of
1784
+ (connection, read) timeouts.
1785
+ :type _request_timeout: int, tuple(int, int), optional
1786
+ :param _request_auth: set to override the auth_settings for an a single
1787
+ request; this effectively ignores the
1788
+ authentication in the spec for a single request.
1789
+ :type _request_auth: dict, optional
1790
+ :param _content_type: force content-type for the request.
1791
+ :type _content_type: str, Optional
1792
+ :param _headers: set to override the headers for a single
1793
+ request; this effectively ignores the headers
1794
+ in the spec for a single request.
1795
+ :type _headers: dict, optional
1796
+ :param _host_index: set to override the host_index for a single
1797
+ request; this effectively ignores the host_index
1798
+ in the spec for a single request.
1799
+ :type _host_index: int, optional
1800
+ :return: Returns the result object.
1801
+ """ # noqa: E501
1802
+
1803
+ _param = self._get_vpn_gateway_serialize(
1804
+ project_id=project_id,
1805
+ region=region,
1806
+ gateway_id=gateway_id,
1807
+ _request_auth=_request_auth,
1808
+ _content_type=_content_type,
1809
+ _headers=_headers,
1810
+ _host_index=_host_index,
1811
+ )
1812
+
1813
+ _response_types_map: Dict[str, Optional[str]] = {
1814
+ "200": "GatewayResponse",
1815
+ "400": "APIErrorResponse",
1816
+ "401": "APIErrorResponse",
1817
+ "403": "APIErrorResponse",
1818
+ "404": "APIErrorResponse",
1819
+ "500": "APIErrorResponse",
1820
+ }
1821
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1822
+ response_data.read()
1823
+ return self.api_client.response_deserialize(
1824
+ response_data=response_data,
1825
+ response_types_map=_response_types_map,
1826
+ ).data
1827
+
1828
+ @validate_call
1829
+ def get_vpn_gateway_with_http_info(
1830
+ self,
1831
+ project_id: StrictStr,
1832
+ region: Region,
1833
+ gateway_id: UUID,
1834
+ _request_timeout: Union[
1835
+ None,
1836
+ Annotated[StrictFloat, Field(gt=0)],
1837
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1838
+ ] = None,
1839
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1840
+ _content_type: Optional[StrictStr] = None,
1841
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1842
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1843
+ ) -> ApiResponse[GatewayResponse]:
1844
+ """Get details of a VPN Gateway in a project.
1845
+
1846
+ Get details of a VPN Gateway in a project.
1847
+
1848
+ :param project_id: (required)
1849
+ :type project_id: str
1850
+ :param region: (required)
1851
+ :type region: Region
1852
+ :param gateway_id: (required)
1853
+ :type gateway_id: UUID
1854
+ :param _request_timeout: timeout setting for this request. If one
1855
+ number provided, it will be total request
1856
+ timeout. It can also be a pair (tuple) of
1857
+ (connection, read) timeouts.
1858
+ :type _request_timeout: int, tuple(int, int), optional
1859
+ :param _request_auth: set to override the auth_settings for an a single
1860
+ request; this effectively ignores the
1861
+ authentication in the spec for a single request.
1862
+ :type _request_auth: dict, optional
1863
+ :param _content_type: force content-type for the request.
1864
+ :type _content_type: str, Optional
1865
+ :param _headers: set to override the headers for a single
1866
+ request; this effectively ignores the headers
1867
+ in the spec for a single request.
1868
+ :type _headers: dict, optional
1869
+ :param _host_index: set to override the host_index for a single
1870
+ request; this effectively ignores the host_index
1871
+ in the spec for a single request.
1872
+ :type _host_index: int, optional
1873
+ :return: Returns the result object.
1874
+ """ # noqa: E501
1875
+
1876
+ _param = self._get_vpn_gateway_serialize(
1877
+ project_id=project_id,
1878
+ region=region,
1879
+ gateway_id=gateway_id,
1880
+ _request_auth=_request_auth,
1881
+ _content_type=_content_type,
1882
+ _headers=_headers,
1883
+ _host_index=_host_index,
1884
+ )
1885
+
1886
+ _response_types_map: Dict[str, Optional[str]] = {
1887
+ "200": "GatewayResponse",
1888
+ "400": "APIErrorResponse",
1889
+ "401": "APIErrorResponse",
1890
+ "403": "APIErrorResponse",
1891
+ "404": "APIErrorResponse",
1892
+ "500": "APIErrorResponse",
1893
+ }
1894
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1895
+ response_data.read()
1896
+ return self.api_client.response_deserialize(
1897
+ response_data=response_data,
1898
+ response_types_map=_response_types_map,
1899
+ )
1900
+
1901
+ @validate_call
1902
+ def get_vpn_gateway_without_preload_content(
1903
+ self,
1904
+ project_id: StrictStr,
1905
+ region: Region,
1906
+ gateway_id: UUID,
1907
+ _request_timeout: Union[
1908
+ None,
1909
+ Annotated[StrictFloat, Field(gt=0)],
1910
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1911
+ ] = None,
1912
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1913
+ _content_type: Optional[StrictStr] = None,
1914
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1915
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1916
+ ) -> RESTResponseType:
1917
+ """Get details of a VPN Gateway in a project.
1918
+
1919
+ Get details of a VPN Gateway in a project.
1920
+
1921
+ :param project_id: (required)
1922
+ :type project_id: str
1923
+ :param region: (required)
1924
+ :type region: Region
1925
+ :param gateway_id: (required)
1926
+ :type gateway_id: UUID
1927
+ :param _request_timeout: timeout setting for this request. If one
1928
+ number provided, it will be total request
1929
+ timeout. It can also be a pair (tuple) of
1930
+ (connection, read) timeouts.
1931
+ :type _request_timeout: int, tuple(int, int), optional
1932
+ :param _request_auth: set to override the auth_settings for an a single
1933
+ request; this effectively ignores the
1934
+ authentication in the spec for a single request.
1935
+ :type _request_auth: dict, optional
1936
+ :param _content_type: force content-type for the request.
1937
+ :type _content_type: str, Optional
1938
+ :param _headers: set to override the headers for a single
1939
+ request; this effectively ignores the headers
1940
+ in the spec for a single request.
1941
+ :type _headers: dict, optional
1942
+ :param _host_index: set to override the host_index for a single
1943
+ request; this effectively ignores the host_index
1944
+ in the spec for a single request.
1945
+ :type _host_index: int, optional
1946
+ :return: Returns the result object.
1947
+ """ # noqa: E501
1948
+
1949
+ _param = self._get_vpn_gateway_serialize(
1950
+ project_id=project_id,
1951
+ region=region,
1952
+ gateway_id=gateway_id,
1953
+ _request_auth=_request_auth,
1954
+ _content_type=_content_type,
1955
+ _headers=_headers,
1956
+ _host_index=_host_index,
1957
+ )
1958
+
1959
+ _response_types_map: Dict[str, Optional[str]] = {
1960
+ "200": "GatewayResponse",
1961
+ "400": "APIErrorResponse",
1962
+ "401": "APIErrorResponse",
1963
+ "403": "APIErrorResponse",
1964
+ "404": "APIErrorResponse",
1965
+ "500": "APIErrorResponse",
1966
+ }
1967
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1968
+ return response_data.response
1969
+
1970
+ def _get_vpn_gateway_serialize(
1971
+ self,
1972
+ project_id,
1973
+ region,
1974
+ gateway_id,
1975
+ _request_auth,
1976
+ _content_type,
1977
+ _headers,
1978
+ _host_index,
1979
+ ) -> RequestSerialized:
1980
+
1981
+ _host = None
1982
+
1983
+ _collection_formats: Dict[str, str] = {}
1984
+
1985
+ _path_params: Dict[str, str] = {}
1986
+ _query_params: List[Tuple[str, str]] = []
1987
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1988
+ _form_params: List[Tuple[str, str]] = []
1989
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1990
+ _body_params: Optional[bytes] = None
1991
+
1992
+ # process the path parameters
1993
+ if project_id is not None:
1994
+ _path_params["projectId"] = project_id
1995
+ if region is not None:
1996
+ _path_params["region"] = region.value
1997
+ if gateway_id is not None:
1998
+ _path_params["gatewayId"] = gateway_id
1999
+ # process the query parameters
2000
+ # process the header parameters
2001
+ # process the form parameters
2002
+ # process the body parameter
2003
+
2004
+ # set the HTTP header `Accept`
2005
+ if "Accept" not in _header_params:
2006
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2007
+
2008
+ # authentication setting
2009
+ _auth_settings: List[str] = []
2010
+
2011
+ return self.api_client.param_serialize(
2012
+ method="GET",
2013
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
2014
+ path_params=_path_params,
2015
+ query_params=_query_params,
2016
+ header_params=_header_params,
2017
+ body=_body_params,
2018
+ post_params=_form_params,
2019
+ files=_files,
2020
+ auth_settings=_auth_settings,
2021
+ collection_formats=_collection_formats,
2022
+ _host=_host,
2023
+ _request_auth=_request_auth,
2024
+ )
2025
+
2026
+ @validate_call
2027
+ def get_vpn_gateway_status(
2028
+ self,
2029
+ project_id: StrictStr,
2030
+ region: Region,
2031
+ gateway_id: UUID,
2032
+ _request_timeout: Union[
2033
+ None,
2034
+ Annotated[StrictFloat, Field(gt=0)],
2035
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2036
+ ] = None,
2037
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2038
+ _content_type: Optional[StrictStr] = None,
2039
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2040
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2041
+ ) -> GatewayStatusResponse:
2042
+ """Get the status of a VPN gateway in a project.
2043
+
2044
+ Get the status of a VPN gateway in a project.
2045
+
2046
+ :param project_id: (required)
2047
+ :type project_id: str
2048
+ :param region: (required)
2049
+ :type region: Region
2050
+ :param gateway_id: (required)
2051
+ :type gateway_id: UUID
2052
+ :param _request_timeout: timeout setting for this request. If one
2053
+ number provided, it will be total request
2054
+ timeout. It can also be a pair (tuple) of
2055
+ (connection, read) timeouts.
2056
+ :type _request_timeout: int, tuple(int, int), optional
2057
+ :param _request_auth: set to override the auth_settings for an a single
2058
+ request; this effectively ignores the
2059
+ authentication in the spec for a single request.
2060
+ :type _request_auth: dict, optional
2061
+ :param _content_type: force content-type for the request.
2062
+ :type _content_type: str, Optional
2063
+ :param _headers: set to override the headers for a single
2064
+ request; this effectively ignores the headers
2065
+ in the spec for a single request.
2066
+ :type _headers: dict, optional
2067
+ :param _host_index: set to override the host_index for a single
2068
+ request; this effectively ignores the host_index
2069
+ in the spec for a single request.
2070
+ :type _host_index: int, optional
2071
+ :return: Returns the result object.
2072
+ """ # noqa: E501
2073
+
2074
+ _param = self._get_vpn_gateway_status_serialize(
2075
+ project_id=project_id,
2076
+ region=region,
2077
+ gateway_id=gateway_id,
2078
+ _request_auth=_request_auth,
2079
+ _content_type=_content_type,
2080
+ _headers=_headers,
2081
+ _host_index=_host_index,
2082
+ )
2083
+
2084
+ _response_types_map: Dict[str, Optional[str]] = {
2085
+ "200": "GatewayStatusResponse",
2086
+ "400": "APIErrorResponse",
2087
+ "401": "APIErrorResponse",
2088
+ "403": "APIErrorResponse",
2089
+ "404": "APIErrorResponse",
2090
+ "500": "APIErrorResponse",
2091
+ }
2092
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2093
+ response_data.read()
2094
+ return self.api_client.response_deserialize(
2095
+ response_data=response_data,
2096
+ response_types_map=_response_types_map,
2097
+ ).data
2098
+
2099
+ @validate_call
2100
+ def get_vpn_gateway_status_with_http_info(
2101
+ self,
2102
+ project_id: StrictStr,
2103
+ region: Region,
2104
+ gateway_id: UUID,
2105
+ _request_timeout: Union[
2106
+ None,
2107
+ Annotated[StrictFloat, Field(gt=0)],
2108
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2109
+ ] = None,
2110
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2111
+ _content_type: Optional[StrictStr] = None,
2112
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2113
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2114
+ ) -> ApiResponse[GatewayStatusResponse]:
2115
+ """Get the status of a VPN gateway in a project.
2116
+
2117
+ Get the status of a VPN gateway in a project.
2118
+
2119
+ :param project_id: (required)
2120
+ :type project_id: str
2121
+ :param region: (required)
2122
+ :type region: Region
2123
+ :param gateway_id: (required)
2124
+ :type gateway_id: UUID
2125
+ :param _request_timeout: timeout setting for this request. If one
2126
+ number provided, it will be total request
2127
+ timeout. It can also be a pair (tuple) of
2128
+ (connection, read) timeouts.
2129
+ :type _request_timeout: int, tuple(int, int), optional
2130
+ :param _request_auth: set to override the auth_settings for an a single
2131
+ request; this effectively ignores the
2132
+ authentication in the spec for a single request.
2133
+ :type _request_auth: dict, optional
2134
+ :param _content_type: force content-type for the request.
2135
+ :type _content_type: str, Optional
2136
+ :param _headers: set to override the headers for a single
2137
+ request; this effectively ignores the headers
2138
+ in the spec for a single request.
2139
+ :type _headers: dict, optional
2140
+ :param _host_index: set to override the host_index for a single
2141
+ request; this effectively ignores the host_index
2142
+ in the spec for a single request.
2143
+ :type _host_index: int, optional
2144
+ :return: Returns the result object.
2145
+ """ # noqa: E501
2146
+
2147
+ _param = self._get_vpn_gateway_status_serialize(
2148
+ project_id=project_id,
2149
+ region=region,
2150
+ gateway_id=gateway_id,
2151
+ _request_auth=_request_auth,
2152
+ _content_type=_content_type,
2153
+ _headers=_headers,
2154
+ _host_index=_host_index,
2155
+ )
2156
+
2157
+ _response_types_map: Dict[str, Optional[str]] = {
2158
+ "200": "GatewayStatusResponse",
2159
+ "400": "APIErrorResponse",
2160
+ "401": "APIErrorResponse",
2161
+ "403": "APIErrorResponse",
2162
+ "404": "APIErrorResponse",
2163
+ "500": "APIErrorResponse",
2164
+ }
2165
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2166
+ response_data.read()
2167
+ return self.api_client.response_deserialize(
2168
+ response_data=response_data,
2169
+ response_types_map=_response_types_map,
2170
+ )
2171
+
2172
+ @validate_call
2173
+ def get_vpn_gateway_status_without_preload_content(
2174
+ self,
2175
+ project_id: StrictStr,
2176
+ region: Region,
2177
+ gateway_id: UUID,
2178
+ _request_timeout: Union[
2179
+ None,
2180
+ Annotated[StrictFloat, Field(gt=0)],
2181
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2182
+ ] = None,
2183
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2184
+ _content_type: Optional[StrictStr] = None,
2185
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2186
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2187
+ ) -> RESTResponseType:
2188
+ """Get the status of a VPN gateway in a project.
2189
+
2190
+ Get the status of a VPN gateway in a project.
2191
+
2192
+ :param project_id: (required)
2193
+ :type project_id: str
2194
+ :param region: (required)
2195
+ :type region: Region
2196
+ :param gateway_id: (required)
2197
+ :type gateway_id: UUID
2198
+ :param _request_timeout: timeout setting for this request. If one
2199
+ number provided, it will be total request
2200
+ timeout. It can also be a pair (tuple) of
2201
+ (connection, read) timeouts.
2202
+ :type _request_timeout: int, tuple(int, int), optional
2203
+ :param _request_auth: set to override the auth_settings for an a single
2204
+ request; this effectively ignores the
2205
+ authentication in the spec for a single request.
2206
+ :type _request_auth: dict, optional
2207
+ :param _content_type: force content-type for the request.
2208
+ :type _content_type: str, Optional
2209
+ :param _headers: set to override the headers for a single
2210
+ request; this effectively ignores the headers
2211
+ in the spec for a single request.
2212
+ :type _headers: dict, optional
2213
+ :param _host_index: set to override the host_index for a single
2214
+ request; this effectively ignores the host_index
2215
+ in the spec for a single request.
2216
+ :type _host_index: int, optional
2217
+ :return: Returns the result object.
2218
+ """ # noqa: E501
2219
+
2220
+ _param = self._get_vpn_gateway_status_serialize(
2221
+ project_id=project_id,
2222
+ region=region,
2223
+ gateway_id=gateway_id,
2224
+ _request_auth=_request_auth,
2225
+ _content_type=_content_type,
2226
+ _headers=_headers,
2227
+ _host_index=_host_index,
2228
+ )
2229
+
2230
+ _response_types_map: Dict[str, Optional[str]] = {
2231
+ "200": "GatewayStatusResponse",
2232
+ "400": "APIErrorResponse",
2233
+ "401": "APIErrorResponse",
2234
+ "403": "APIErrorResponse",
2235
+ "404": "APIErrorResponse",
2236
+ "500": "APIErrorResponse",
2237
+ }
2238
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2239
+ return response_data.response
2240
+
2241
+ def _get_vpn_gateway_status_serialize(
2242
+ self,
2243
+ project_id,
2244
+ region,
2245
+ gateway_id,
2246
+ _request_auth,
2247
+ _content_type,
2248
+ _headers,
2249
+ _host_index,
2250
+ ) -> RequestSerialized:
2251
+
2252
+ _host = None
2253
+
2254
+ _collection_formats: Dict[str, str] = {}
2255
+
2256
+ _path_params: Dict[str, str] = {}
2257
+ _query_params: List[Tuple[str, str]] = []
2258
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2259
+ _form_params: List[Tuple[str, str]] = []
2260
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2261
+ _body_params: Optional[bytes] = None
2262
+
2263
+ # process the path parameters
2264
+ if project_id is not None:
2265
+ _path_params["projectId"] = project_id
2266
+ if region is not None:
2267
+ _path_params["region"] = region.value
2268
+ if gateway_id is not None:
2269
+ _path_params["gatewayId"] = gateway_id
2270
+ # process the query parameters
2271
+ # process the header parameters
2272
+ # process the form parameters
2273
+ # process the body parameter
2274
+
2275
+ # set the HTTP header `Accept`
2276
+ if "Accept" not in _header_params:
2277
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2278
+
2279
+ # authentication setting
2280
+ _auth_settings: List[str] = []
2281
+
2282
+ return self.api_client.param_serialize(
2283
+ method="GET",
2284
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/status",
2285
+ path_params=_path_params,
2286
+ query_params=_query_params,
2287
+ header_params=_header_params,
2288
+ body=_body_params,
2289
+ post_params=_form_params,
2290
+ files=_files,
2291
+ auth_settings=_auth_settings,
2292
+ collection_formats=_collection_formats,
2293
+ _host=_host,
2294
+ _request_auth=_request_auth,
2295
+ )
2296
+
2297
+ @validate_call
2298
+ def list_gateway_connections(
2299
+ self,
2300
+ project_id: StrictStr,
2301
+ region: Region,
2302
+ gateway_id: UUID,
2303
+ label_selector: Annotated[
2304
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
2305
+ ] = None,
2306
+ _request_timeout: Union[
2307
+ None,
2308
+ Annotated[StrictFloat, Field(gt=0)],
2309
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2310
+ ] = None,
2311
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2312
+ _content_type: Optional[StrictStr] = None,
2313
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2314
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2315
+ ) -> ConnectionList:
2316
+ """List connections for an existing VPN gateway.
2317
+
2318
+ List connections for an existing VPN gateway.
2319
+
2320
+ :param project_id: (required)
2321
+ :type project_id: str
2322
+ :param region: (required)
2323
+ :type region: Region
2324
+ :param gateway_id: (required)
2325
+ :type gateway_id: UUID
2326
+ :param label_selector: Filter resources by labels.
2327
+ :type label_selector: Dict[str, str]
2328
+ :param _request_timeout: timeout setting for this request. If one
2329
+ number provided, it will be total request
2330
+ timeout. It can also be a pair (tuple) of
2331
+ (connection, read) timeouts.
2332
+ :type _request_timeout: int, tuple(int, int), optional
2333
+ :param _request_auth: set to override the auth_settings for an a single
2334
+ request; this effectively ignores the
2335
+ authentication in the spec for a single request.
2336
+ :type _request_auth: dict, optional
2337
+ :param _content_type: force content-type for the request.
2338
+ :type _content_type: str, Optional
2339
+ :param _headers: set to override the headers for a single
2340
+ request; this effectively ignores the headers
2341
+ in the spec for a single request.
2342
+ :type _headers: dict, optional
2343
+ :param _host_index: set to override the host_index for a single
2344
+ request; this effectively ignores the host_index
2345
+ in the spec for a single request.
2346
+ :type _host_index: int, optional
2347
+ :return: Returns the result object.
2348
+ """ # noqa: E501
2349
+
2350
+ _param = self._list_gateway_connections_serialize(
2351
+ project_id=project_id,
2352
+ region=region,
2353
+ gateway_id=gateway_id,
2354
+ label_selector=label_selector,
2355
+ _request_auth=_request_auth,
2356
+ _content_type=_content_type,
2357
+ _headers=_headers,
2358
+ _host_index=_host_index,
2359
+ )
2360
+
2361
+ _response_types_map: Dict[str, Optional[str]] = {
2362
+ "200": "ConnectionList",
2363
+ "400": "APIErrorResponse",
2364
+ "401": "APIErrorResponse",
2365
+ "403": "APIErrorResponse",
2366
+ "404": "APIErrorResponse",
2367
+ "500": "APIErrorResponse",
2368
+ }
2369
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2370
+ response_data.read()
2371
+ return self.api_client.response_deserialize(
2372
+ response_data=response_data,
2373
+ response_types_map=_response_types_map,
2374
+ ).data
2375
+
2376
+ @validate_call
2377
+ def list_gateway_connections_with_http_info(
2378
+ self,
2379
+ project_id: StrictStr,
2380
+ region: Region,
2381
+ gateway_id: UUID,
2382
+ label_selector: Annotated[
2383
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
2384
+ ] = None,
2385
+ _request_timeout: Union[
2386
+ None,
2387
+ Annotated[StrictFloat, Field(gt=0)],
2388
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2389
+ ] = None,
2390
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2391
+ _content_type: Optional[StrictStr] = None,
2392
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2393
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2394
+ ) -> ApiResponse[ConnectionList]:
2395
+ """List connections for an existing VPN gateway.
2396
+
2397
+ List connections for an existing VPN gateway.
2398
+
2399
+ :param project_id: (required)
2400
+ :type project_id: str
2401
+ :param region: (required)
2402
+ :type region: Region
2403
+ :param gateway_id: (required)
2404
+ :type gateway_id: UUID
2405
+ :param label_selector: Filter resources by labels.
2406
+ :type label_selector: Dict[str, str]
2407
+ :param _request_timeout: timeout setting for this request. If one
2408
+ number provided, it will be total request
2409
+ timeout. It can also be a pair (tuple) of
2410
+ (connection, read) timeouts.
2411
+ :type _request_timeout: int, tuple(int, int), optional
2412
+ :param _request_auth: set to override the auth_settings for an a single
2413
+ request; this effectively ignores the
2414
+ authentication in the spec for a single request.
2415
+ :type _request_auth: dict, optional
2416
+ :param _content_type: force content-type for the request.
2417
+ :type _content_type: str, Optional
2418
+ :param _headers: set to override the headers for a single
2419
+ request; this effectively ignores the headers
2420
+ in the spec for a single request.
2421
+ :type _headers: dict, optional
2422
+ :param _host_index: set to override the host_index for a single
2423
+ request; this effectively ignores the host_index
2424
+ in the spec for a single request.
2425
+ :type _host_index: int, optional
2426
+ :return: Returns the result object.
2427
+ """ # noqa: E501
2428
+
2429
+ _param = self._list_gateway_connections_serialize(
2430
+ project_id=project_id,
2431
+ region=region,
2432
+ gateway_id=gateway_id,
2433
+ label_selector=label_selector,
2434
+ _request_auth=_request_auth,
2435
+ _content_type=_content_type,
2436
+ _headers=_headers,
2437
+ _host_index=_host_index,
2438
+ )
2439
+
2440
+ _response_types_map: Dict[str, Optional[str]] = {
2441
+ "200": "ConnectionList",
2442
+ "400": "APIErrorResponse",
2443
+ "401": "APIErrorResponse",
2444
+ "403": "APIErrorResponse",
2445
+ "404": "APIErrorResponse",
2446
+ "500": "APIErrorResponse",
2447
+ }
2448
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2449
+ response_data.read()
2450
+ return self.api_client.response_deserialize(
2451
+ response_data=response_data,
2452
+ response_types_map=_response_types_map,
2453
+ )
2454
+
2455
+ @validate_call
2456
+ def list_gateway_connections_without_preload_content(
2457
+ self,
2458
+ project_id: StrictStr,
2459
+ region: Region,
2460
+ gateway_id: UUID,
2461
+ label_selector: Annotated[
2462
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
2463
+ ] = None,
2464
+ _request_timeout: Union[
2465
+ None,
2466
+ Annotated[StrictFloat, Field(gt=0)],
2467
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2468
+ ] = None,
2469
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2470
+ _content_type: Optional[StrictStr] = None,
2471
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2472
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2473
+ ) -> RESTResponseType:
2474
+ """List connections for an existing VPN gateway.
2475
+
2476
+ List connections for an existing VPN gateway.
2477
+
2478
+ :param project_id: (required)
2479
+ :type project_id: str
2480
+ :param region: (required)
2481
+ :type region: Region
2482
+ :param gateway_id: (required)
2483
+ :type gateway_id: UUID
2484
+ :param label_selector: Filter resources by labels.
2485
+ :type label_selector: Dict[str, str]
2486
+ :param _request_timeout: timeout setting for this request. If one
2487
+ number provided, it will be total request
2488
+ timeout. It can also be a pair (tuple) of
2489
+ (connection, read) timeouts.
2490
+ :type _request_timeout: int, tuple(int, int), optional
2491
+ :param _request_auth: set to override the auth_settings for an a single
2492
+ request; this effectively ignores the
2493
+ authentication in the spec for a single request.
2494
+ :type _request_auth: dict, optional
2495
+ :param _content_type: force content-type for the request.
2496
+ :type _content_type: str, Optional
2497
+ :param _headers: set to override the headers for a single
2498
+ request; this effectively ignores the headers
2499
+ in the spec for a single request.
2500
+ :type _headers: dict, optional
2501
+ :param _host_index: set to override the host_index for a single
2502
+ request; this effectively ignores the host_index
2503
+ in the spec for a single request.
2504
+ :type _host_index: int, optional
2505
+ :return: Returns the result object.
2506
+ """ # noqa: E501
2507
+
2508
+ _param = self._list_gateway_connections_serialize(
2509
+ project_id=project_id,
2510
+ region=region,
2511
+ gateway_id=gateway_id,
2512
+ label_selector=label_selector,
2513
+ _request_auth=_request_auth,
2514
+ _content_type=_content_type,
2515
+ _headers=_headers,
2516
+ _host_index=_host_index,
2517
+ )
2518
+
2519
+ _response_types_map: Dict[str, Optional[str]] = {
2520
+ "200": "ConnectionList",
2521
+ "400": "APIErrorResponse",
2522
+ "401": "APIErrorResponse",
2523
+ "403": "APIErrorResponse",
2524
+ "404": "APIErrorResponse",
2525
+ "500": "APIErrorResponse",
2526
+ }
2527
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2528
+ return response_data.response
2529
+
2530
+ def _list_gateway_connections_serialize(
2531
+ self,
2532
+ project_id,
2533
+ region,
2534
+ gateway_id,
2535
+ label_selector,
2536
+ _request_auth,
2537
+ _content_type,
2538
+ _headers,
2539
+ _host_index,
2540
+ ) -> RequestSerialized:
2541
+
2542
+ _host = None
2543
+
2544
+ _collection_formats: Dict[str, str] = {}
2545
+
2546
+ _path_params: Dict[str, str] = {}
2547
+ _query_params: List[Tuple[str, str]] = []
2548
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2549
+ _form_params: List[Tuple[str, str]] = []
2550
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2551
+ _body_params: Optional[bytes] = None
2552
+
2553
+ # process the path parameters
2554
+ if project_id is not None:
2555
+ _path_params["projectId"] = project_id
2556
+ if region is not None:
2557
+ _path_params["region"] = region.value
2558
+ if gateway_id is not None:
2559
+ _path_params["gatewayId"] = gateway_id
2560
+ # process the query parameters
2561
+ if label_selector is not None:
2562
+
2563
+ _query_params.append(("label_selector", label_selector))
2564
+
2565
+ # process the header parameters
2566
+ # process the form parameters
2567
+ # process the body parameter
2568
+
2569
+ # set the HTTP header `Accept`
2570
+ if "Accept" not in _header_params:
2571
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2572
+
2573
+ # authentication setting
2574
+ _auth_settings: List[str] = []
2575
+
2576
+ return self.api_client.param_serialize(
2577
+ method="GET",
2578
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections",
2579
+ path_params=_path_params,
2580
+ query_params=_query_params,
2581
+ header_params=_header_params,
2582
+ body=_body_params,
2583
+ post_params=_form_params,
2584
+ files=_files,
2585
+ auth_settings=_auth_settings,
2586
+ collection_formats=_collection_formats,
2587
+ _host=_host,
2588
+ _request_auth=_request_auth,
2589
+ )
2590
+
2591
+ @validate_call
2592
+ def list_plans(
2593
+ self,
2594
+ region: Region,
2595
+ _request_timeout: Union[
2596
+ None,
2597
+ Annotated[StrictFloat, Field(gt=0)],
2598
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2599
+ ] = None,
2600
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2601
+ _content_type: Optional[StrictStr] = None,
2602
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2603
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2604
+ ) -> PlanList:
2605
+ """List available service plans for a project.
2606
+
2607
+ Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation.
2608
+
2609
+ :param region: (required)
2610
+ :type region: Region
2611
+ :param _request_timeout: timeout setting for this request. If one
2612
+ number provided, it will be total request
2613
+ timeout. It can also be a pair (tuple) of
2614
+ (connection, read) timeouts.
2615
+ :type _request_timeout: int, tuple(int, int), optional
2616
+ :param _request_auth: set to override the auth_settings for an a single
2617
+ request; this effectively ignores the
2618
+ authentication in the spec for a single request.
2619
+ :type _request_auth: dict, optional
2620
+ :param _content_type: force content-type for the request.
2621
+ :type _content_type: str, Optional
2622
+ :param _headers: set to override the headers for a single
2623
+ request; this effectively ignores the headers
2624
+ in the spec for a single request.
2625
+ :type _headers: dict, optional
2626
+ :param _host_index: set to override the host_index for a single
2627
+ request; this effectively ignores the host_index
2628
+ in the spec for a single request.
2629
+ :type _host_index: int, optional
2630
+ :return: Returns the result object.
2631
+ """ # noqa: E501
2632
+
2633
+ _param = self._list_plans_serialize(
2634
+ region=region,
2635
+ _request_auth=_request_auth,
2636
+ _content_type=_content_type,
2637
+ _headers=_headers,
2638
+ _host_index=_host_index,
2639
+ )
2640
+
2641
+ _response_types_map: Dict[str, Optional[str]] = {
2642
+ "200": "PlanList",
2643
+ "400": "APIErrorResponse",
2644
+ "401": "APIErrorResponse",
2645
+ }
2646
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2647
+ response_data.read()
2648
+ return self.api_client.response_deserialize(
2649
+ response_data=response_data,
2650
+ response_types_map=_response_types_map,
2651
+ ).data
2652
+
2653
+ @validate_call
2654
+ def list_plans_with_http_info(
2655
+ self,
2656
+ region: Region,
2657
+ _request_timeout: Union[
2658
+ None,
2659
+ Annotated[StrictFloat, Field(gt=0)],
2660
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2661
+ ] = None,
2662
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2663
+ _content_type: Optional[StrictStr] = None,
2664
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2665
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2666
+ ) -> ApiResponse[PlanList]:
2667
+ """List available service plans for a project.
2668
+
2669
+ Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation.
2670
+
2671
+ :param region: (required)
2672
+ :type region: Region
2673
+ :param _request_timeout: timeout setting for this request. If one
2674
+ number provided, it will be total request
2675
+ timeout. It can also be a pair (tuple) of
2676
+ (connection, read) timeouts.
2677
+ :type _request_timeout: int, tuple(int, int), optional
2678
+ :param _request_auth: set to override the auth_settings for an a single
2679
+ request; this effectively ignores the
2680
+ authentication in the spec for a single request.
2681
+ :type _request_auth: dict, optional
2682
+ :param _content_type: force content-type for the request.
2683
+ :type _content_type: str, Optional
2684
+ :param _headers: set to override the headers for a single
2685
+ request; this effectively ignores the headers
2686
+ in the spec for a single request.
2687
+ :type _headers: dict, optional
2688
+ :param _host_index: set to override the host_index for a single
2689
+ request; this effectively ignores the host_index
2690
+ in the spec for a single request.
2691
+ :type _host_index: int, optional
2692
+ :return: Returns the result object.
2693
+ """ # noqa: E501
2694
+
2695
+ _param = self._list_plans_serialize(
2696
+ region=region,
2697
+ _request_auth=_request_auth,
2698
+ _content_type=_content_type,
2699
+ _headers=_headers,
2700
+ _host_index=_host_index,
2701
+ )
2702
+
2703
+ _response_types_map: Dict[str, Optional[str]] = {
2704
+ "200": "PlanList",
2705
+ "400": "APIErrorResponse",
2706
+ "401": "APIErrorResponse",
2707
+ }
2708
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2709
+ response_data.read()
2710
+ return self.api_client.response_deserialize(
2711
+ response_data=response_data,
2712
+ response_types_map=_response_types_map,
2713
+ )
2714
+
2715
+ @validate_call
2716
+ def list_plans_without_preload_content(
2717
+ self,
2718
+ region: Region,
2719
+ _request_timeout: Union[
2720
+ None,
2721
+ Annotated[StrictFloat, Field(gt=0)],
2722
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2723
+ ] = None,
2724
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2725
+ _content_type: Optional[StrictStr] = None,
2726
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2727
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2728
+ ) -> RESTResponseType:
2729
+ """List available service plans for a project.
2730
+
2731
+ Retrieve a list of available service plans available for provisioning a VPN in a specific `region`. Use this to identify the `planId` required for gateway creation.
2732
+
2733
+ :param region: (required)
2734
+ :type region: Region
2735
+ :param _request_timeout: timeout setting for this request. If one
2736
+ number provided, it will be total request
2737
+ timeout. It can also be a pair (tuple) of
2738
+ (connection, read) timeouts.
2739
+ :type _request_timeout: int, tuple(int, int), optional
2740
+ :param _request_auth: set to override the auth_settings for an a single
2741
+ request; this effectively ignores the
2742
+ authentication in the spec for a single request.
2743
+ :type _request_auth: dict, optional
2744
+ :param _content_type: force content-type for the request.
2745
+ :type _content_type: str, Optional
2746
+ :param _headers: set to override the headers for a single
2747
+ request; this effectively ignores the headers
2748
+ in the spec for a single request.
2749
+ :type _headers: dict, optional
2750
+ :param _host_index: set to override the host_index for a single
2751
+ request; this effectively ignores the host_index
2752
+ in the spec for a single request.
2753
+ :type _host_index: int, optional
2754
+ :return: Returns the result object.
2755
+ """ # noqa: E501
2756
+
2757
+ _param = self._list_plans_serialize(
2758
+ region=region,
2759
+ _request_auth=_request_auth,
2760
+ _content_type=_content_type,
2761
+ _headers=_headers,
2762
+ _host_index=_host_index,
2763
+ )
2764
+
2765
+ _response_types_map: Dict[str, Optional[str]] = {
2766
+ "200": "PlanList",
2767
+ "400": "APIErrorResponse",
2768
+ "401": "APIErrorResponse",
2769
+ }
2770
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2771
+ return response_data.response
2772
+
2773
+ def _list_plans_serialize(
2774
+ self,
2775
+ region,
2776
+ _request_auth,
2777
+ _content_type,
2778
+ _headers,
2779
+ _host_index,
2780
+ ) -> RequestSerialized:
2781
+
2782
+ _host = None
2783
+
2784
+ _collection_formats: Dict[str, str] = {}
2785
+
2786
+ _path_params: Dict[str, str] = {}
2787
+ _query_params: List[Tuple[str, str]] = []
2788
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2789
+ _form_params: List[Tuple[str, str]] = []
2790
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2791
+ _body_params: Optional[bytes] = None
2792
+
2793
+ # process the path parameters
2794
+ if region is not None:
2795
+ _path_params["region"] = region.value
2796
+ # process the query parameters
2797
+ # process the header parameters
2798
+ # process the form parameters
2799
+ # process the body parameter
2800
+
2801
+ # set the HTTP header `Accept`
2802
+ if "Accept" not in _header_params:
2803
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2804
+
2805
+ # authentication setting
2806
+ _auth_settings: List[str] = []
2807
+
2808
+ return self.api_client.param_serialize(
2809
+ method="GET",
2810
+ resource_path="/v1beta1/regions/{region}/plans",
2811
+ path_params=_path_params,
2812
+ query_params=_query_params,
2813
+ header_params=_header_params,
2814
+ body=_body_params,
2815
+ post_params=_form_params,
2816
+ files=_files,
2817
+ auth_settings=_auth_settings,
2818
+ collection_formats=_collection_formats,
2819
+ _host=_host,
2820
+ _request_auth=_request_auth,
2821
+ )
2822
+
2823
+ @validate_call
2824
+ def list_quotas(
2825
+ self,
2826
+ project_id: StrictStr,
2827
+ region: Region,
2828
+ _request_timeout: Union[
2829
+ None,
2830
+ Annotated[StrictFloat, Field(gt=0)],
2831
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2832
+ ] = None,
2833
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2834
+ _content_type: Optional[StrictStr] = None,
2835
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2836
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2837
+ ) -> QuotaListResponse:
2838
+ """List project quotas.
2839
+
2840
+ Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region.
2841
+
2842
+ :param project_id: (required)
2843
+ :type project_id: str
2844
+ :param region: (required)
2845
+ :type region: Region
2846
+ :param _request_timeout: timeout setting for this request. If one
2847
+ number provided, it will be total request
2848
+ timeout. It can also be a pair (tuple) of
2849
+ (connection, read) timeouts.
2850
+ :type _request_timeout: int, tuple(int, int), optional
2851
+ :param _request_auth: set to override the auth_settings for an a single
2852
+ request; this effectively ignores the
2853
+ authentication in the spec for a single request.
2854
+ :type _request_auth: dict, optional
2855
+ :param _content_type: force content-type for the request.
2856
+ :type _content_type: str, Optional
2857
+ :param _headers: set to override the headers for a single
2858
+ request; this effectively ignores the headers
2859
+ in the spec for a single request.
2860
+ :type _headers: dict, optional
2861
+ :param _host_index: set to override the host_index for a single
2862
+ request; this effectively ignores the host_index
2863
+ in the spec for a single request.
2864
+ :type _host_index: int, optional
2865
+ :return: Returns the result object.
2866
+ """ # noqa: E501
2867
+
2868
+ _param = self._list_quotas_serialize(
2869
+ project_id=project_id,
2870
+ region=region,
2871
+ _request_auth=_request_auth,
2872
+ _content_type=_content_type,
2873
+ _headers=_headers,
2874
+ _host_index=_host_index,
2875
+ )
2876
+
2877
+ _response_types_map: Dict[str, Optional[str]] = {
2878
+ "200": "QuotaListResponse",
2879
+ "400": "APIErrorResponse",
2880
+ "401": "APIErrorResponse",
2881
+ }
2882
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2883
+ response_data.read()
2884
+ return self.api_client.response_deserialize(
2885
+ response_data=response_data,
2886
+ response_types_map=_response_types_map,
2887
+ ).data
2888
+
2889
+ @validate_call
2890
+ def list_quotas_with_http_info(
2891
+ self,
2892
+ project_id: StrictStr,
2893
+ region: Region,
2894
+ _request_timeout: Union[
2895
+ None,
2896
+ Annotated[StrictFloat, Field(gt=0)],
2897
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2898
+ ] = None,
2899
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2900
+ _content_type: Optional[StrictStr] = None,
2901
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2902
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2903
+ ) -> ApiResponse[QuotaListResponse]:
2904
+ """List project quotas.
2905
+
2906
+ Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region.
2907
+
2908
+ :param project_id: (required)
2909
+ :type project_id: str
2910
+ :param region: (required)
2911
+ :type region: Region
2912
+ :param _request_timeout: timeout setting for this request. If one
2913
+ number provided, it will be total request
2914
+ timeout. It can also be a pair (tuple) of
2915
+ (connection, read) timeouts.
2916
+ :type _request_timeout: int, tuple(int, int), optional
2917
+ :param _request_auth: set to override the auth_settings for an a single
2918
+ request; this effectively ignores the
2919
+ authentication in the spec for a single request.
2920
+ :type _request_auth: dict, optional
2921
+ :param _content_type: force content-type for the request.
2922
+ :type _content_type: str, Optional
2923
+ :param _headers: set to override the headers for a single
2924
+ request; this effectively ignores the headers
2925
+ in the spec for a single request.
2926
+ :type _headers: dict, optional
2927
+ :param _host_index: set to override the host_index for a single
2928
+ request; this effectively ignores the host_index
2929
+ in the spec for a single request.
2930
+ :type _host_index: int, optional
2931
+ :return: Returns the result object.
2932
+ """ # noqa: E501
2933
+
2934
+ _param = self._list_quotas_serialize(
2935
+ project_id=project_id,
2936
+ region=region,
2937
+ _request_auth=_request_auth,
2938
+ _content_type=_content_type,
2939
+ _headers=_headers,
2940
+ _host_index=_host_index,
2941
+ )
2942
+
2943
+ _response_types_map: Dict[str, Optional[str]] = {
2944
+ "200": "QuotaListResponse",
2945
+ "400": "APIErrorResponse",
2946
+ "401": "APIErrorResponse",
2947
+ }
2948
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2949
+ response_data.read()
2950
+ return self.api_client.response_deserialize(
2951
+ response_data=response_data,
2952
+ response_types_map=_response_types_map,
2953
+ )
2954
+
2955
+ @validate_call
2956
+ def list_quotas_without_preload_content(
2957
+ self,
2958
+ project_id: StrictStr,
2959
+ region: Region,
2960
+ _request_timeout: Union[
2961
+ None,
2962
+ Annotated[StrictFloat, Field(gt=0)],
2963
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2964
+ ] = None,
2965
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2966
+ _content_type: Optional[StrictStr] = None,
2967
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2968
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2969
+ ) -> RESTResponseType:
2970
+ """List project quotas.
2971
+
2972
+ Retrieve the resource quotas and current usage for STACKIT VPN within a specific project and region.
2973
+
2974
+ :param project_id: (required)
2975
+ :type project_id: str
2976
+ :param region: (required)
2977
+ :type region: Region
2978
+ :param _request_timeout: timeout setting for this request. If one
2979
+ number provided, it will be total request
2980
+ timeout. It can also be a pair (tuple) of
2981
+ (connection, read) timeouts.
2982
+ :type _request_timeout: int, tuple(int, int), optional
2983
+ :param _request_auth: set to override the auth_settings for an a single
2984
+ request; this effectively ignores the
2985
+ authentication in the spec for a single request.
2986
+ :type _request_auth: dict, optional
2987
+ :param _content_type: force content-type for the request.
2988
+ :type _content_type: str, Optional
2989
+ :param _headers: set to override the headers for a single
2990
+ request; this effectively ignores the headers
2991
+ in the spec for a single request.
2992
+ :type _headers: dict, optional
2993
+ :param _host_index: set to override the host_index for a single
2994
+ request; this effectively ignores the host_index
2995
+ in the spec for a single request.
2996
+ :type _host_index: int, optional
2997
+ :return: Returns the result object.
2998
+ """ # noqa: E501
2999
+
3000
+ _param = self._list_quotas_serialize(
3001
+ project_id=project_id,
3002
+ region=region,
3003
+ _request_auth=_request_auth,
3004
+ _content_type=_content_type,
3005
+ _headers=_headers,
3006
+ _host_index=_host_index,
3007
+ )
3008
+
3009
+ _response_types_map: Dict[str, Optional[str]] = {
3010
+ "200": "QuotaListResponse",
3011
+ "400": "APIErrorResponse",
3012
+ "401": "APIErrorResponse",
3013
+ }
3014
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3015
+ return response_data.response
3016
+
3017
+ def _list_quotas_serialize(
3018
+ self,
3019
+ project_id,
3020
+ region,
3021
+ _request_auth,
3022
+ _content_type,
3023
+ _headers,
3024
+ _host_index,
3025
+ ) -> RequestSerialized:
3026
+
3027
+ _host = None
3028
+
3029
+ _collection_formats: Dict[str, str] = {}
3030
+
3031
+ _path_params: Dict[str, str] = {}
3032
+ _query_params: List[Tuple[str, str]] = []
3033
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3034
+ _form_params: List[Tuple[str, str]] = []
3035
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3036
+ _body_params: Optional[bytes] = None
3037
+
3038
+ # process the path parameters
3039
+ if project_id is not None:
3040
+ _path_params["projectId"] = project_id
3041
+ if region is not None:
3042
+ _path_params["region"] = region.value
3043
+ # process the query parameters
3044
+ # process the header parameters
3045
+ # process the form parameters
3046
+ # process the body parameter
3047
+
3048
+ # set the HTTP header `Accept`
3049
+ if "Accept" not in _header_params:
3050
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3051
+
3052
+ # authentication setting
3053
+ _auth_settings: List[str] = []
3054
+
3055
+ return self.api_client.param_serialize(
3056
+ method="GET",
3057
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/quotas",
3058
+ path_params=_path_params,
3059
+ query_params=_query_params,
3060
+ header_params=_header_params,
3061
+ body=_body_params,
3062
+ post_params=_form_params,
3063
+ files=_files,
3064
+ auth_settings=_auth_settings,
3065
+ collection_formats=_collection_formats,
3066
+ _host=_host,
3067
+ _request_auth=_request_auth,
3068
+ )
3069
+
3070
+ @validate_call
3071
+ def list_vpn_gateways(
3072
+ self,
3073
+ project_id: StrictStr,
3074
+ region: Region,
3075
+ label_selector: Annotated[
3076
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
3077
+ ] = None,
3078
+ _request_timeout: Union[
3079
+ None,
3080
+ Annotated[StrictFloat, Field(gt=0)],
3081
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3082
+ ] = None,
3083
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3084
+ _content_type: Optional[StrictStr] = None,
3085
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3086
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3087
+ ) -> GatewayList:
3088
+ """List VPN gateways in a project with label filtering
3089
+
3090
+ Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter.
3091
+
3092
+ :param project_id: (required)
3093
+ :type project_id: str
3094
+ :param region: (required)
3095
+ :type region: Region
3096
+ :param label_selector: Filter resources by labels.
3097
+ :type label_selector: Dict[str, str]
3098
+ :param _request_timeout: timeout setting for this request. If one
3099
+ number provided, it will be total request
3100
+ timeout. It can also be a pair (tuple) of
3101
+ (connection, read) timeouts.
3102
+ :type _request_timeout: int, tuple(int, int), optional
3103
+ :param _request_auth: set to override the auth_settings for an a single
3104
+ request; this effectively ignores the
3105
+ authentication in the spec for a single request.
3106
+ :type _request_auth: dict, optional
3107
+ :param _content_type: force content-type for the request.
3108
+ :type _content_type: str, Optional
3109
+ :param _headers: set to override the headers for a single
3110
+ request; this effectively ignores the headers
3111
+ in the spec for a single request.
3112
+ :type _headers: dict, optional
3113
+ :param _host_index: set to override the host_index for a single
3114
+ request; this effectively ignores the host_index
3115
+ in the spec for a single request.
3116
+ :type _host_index: int, optional
3117
+ :return: Returns the result object.
3118
+ """ # noqa: E501
3119
+
3120
+ _param = self._list_vpn_gateways_serialize(
3121
+ project_id=project_id,
3122
+ region=region,
3123
+ label_selector=label_selector,
3124
+ _request_auth=_request_auth,
3125
+ _content_type=_content_type,
3126
+ _headers=_headers,
3127
+ _host_index=_host_index,
3128
+ )
3129
+
3130
+ _response_types_map: Dict[str, Optional[str]] = {
3131
+ "200": "GatewayList",
3132
+ "400": "APIErrorResponse",
3133
+ "401": "APIErrorResponse",
3134
+ "403": "APIErrorResponse",
3135
+ "500": "APIErrorResponse",
3136
+ }
3137
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3138
+ response_data.read()
3139
+ return self.api_client.response_deserialize(
3140
+ response_data=response_data,
3141
+ response_types_map=_response_types_map,
3142
+ ).data
3143
+
3144
+ @validate_call
3145
+ def list_vpn_gateways_with_http_info(
3146
+ self,
3147
+ project_id: StrictStr,
3148
+ region: Region,
3149
+ label_selector: Annotated[
3150
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
3151
+ ] = None,
3152
+ _request_timeout: Union[
3153
+ None,
3154
+ Annotated[StrictFloat, Field(gt=0)],
3155
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3156
+ ] = None,
3157
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3158
+ _content_type: Optional[StrictStr] = None,
3159
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3160
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3161
+ ) -> ApiResponse[GatewayList]:
3162
+ """List VPN gateways in a project with label filtering
3163
+
3164
+ Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter.
3165
+
3166
+ :param project_id: (required)
3167
+ :type project_id: str
3168
+ :param region: (required)
3169
+ :type region: Region
3170
+ :param label_selector: Filter resources by labels.
3171
+ :type label_selector: Dict[str, str]
3172
+ :param _request_timeout: timeout setting for this request. If one
3173
+ number provided, it will be total request
3174
+ timeout. It can also be a pair (tuple) of
3175
+ (connection, read) timeouts.
3176
+ :type _request_timeout: int, tuple(int, int), optional
3177
+ :param _request_auth: set to override the auth_settings for an a single
3178
+ request; this effectively ignores the
3179
+ authentication in the spec for a single request.
3180
+ :type _request_auth: dict, optional
3181
+ :param _content_type: force content-type for the request.
3182
+ :type _content_type: str, Optional
3183
+ :param _headers: set to override the headers for a single
3184
+ request; this effectively ignores the headers
3185
+ in the spec for a single request.
3186
+ :type _headers: dict, optional
3187
+ :param _host_index: set to override the host_index for a single
3188
+ request; this effectively ignores the host_index
3189
+ in the spec for a single request.
3190
+ :type _host_index: int, optional
3191
+ :return: Returns the result object.
3192
+ """ # noqa: E501
3193
+
3194
+ _param = self._list_vpn_gateways_serialize(
3195
+ project_id=project_id,
3196
+ region=region,
3197
+ label_selector=label_selector,
3198
+ _request_auth=_request_auth,
3199
+ _content_type=_content_type,
3200
+ _headers=_headers,
3201
+ _host_index=_host_index,
3202
+ )
3203
+
3204
+ _response_types_map: Dict[str, Optional[str]] = {
3205
+ "200": "GatewayList",
3206
+ "400": "APIErrorResponse",
3207
+ "401": "APIErrorResponse",
3208
+ "403": "APIErrorResponse",
3209
+ "500": "APIErrorResponse",
3210
+ }
3211
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3212
+ response_data.read()
3213
+ return self.api_client.response_deserialize(
3214
+ response_data=response_data,
3215
+ response_types_map=_response_types_map,
3216
+ )
3217
+
3218
+ @validate_call
3219
+ def list_vpn_gateways_without_preload_content(
3220
+ self,
3221
+ project_id: StrictStr,
3222
+ region: Region,
3223
+ label_selector: Annotated[
3224
+ Optional[Dict[str, Dict[str, StrictStr]]], Field(description="Filter resources by labels.")
3225
+ ] = None,
3226
+ _request_timeout: Union[
3227
+ None,
3228
+ Annotated[StrictFloat, Field(gt=0)],
3229
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3230
+ ] = None,
3231
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3232
+ _content_type: Optional[StrictStr] = None,
3233
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3234
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3235
+ ) -> RESTResponseType:
3236
+ """List VPN gateways in a project with label filtering
3237
+
3238
+ Retrieve a list of all VPN gateways in a project. Filter the results using the `label_selector` query parameter.
3239
+
3240
+ :param project_id: (required)
3241
+ :type project_id: str
3242
+ :param region: (required)
3243
+ :type region: Region
3244
+ :param label_selector: Filter resources by labels.
3245
+ :type label_selector: Dict[str, str]
3246
+ :param _request_timeout: timeout setting for this request. If one
3247
+ number provided, it will be total request
3248
+ timeout. It can also be a pair (tuple) of
3249
+ (connection, read) timeouts.
3250
+ :type _request_timeout: int, tuple(int, int), optional
3251
+ :param _request_auth: set to override the auth_settings for an a single
3252
+ request; this effectively ignores the
3253
+ authentication in the spec for a single request.
3254
+ :type _request_auth: dict, optional
3255
+ :param _content_type: force content-type for the request.
3256
+ :type _content_type: str, Optional
3257
+ :param _headers: set to override the headers for a single
3258
+ request; this effectively ignores the headers
3259
+ in the spec for a single request.
3260
+ :type _headers: dict, optional
3261
+ :param _host_index: set to override the host_index for a single
3262
+ request; this effectively ignores the host_index
3263
+ in the spec for a single request.
3264
+ :type _host_index: int, optional
3265
+ :return: Returns the result object.
3266
+ """ # noqa: E501
3267
+
3268
+ _param = self._list_vpn_gateways_serialize(
3269
+ project_id=project_id,
3270
+ region=region,
3271
+ label_selector=label_selector,
3272
+ _request_auth=_request_auth,
3273
+ _content_type=_content_type,
3274
+ _headers=_headers,
3275
+ _host_index=_host_index,
3276
+ )
3277
+
3278
+ _response_types_map: Dict[str, Optional[str]] = {
3279
+ "200": "GatewayList",
3280
+ "400": "APIErrorResponse",
3281
+ "401": "APIErrorResponse",
3282
+ "403": "APIErrorResponse",
3283
+ "500": "APIErrorResponse",
3284
+ }
3285
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3286
+ return response_data.response
3287
+
3288
+ def _list_vpn_gateways_serialize(
3289
+ self,
3290
+ project_id,
3291
+ region,
3292
+ label_selector,
3293
+ _request_auth,
3294
+ _content_type,
3295
+ _headers,
3296
+ _host_index,
3297
+ ) -> RequestSerialized:
3298
+
3299
+ _host = None
3300
+
3301
+ _collection_formats: Dict[str, str] = {}
3302
+
3303
+ _path_params: Dict[str, str] = {}
3304
+ _query_params: List[Tuple[str, str]] = []
3305
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3306
+ _form_params: List[Tuple[str, str]] = []
3307
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3308
+ _body_params: Optional[bytes] = None
3309
+
3310
+ # process the path parameters
3311
+ if project_id is not None:
3312
+ _path_params["projectId"] = project_id
3313
+ if region is not None:
3314
+ _path_params["region"] = region.value
3315
+ # process the query parameters
3316
+ if label_selector is not None:
3317
+
3318
+ _query_params.append(("label_selector", label_selector))
3319
+
3320
+ # process the header parameters
3321
+ # process the form parameters
3322
+ # process the body parameter
3323
+
3324
+ # set the HTTP header `Accept`
3325
+ if "Accept" not in _header_params:
3326
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3327
+
3328
+ # authentication setting
3329
+ _auth_settings: List[str] = []
3330
+
3331
+ return self.api_client.param_serialize(
3332
+ method="GET",
3333
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways",
3334
+ path_params=_path_params,
3335
+ query_params=_query_params,
3336
+ header_params=_header_params,
3337
+ body=_body_params,
3338
+ post_params=_form_params,
3339
+ files=_files,
3340
+ auth_settings=_auth_settings,
3341
+ collection_formats=_collection_formats,
3342
+ _host=_host,
3343
+ _request_auth=_request_auth,
3344
+ )
3345
+
3346
+ @validate_call
3347
+ def update_gateway_connection(
3348
+ self,
3349
+ project_id: StrictStr,
3350
+ region: Region,
3351
+ gateway_id: UUID,
3352
+ connection_id: StrictStr,
3353
+ update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None,
3354
+ _request_timeout: Union[
3355
+ None,
3356
+ Annotated[StrictFloat, Field(gt=0)],
3357
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3358
+ ] = None,
3359
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3360
+ _content_type: Optional[StrictStr] = None,
3361
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3362
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3363
+ ) -> ConnectionResponse:
3364
+ """Update a connection on an existing VPN gateway.
3365
+
3366
+ Updating the configuration of an existing connection.
3367
+
3368
+ :param project_id: (required)
3369
+ :type project_id: str
3370
+ :param region: (required)
3371
+ :type region: Region
3372
+ :param gateway_id: (required)
3373
+ :type gateway_id: UUID
3374
+ :param connection_id: (required)
3375
+ :type connection_id: str
3376
+ :param update_gateway_connection_payload:
3377
+ :type update_gateway_connection_payload: UpdateGatewayConnectionPayload
3378
+ :param _request_timeout: timeout setting for this request. If one
3379
+ number provided, it will be total request
3380
+ timeout. It can also be a pair (tuple) of
3381
+ (connection, read) timeouts.
3382
+ :type _request_timeout: int, tuple(int, int), optional
3383
+ :param _request_auth: set to override the auth_settings for an a single
3384
+ request; this effectively ignores the
3385
+ authentication in the spec for a single request.
3386
+ :type _request_auth: dict, optional
3387
+ :param _content_type: force content-type for the request.
3388
+ :type _content_type: str, Optional
3389
+ :param _headers: set to override the headers for a single
3390
+ request; this effectively ignores the headers
3391
+ in the spec for a single request.
3392
+ :type _headers: dict, optional
3393
+ :param _host_index: set to override the host_index for a single
3394
+ request; this effectively ignores the host_index
3395
+ in the spec for a single request.
3396
+ :type _host_index: int, optional
3397
+ :return: Returns the result object.
3398
+ """ # noqa: E501
3399
+
3400
+ _param = self._update_gateway_connection_serialize(
3401
+ project_id=project_id,
3402
+ region=region,
3403
+ gateway_id=gateway_id,
3404
+ connection_id=connection_id,
3405
+ update_gateway_connection_payload=update_gateway_connection_payload,
3406
+ _request_auth=_request_auth,
3407
+ _content_type=_content_type,
3408
+ _headers=_headers,
3409
+ _host_index=_host_index,
3410
+ )
3411
+
3412
+ _response_types_map: Dict[str, Optional[str]] = {
3413
+ "200": "ConnectionResponse",
3414
+ "400": "APIErrorResponse",
3415
+ "401": "APIErrorResponse",
3416
+ "403": "APIErrorResponse",
3417
+ "404": "APIErrorResponse",
3418
+ "500": "APIErrorResponse",
3419
+ }
3420
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3421
+ response_data.read()
3422
+ return self.api_client.response_deserialize(
3423
+ response_data=response_data,
3424
+ response_types_map=_response_types_map,
3425
+ ).data
3426
+
3427
+ @validate_call
3428
+ def update_gateway_connection_with_http_info(
3429
+ self,
3430
+ project_id: StrictStr,
3431
+ region: Region,
3432
+ gateway_id: UUID,
3433
+ connection_id: StrictStr,
3434
+ update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None,
3435
+ _request_timeout: Union[
3436
+ None,
3437
+ Annotated[StrictFloat, Field(gt=0)],
3438
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3439
+ ] = None,
3440
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3441
+ _content_type: Optional[StrictStr] = None,
3442
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3443
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3444
+ ) -> ApiResponse[ConnectionResponse]:
3445
+ """Update a connection on an existing VPN gateway.
3446
+
3447
+ Updating the configuration of an existing connection.
3448
+
3449
+ :param project_id: (required)
3450
+ :type project_id: str
3451
+ :param region: (required)
3452
+ :type region: Region
3453
+ :param gateway_id: (required)
3454
+ :type gateway_id: UUID
3455
+ :param connection_id: (required)
3456
+ :type connection_id: str
3457
+ :param update_gateway_connection_payload:
3458
+ :type update_gateway_connection_payload: UpdateGatewayConnectionPayload
3459
+ :param _request_timeout: timeout setting for this request. If one
3460
+ number provided, it will be total request
3461
+ timeout. It can also be a pair (tuple) of
3462
+ (connection, read) timeouts.
3463
+ :type _request_timeout: int, tuple(int, int), optional
3464
+ :param _request_auth: set to override the auth_settings for an a single
3465
+ request; this effectively ignores the
3466
+ authentication in the spec for a single request.
3467
+ :type _request_auth: dict, optional
3468
+ :param _content_type: force content-type for the request.
3469
+ :type _content_type: str, Optional
3470
+ :param _headers: set to override the headers for a single
3471
+ request; this effectively ignores the headers
3472
+ in the spec for a single request.
3473
+ :type _headers: dict, optional
3474
+ :param _host_index: set to override the host_index for a single
3475
+ request; this effectively ignores the host_index
3476
+ in the spec for a single request.
3477
+ :type _host_index: int, optional
3478
+ :return: Returns the result object.
3479
+ """ # noqa: E501
3480
+
3481
+ _param = self._update_gateway_connection_serialize(
3482
+ project_id=project_id,
3483
+ region=region,
3484
+ gateway_id=gateway_id,
3485
+ connection_id=connection_id,
3486
+ update_gateway_connection_payload=update_gateway_connection_payload,
3487
+ _request_auth=_request_auth,
3488
+ _content_type=_content_type,
3489
+ _headers=_headers,
3490
+ _host_index=_host_index,
3491
+ )
3492
+
3493
+ _response_types_map: Dict[str, Optional[str]] = {
3494
+ "200": "ConnectionResponse",
3495
+ "400": "APIErrorResponse",
3496
+ "401": "APIErrorResponse",
3497
+ "403": "APIErrorResponse",
3498
+ "404": "APIErrorResponse",
3499
+ "500": "APIErrorResponse",
3500
+ }
3501
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3502
+ response_data.read()
3503
+ return self.api_client.response_deserialize(
3504
+ response_data=response_data,
3505
+ response_types_map=_response_types_map,
3506
+ )
3507
+
3508
+ @validate_call
3509
+ def update_gateway_connection_without_preload_content(
3510
+ self,
3511
+ project_id: StrictStr,
3512
+ region: Region,
3513
+ gateway_id: UUID,
3514
+ connection_id: StrictStr,
3515
+ update_gateway_connection_payload: Optional[UpdateGatewayConnectionPayload] = None,
3516
+ _request_timeout: Union[
3517
+ None,
3518
+ Annotated[StrictFloat, Field(gt=0)],
3519
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3520
+ ] = None,
3521
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3522
+ _content_type: Optional[StrictStr] = None,
3523
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3524
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3525
+ ) -> RESTResponseType:
3526
+ """Update a connection on an existing VPN gateway.
3527
+
3528
+ Updating the configuration of an existing connection.
3529
+
3530
+ :param project_id: (required)
3531
+ :type project_id: str
3532
+ :param region: (required)
3533
+ :type region: Region
3534
+ :param gateway_id: (required)
3535
+ :type gateway_id: UUID
3536
+ :param connection_id: (required)
3537
+ :type connection_id: str
3538
+ :param update_gateway_connection_payload:
3539
+ :type update_gateway_connection_payload: UpdateGatewayConnectionPayload
3540
+ :param _request_timeout: timeout setting for this request. If one
3541
+ number provided, it will be total request
3542
+ timeout. It can also be a pair (tuple) of
3543
+ (connection, read) timeouts.
3544
+ :type _request_timeout: int, tuple(int, int), optional
3545
+ :param _request_auth: set to override the auth_settings for an a single
3546
+ request; this effectively ignores the
3547
+ authentication in the spec for a single request.
3548
+ :type _request_auth: dict, optional
3549
+ :param _content_type: force content-type for the request.
3550
+ :type _content_type: str, Optional
3551
+ :param _headers: set to override the headers for a single
3552
+ request; this effectively ignores the headers
3553
+ in the spec for a single request.
3554
+ :type _headers: dict, optional
3555
+ :param _host_index: set to override the host_index for a single
3556
+ request; this effectively ignores the host_index
3557
+ in the spec for a single request.
3558
+ :type _host_index: int, optional
3559
+ :return: Returns the result object.
3560
+ """ # noqa: E501
3561
+
3562
+ _param = self._update_gateway_connection_serialize(
3563
+ project_id=project_id,
3564
+ region=region,
3565
+ gateway_id=gateway_id,
3566
+ connection_id=connection_id,
3567
+ update_gateway_connection_payload=update_gateway_connection_payload,
3568
+ _request_auth=_request_auth,
3569
+ _content_type=_content_type,
3570
+ _headers=_headers,
3571
+ _host_index=_host_index,
3572
+ )
3573
+
3574
+ _response_types_map: Dict[str, Optional[str]] = {
3575
+ "200": "ConnectionResponse",
3576
+ "400": "APIErrorResponse",
3577
+ "401": "APIErrorResponse",
3578
+ "403": "APIErrorResponse",
3579
+ "404": "APIErrorResponse",
3580
+ "500": "APIErrorResponse",
3581
+ }
3582
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3583
+ return response_data.response
3584
+
3585
+ def _update_gateway_connection_serialize(
3586
+ self,
3587
+ project_id,
3588
+ region,
3589
+ gateway_id,
3590
+ connection_id,
3591
+ update_gateway_connection_payload,
3592
+ _request_auth,
3593
+ _content_type,
3594
+ _headers,
3595
+ _host_index,
3596
+ ) -> RequestSerialized:
3597
+
3598
+ _host = None
3599
+
3600
+ _collection_formats: Dict[str, str] = {}
3601
+
3602
+ _path_params: Dict[str, str] = {}
3603
+ _query_params: List[Tuple[str, str]] = []
3604
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3605
+ _form_params: List[Tuple[str, str]] = []
3606
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3607
+ _body_params: Optional[bytes] = None
3608
+
3609
+ # process the path parameters
3610
+ if project_id is not None:
3611
+ _path_params["projectId"] = project_id
3612
+ if region is not None:
3613
+ _path_params["region"] = region.value
3614
+ if gateway_id is not None:
3615
+ _path_params["gatewayId"] = gateway_id
3616
+ if connection_id is not None:
3617
+ _path_params["connectionId"] = connection_id
3618
+ # process the query parameters
3619
+ # process the header parameters
3620
+ # process the form parameters
3621
+ # process the body parameter
3622
+ if update_gateway_connection_payload is not None:
3623
+ _body_params = update_gateway_connection_payload
3624
+
3625
+ # set the HTTP header `Accept`
3626
+ if "Accept" not in _header_params:
3627
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3628
+
3629
+ # set the HTTP header `Content-Type`
3630
+ if _content_type:
3631
+ _header_params["Content-Type"] = _content_type
3632
+ else:
3633
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
3634
+ if _default_content_type is not None:
3635
+ _header_params["Content-Type"] = _default_content_type
3636
+
3637
+ # authentication setting
3638
+ _auth_settings: List[str] = []
3639
+
3640
+ return self.api_client.param_serialize(
3641
+ method="PUT",
3642
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}/connections/{connectionId}",
3643
+ path_params=_path_params,
3644
+ query_params=_query_params,
3645
+ header_params=_header_params,
3646
+ body=_body_params,
3647
+ post_params=_form_params,
3648
+ files=_files,
3649
+ auth_settings=_auth_settings,
3650
+ collection_formats=_collection_formats,
3651
+ _host=_host,
3652
+ _request_auth=_request_auth,
3653
+ )
3654
+
3655
+ @validate_call
3656
+ def update_vpn_gateway(
3657
+ self,
3658
+ project_id: StrictStr,
3659
+ region: Region,
3660
+ gateway_id: UUID,
3661
+ update_vpn_gateway_payload: UpdateVPNGatewayPayload,
3662
+ _request_timeout: Union[
3663
+ None,
3664
+ Annotated[StrictFloat, Field(gt=0)],
3665
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3666
+ ] = None,
3667
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3668
+ _content_type: Optional[StrictStr] = None,
3669
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3670
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3671
+ ) -> GatewayResponse:
3672
+ """Update a VPN gateway in a project.
3673
+
3674
+ Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations.
3675
+
3676
+ :param project_id: (required)
3677
+ :type project_id: str
3678
+ :param region: (required)
3679
+ :type region: Region
3680
+ :param gateway_id: (required)
3681
+ :type gateway_id: UUID
3682
+ :param update_vpn_gateway_payload: (required)
3683
+ :type update_vpn_gateway_payload: UpdateVPNGatewayPayload
3684
+ :param _request_timeout: timeout setting for this request. If one
3685
+ number provided, it will be total request
3686
+ timeout. It can also be a pair (tuple) of
3687
+ (connection, read) timeouts.
3688
+ :type _request_timeout: int, tuple(int, int), optional
3689
+ :param _request_auth: set to override the auth_settings for an a single
3690
+ request; this effectively ignores the
3691
+ authentication in the spec for a single request.
3692
+ :type _request_auth: dict, optional
3693
+ :param _content_type: force content-type for the request.
3694
+ :type _content_type: str, Optional
3695
+ :param _headers: set to override the headers for a single
3696
+ request; this effectively ignores the headers
3697
+ in the spec for a single request.
3698
+ :type _headers: dict, optional
3699
+ :param _host_index: set to override the host_index for a single
3700
+ request; this effectively ignores the host_index
3701
+ in the spec for a single request.
3702
+ :type _host_index: int, optional
3703
+ :return: Returns the result object.
3704
+ """ # noqa: E501
3705
+
3706
+ _param = self._update_vpn_gateway_serialize(
3707
+ project_id=project_id,
3708
+ region=region,
3709
+ gateway_id=gateway_id,
3710
+ update_vpn_gateway_payload=update_vpn_gateway_payload,
3711
+ _request_auth=_request_auth,
3712
+ _content_type=_content_type,
3713
+ _headers=_headers,
3714
+ _host_index=_host_index,
3715
+ )
3716
+
3717
+ _response_types_map: Dict[str, Optional[str]] = {
3718
+ "200": "GatewayResponse",
3719
+ "400": "APIErrorResponse",
3720
+ "401": "APIErrorResponse",
3721
+ "403": "APIErrorResponse",
3722
+ "409": "APIErrorResponse",
3723
+ "500": "APIErrorResponse",
3724
+ }
3725
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3726
+ response_data.read()
3727
+ return self.api_client.response_deserialize(
3728
+ response_data=response_data,
3729
+ response_types_map=_response_types_map,
3730
+ ).data
3731
+
3732
+ @validate_call
3733
+ def update_vpn_gateway_with_http_info(
3734
+ self,
3735
+ project_id: StrictStr,
3736
+ region: Region,
3737
+ gateway_id: UUID,
3738
+ update_vpn_gateway_payload: UpdateVPNGatewayPayload,
3739
+ _request_timeout: Union[
3740
+ None,
3741
+ Annotated[StrictFloat, Field(gt=0)],
3742
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3743
+ ] = None,
3744
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3745
+ _content_type: Optional[StrictStr] = None,
3746
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3747
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3748
+ ) -> ApiResponse[GatewayResponse]:
3749
+ """Update a VPN gateway in a project.
3750
+
3751
+ Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations.
3752
+
3753
+ :param project_id: (required)
3754
+ :type project_id: str
3755
+ :param region: (required)
3756
+ :type region: Region
3757
+ :param gateway_id: (required)
3758
+ :type gateway_id: UUID
3759
+ :param update_vpn_gateway_payload: (required)
3760
+ :type update_vpn_gateway_payload: UpdateVPNGatewayPayload
3761
+ :param _request_timeout: timeout setting for this request. If one
3762
+ number provided, it will be total request
3763
+ timeout. It can also be a pair (tuple) of
3764
+ (connection, read) timeouts.
3765
+ :type _request_timeout: int, tuple(int, int), optional
3766
+ :param _request_auth: set to override the auth_settings for an a single
3767
+ request; this effectively ignores the
3768
+ authentication in the spec for a single request.
3769
+ :type _request_auth: dict, optional
3770
+ :param _content_type: force content-type for the request.
3771
+ :type _content_type: str, Optional
3772
+ :param _headers: set to override the headers for a single
3773
+ request; this effectively ignores the headers
3774
+ in the spec for a single request.
3775
+ :type _headers: dict, optional
3776
+ :param _host_index: set to override the host_index for a single
3777
+ request; this effectively ignores the host_index
3778
+ in the spec for a single request.
3779
+ :type _host_index: int, optional
3780
+ :return: Returns the result object.
3781
+ """ # noqa: E501
3782
+
3783
+ _param = self._update_vpn_gateway_serialize(
3784
+ project_id=project_id,
3785
+ region=region,
3786
+ gateway_id=gateway_id,
3787
+ update_vpn_gateway_payload=update_vpn_gateway_payload,
3788
+ _request_auth=_request_auth,
3789
+ _content_type=_content_type,
3790
+ _headers=_headers,
3791
+ _host_index=_host_index,
3792
+ )
3793
+
3794
+ _response_types_map: Dict[str, Optional[str]] = {
3795
+ "200": "GatewayResponse",
3796
+ "400": "APIErrorResponse",
3797
+ "401": "APIErrorResponse",
3798
+ "403": "APIErrorResponse",
3799
+ "409": "APIErrorResponse",
3800
+ "500": "APIErrorResponse",
3801
+ }
3802
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3803
+ response_data.read()
3804
+ return self.api_client.response_deserialize(
3805
+ response_data=response_data,
3806
+ response_types_map=_response_types_map,
3807
+ )
3808
+
3809
+ @validate_call
3810
+ def update_vpn_gateway_without_preload_content(
3811
+ self,
3812
+ project_id: StrictStr,
3813
+ region: Region,
3814
+ gateway_id: UUID,
3815
+ update_vpn_gateway_payload: UpdateVPNGatewayPayload,
3816
+ _request_timeout: Union[
3817
+ None,
3818
+ Annotated[StrictFloat, Field(gt=0)],
3819
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3820
+ ] = None,
3821
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3822
+ _content_type: Optional[StrictStr] = None,
3823
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3824
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3825
+ ) -> RESTResponseType:
3826
+ """Update a VPN gateway in a project.
3827
+
3828
+ Modify the configuration of an existing VPN gateway. Certain changes may trigger infrastructure updates or temporary connection re-negotiations.
3829
+
3830
+ :param project_id: (required)
3831
+ :type project_id: str
3832
+ :param region: (required)
3833
+ :type region: Region
3834
+ :param gateway_id: (required)
3835
+ :type gateway_id: UUID
3836
+ :param update_vpn_gateway_payload: (required)
3837
+ :type update_vpn_gateway_payload: UpdateVPNGatewayPayload
3838
+ :param _request_timeout: timeout setting for this request. If one
3839
+ number provided, it will be total request
3840
+ timeout. It can also be a pair (tuple) of
3841
+ (connection, read) timeouts.
3842
+ :type _request_timeout: int, tuple(int, int), optional
3843
+ :param _request_auth: set to override the auth_settings for an a single
3844
+ request; this effectively ignores the
3845
+ authentication in the spec for a single request.
3846
+ :type _request_auth: dict, optional
3847
+ :param _content_type: force content-type for the request.
3848
+ :type _content_type: str, Optional
3849
+ :param _headers: set to override the headers for a single
3850
+ request; this effectively ignores the headers
3851
+ in the spec for a single request.
3852
+ :type _headers: dict, optional
3853
+ :param _host_index: set to override the host_index for a single
3854
+ request; this effectively ignores the host_index
3855
+ in the spec for a single request.
3856
+ :type _host_index: int, optional
3857
+ :return: Returns the result object.
3858
+ """ # noqa: E501
3859
+
3860
+ _param = self._update_vpn_gateway_serialize(
3861
+ project_id=project_id,
3862
+ region=region,
3863
+ gateway_id=gateway_id,
3864
+ update_vpn_gateway_payload=update_vpn_gateway_payload,
3865
+ _request_auth=_request_auth,
3866
+ _content_type=_content_type,
3867
+ _headers=_headers,
3868
+ _host_index=_host_index,
3869
+ )
3870
+
3871
+ _response_types_map: Dict[str, Optional[str]] = {
3872
+ "200": "GatewayResponse",
3873
+ "400": "APIErrorResponse",
3874
+ "401": "APIErrorResponse",
3875
+ "403": "APIErrorResponse",
3876
+ "409": "APIErrorResponse",
3877
+ "500": "APIErrorResponse",
3878
+ }
3879
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3880
+ return response_data.response
3881
+
3882
+ def _update_vpn_gateway_serialize(
3883
+ self,
3884
+ project_id,
3885
+ region,
3886
+ gateway_id,
3887
+ update_vpn_gateway_payload,
3888
+ _request_auth,
3889
+ _content_type,
3890
+ _headers,
3891
+ _host_index,
3892
+ ) -> RequestSerialized:
3893
+
3894
+ _host = None
3895
+
3896
+ _collection_formats: Dict[str, str] = {}
3897
+
3898
+ _path_params: Dict[str, str] = {}
3899
+ _query_params: List[Tuple[str, str]] = []
3900
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3901
+ _form_params: List[Tuple[str, str]] = []
3902
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3903
+ _body_params: Optional[bytes] = None
3904
+
3905
+ # process the path parameters
3906
+ if project_id is not None:
3907
+ _path_params["projectId"] = project_id
3908
+ if region is not None:
3909
+ _path_params["region"] = region.value
3910
+ if gateway_id is not None:
3911
+ _path_params["gatewayId"] = gateway_id
3912
+ # process the query parameters
3913
+ # process the header parameters
3914
+ # process the form parameters
3915
+ # process the body parameter
3916
+ if update_vpn_gateway_payload is not None:
3917
+ _body_params = update_vpn_gateway_payload
3918
+
3919
+ # set the HTTP header `Accept`
3920
+ if "Accept" not in _header_params:
3921
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3922
+
3923
+ # set the HTTP header `Content-Type`
3924
+ if _content_type:
3925
+ _header_params["Content-Type"] = _content_type
3926
+ else:
3927
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
3928
+ if _default_content_type is not None:
3929
+ _header_params["Content-Type"] = _default_content_type
3930
+
3931
+ # authentication setting
3932
+ _auth_settings: List[str] = []
3933
+
3934
+ return self.api_client.param_serialize(
3935
+ method="PUT",
3936
+ resource_path="/v1beta1/projects/{projectId}/regions/{region}/gateways/{gatewayId}",
3937
+ path_params=_path_params,
3938
+ query_params=_query_params,
3939
+ header_params=_header_params,
3940
+ body=_body_params,
3941
+ post_params=_form_params,
3942
+ files=_files,
3943
+ auth_settings=_auth_settings,
3944
+ collection_formats=_collection_formats,
3945
+ _host=_host,
3946
+ _request_auth=_request_auth,
3947
+ )