latitudesh-python-sdk 1.0.0__py3-none-any.whl → 2.0.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.
Potentially problematic release.
This version of latitudesh-python-sdk might be problematic. Click here for more details.
- latitudesh_python_sdk/_hooks/types.py +7 -0
- latitudesh_python_sdk/_version.py +6 -4
- latitudesh_python_sdk/apikeys.py +22 -18
- latitudesh_python_sdk/basesdk.py +12 -20
- latitudesh_python_sdk/billing.py +2 -0
- latitudesh_python_sdk/events_sdk.py +86 -5
- latitudesh_python_sdk/firewalls_sdk.py +146 -9
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +82 -5
- latitudesh_python_sdk/models/__init__.py +2597 -1071
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
- latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
- latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
- latitudesh_python_sdk/models/billing_usage.py +3 -0
- latitudesh_python_sdk/models/custom_tag.py +15 -0
- latitudesh_python_sdk/models/custom_tag_data.py +54 -0
- latitudesh_python_sdk/models/custom_tags.py +26 -0
- latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
- latitudesh_python_sdk/models/event_data.py +98 -0
- latitudesh_python_sdk/models/events.py +16 -1
- latitudesh_python_sdk/models/filesystem_data.py +4 -0
- latitudesh_python_sdk/models/firewall.py +15 -0
- latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
- latitudesh_python_sdk/models/firewall_assignments.py +29 -0
- latitudesh_python_sdk/models/firewall_data.py +71 -0
- latitudesh_python_sdk/models/firewall_server.py +4 -1
- latitudesh_python_sdk/models/firewalls.py +7 -7
- latitudesh_python_sdk/models/get_bandwidth_plansop.py +30 -1
- latitudesh_python_sdk/models/get_eventsop.py +29 -1
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +37 -2
- latitudesh_python_sdk/models/get_ipsop.py +30 -1
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +37 -2
- latitudesh_python_sdk/models/get_projectsop.py +30 -1
- latitudesh_python_sdk/models/get_regionsop.py +42 -0
- latitudesh_python_sdk/models/get_rolesop.py +37 -2
- latitudesh_python_sdk/models/get_serversop.py +30 -1
- latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
- latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
- latitudesh_python_sdk/models/get_team_membersop.py +42 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
- latitudesh_python_sdk/models/get_user_dataop.py +31 -0
- latitudesh_python_sdk/models/get_users_dataop.py +35 -0
- latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +33 -1
- latitudesh_python_sdk/models/get_virtual_networksop.py +30 -1
- latitudesh_python_sdk/models/list_firewallsop.py +30 -1
- latitudesh_python_sdk/models/operating_system_data.py +65 -0
- latitudesh_python_sdk/models/operating_systems.py +15 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
- latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
- latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
- latitudesh_python_sdk/models/post_user_dataop.py +45 -0
- latitudesh_python_sdk/models/project_include.py +3 -0
- latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
- latitudesh_python_sdk/models/role.py +11 -0
- latitudesh_python_sdk/models/server_data.py +8 -0
- latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
- latitudesh_python_sdk/models/storage_plan_data.py +47 -0
- latitudesh_python_sdk/models/storage_plans.py +14 -3
- latitudesh_python_sdk/models/update_serverop.py +60 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +19 -1
- latitudesh_python_sdk/models/virtual_network1.py +15 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
- latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
- latitudesh_python_sdk/models/virtual_network_data.py +88 -0
- latitudesh_python_sdk/models/virtual_networks.py +3 -3
- latitudesh_python_sdk/operatingsystems_sdk.py +78 -9
- latitudesh_python_sdk/plans.py +109 -30
- latitudesh_python_sdk/privatenetworks.py +185 -36
- latitudesh_python_sdk/projects_sdk.py +113 -32
- latitudesh_python_sdk/regions_sdk.py +78 -7
- latitudesh_python_sdk/roles.py +78 -7
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +195 -50
- latitudesh_python_sdk/{sshkeys.py → sshkeys_sdk.py} +1030 -5
- latitudesh_python_sdk/storage.py +8 -0
- latitudesh_python_sdk/tags.py +30 -22
- latitudesh_python_sdk/teams_sdk.py +6 -0
- latitudesh_python_sdk/teamsmembers.py +80 -7
- latitudesh_python_sdk/traffic_sdk.py +12 -8
- latitudesh_python_sdk/userdata_sdk.py +1029 -0
- latitudesh_python_sdk/userprofile.py +6 -0
- latitudesh_python_sdk/utils/__init__.py +131 -45
- latitudesh_python_sdk/utils/datetimes.py +23 -0
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/utils/serializers.py +32 -3
- latitudesh_python_sdk/virtualmachines.py +36 -18
- latitudesh_python_sdk/vpnsessions.py +38 -26
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/METADATA +58 -22
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/RECORD +95 -73
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -6,9 +6,13 @@ from latitudesh_python_sdk._hooks import HookContext
|
|
|
6
6
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
8
|
from typing import Mapping, Optional, Union
|
|
9
|
+
from typing_extensions import deprecated
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class UserDataSDK(BaseSDK):
|
|
13
|
+
@deprecated(
|
|
14
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
15
|
+
)
|
|
12
16
|
def list_project_user_data(
|
|
13
17
|
self,
|
|
14
18
|
*,
|
|
@@ -72,6 +76,7 @@ class UserDataSDK(BaseSDK):
|
|
|
72
76
|
|
|
73
77
|
http_res = self.do_request(
|
|
74
78
|
hook_ctx=HookContext(
|
|
79
|
+
config=self.sdk_configuration,
|
|
75
80
|
base_url=base_url or "",
|
|
76
81
|
operation_id="get-project-users-data",
|
|
77
82
|
oauth2_scopes=[],
|
|
@@ -108,6 +113,9 @@ class UserDataSDK(BaseSDK):
|
|
|
108
113
|
http_res,
|
|
109
114
|
)
|
|
110
115
|
|
|
116
|
+
@deprecated(
|
|
117
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
118
|
+
)
|
|
111
119
|
async def list_project_user_data_async(
|
|
112
120
|
self,
|
|
113
121
|
*,
|
|
@@ -171,6 +179,7 @@ class UserDataSDK(BaseSDK):
|
|
|
171
179
|
|
|
172
180
|
http_res = await self.do_request_async(
|
|
173
181
|
hook_ctx=HookContext(
|
|
182
|
+
config=self.sdk_configuration,
|
|
174
183
|
base_url=base_url or "",
|
|
175
184
|
operation_id="get-project-users-data",
|
|
176
185
|
oauth2_scopes=[],
|
|
@@ -207,6 +216,9 @@ class UserDataSDK(BaseSDK):
|
|
|
207
216
|
http_res,
|
|
208
217
|
)
|
|
209
218
|
|
|
219
|
+
@deprecated(
|
|
220
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
221
|
+
)
|
|
210
222
|
def create(
|
|
211
223
|
self,
|
|
212
224
|
*,
|
|
@@ -284,6 +296,7 @@ class UserDataSDK(BaseSDK):
|
|
|
284
296
|
|
|
285
297
|
http_res = self.do_request(
|
|
286
298
|
hook_ctx=HookContext(
|
|
299
|
+
config=self.sdk_configuration,
|
|
287
300
|
base_url=base_url or "",
|
|
288
301
|
operation_id="post-project-user-data",
|
|
289
302
|
oauth2_scopes=[],
|
|
@@ -318,6 +331,9 @@ class UserDataSDK(BaseSDK):
|
|
|
318
331
|
http_res,
|
|
319
332
|
)
|
|
320
333
|
|
|
334
|
+
@deprecated(
|
|
335
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
336
|
+
)
|
|
321
337
|
async def create_async(
|
|
322
338
|
self,
|
|
323
339
|
*,
|
|
@@ -395,6 +411,7 @@ class UserDataSDK(BaseSDK):
|
|
|
395
411
|
|
|
396
412
|
http_res = await self.do_request_async(
|
|
397
413
|
hook_ctx=HookContext(
|
|
414
|
+
config=self.sdk_configuration,
|
|
398
415
|
base_url=base_url or "",
|
|
399
416
|
operation_id="post-project-user-data",
|
|
400
417
|
oauth2_scopes=[],
|
|
@@ -429,6 +446,9 @@ class UserDataSDK(BaseSDK):
|
|
|
429
446
|
http_res,
|
|
430
447
|
)
|
|
431
448
|
|
|
449
|
+
@deprecated(
|
|
450
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
451
|
+
)
|
|
432
452
|
def get_project_user_data(
|
|
433
453
|
self,
|
|
434
454
|
*,
|
|
@@ -495,6 +515,7 @@ class UserDataSDK(BaseSDK):
|
|
|
495
515
|
|
|
496
516
|
http_res = self.do_request(
|
|
497
517
|
hook_ctx=HookContext(
|
|
518
|
+
config=self.sdk_configuration,
|
|
498
519
|
base_url=base_url or "",
|
|
499
520
|
operation_id="get-project-user-data",
|
|
500
521
|
oauth2_scopes=[],
|
|
@@ -529,6 +550,9 @@ class UserDataSDK(BaseSDK):
|
|
|
529
550
|
http_res,
|
|
530
551
|
)
|
|
531
552
|
|
|
553
|
+
@deprecated(
|
|
554
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
555
|
+
)
|
|
532
556
|
async def get_project_user_data_async(
|
|
533
557
|
self,
|
|
534
558
|
*,
|
|
@@ -595,6 +619,7 @@ class UserDataSDK(BaseSDK):
|
|
|
595
619
|
|
|
596
620
|
http_res = await self.do_request_async(
|
|
597
621
|
hook_ctx=HookContext(
|
|
622
|
+
config=self.sdk_configuration,
|
|
598
623
|
base_url=base_url or "",
|
|
599
624
|
operation_id="get-project-user-data",
|
|
600
625
|
oauth2_scopes=[],
|
|
@@ -629,6 +654,9 @@ class UserDataSDK(BaseSDK):
|
|
|
629
654
|
http_res,
|
|
630
655
|
)
|
|
631
656
|
|
|
657
|
+
@deprecated(
|
|
658
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
659
|
+
)
|
|
632
660
|
def update(
|
|
633
661
|
self,
|
|
634
662
|
*,
|
|
@@ -709,6 +737,7 @@ class UserDataSDK(BaseSDK):
|
|
|
709
737
|
|
|
710
738
|
http_res = self.do_request(
|
|
711
739
|
hook_ctx=HookContext(
|
|
740
|
+
config=self.sdk_configuration,
|
|
712
741
|
base_url=base_url or "",
|
|
713
742
|
operation_id="put-project-user-data",
|
|
714
743
|
oauth2_scopes=[],
|
|
@@ -743,6 +772,9 @@ class UserDataSDK(BaseSDK):
|
|
|
743
772
|
http_res,
|
|
744
773
|
)
|
|
745
774
|
|
|
775
|
+
@deprecated(
|
|
776
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
777
|
+
)
|
|
746
778
|
async def update_async(
|
|
747
779
|
self,
|
|
748
780
|
*,
|
|
@@ -823,6 +855,7 @@ class UserDataSDK(BaseSDK):
|
|
|
823
855
|
|
|
824
856
|
http_res = await self.do_request_async(
|
|
825
857
|
hook_ctx=HookContext(
|
|
858
|
+
config=self.sdk_configuration,
|
|
826
859
|
base_url=base_url or "",
|
|
827
860
|
operation_id="put-project-user-data",
|
|
828
861
|
oauth2_scopes=[],
|
|
@@ -857,6 +890,9 @@ class UserDataSDK(BaseSDK):
|
|
|
857
890
|
http_res,
|
|
858
891
|
)
|
|
859
892
|
|
|
893
|
+
@deprecated(
|
|
894
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
895
|
+
)
|
|
860
896
|
def delete(
|
|
861
897
|
self,
|
|
862
898
|
*,
|
|
@@ -920,6 +956,7 @@ class UserDataSDK(BaseSDK):
|
|
|
920
956
|
|
|
921
957
|
http_res = self.do_request(
|
|
922
958
|
hook_ctx=HookContext(
|
|
959
|
+
config=self.sdk_configuration,
|
|
923
960
|
base_url=base_url or "",
|
|
924
961
|
operation_id="delete-project-user-data",
|
|
925
962
|
oauth2_scopes=[],
|
|
@@ -954,6 +991,9 @@ class UserDataSDK(BaseSDK):
|
|
|
954
991
|
http_res,
|
|
955
992
|
)
|
|
956
993
|
|
|
994
|
+
@deprecated(
|
|
995
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
996
|
+
)
|
|
957
997
|
async def delete_async(
|
|
958
998
|
self,
|
|
959
999
|
*,
|
|
@@ -1017,6 +1057,7 @@ class UserDataSDK(BaseSDK):
|
|
|
1017
1057
|
|
|
1018
1058
|
http_res = await self.do_request_async(
|
|
1019
1059
|
hook_ctx=HookContext(
|
|
1060
|
+
config=self.sdk_configuration,
|
|
1020
1061
|
base_url=base_url or "",
|
|
1021
1062
|
operation_id="delete-project-user-data",
|
|
1022
1063
|
oauth2_scopes=[],
|
|
@@ -1050,3 +1091,991 @@ class UserDataSDK(BaseSDK):
|
|
|
1050
1091
|
http_res_text,
|
|
1051
1092
|
http_res,
|
|
1052
1093
|
)
|
|
1094
|
+
|
|
1095
|
+
def get_users_data(
|
|
1096
|
+
self,
|
|
1097
|
+
*,
|
|
1098
|
+
extra_fields_user_data: Optional[str] = "decoded_content",
|
|
1099
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1100
|
+
server_url: Optional[str] = None,
|
|
1101
|
+
timeout_ms: Optional[int] = None,
|
|
1102
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1103
|
+
) -> models.GetUsersDataResponseBody:
|
|
1104
|
+
r"""List all User Data
|
|
1105
|
+
|
|
1106
|
+
List all Users Data in the project. These scripts can be used to configure servers with user data.
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
:param extra_fields_user_data: The `decoded_content` is provided as an extra attribute that shows content in decoded form.
|
|
1110
|
+
:param retries: Override the default retry configuration for this method
|
|
1111
|
+
:param server_url: Override the default server URL for this method
|
|
1112
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1113
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1114
|
+
"""
|
|
1115
|
+
base_url = None
|
|
1116
|
+
url_variables = None
|
|
1117
|
+
if timeout_ms is None:
|
|
1118
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1119
|
+
|
|
1120
|
+
if server_url is not None:
|
|
1121
|
+
base_url = server_url
|
|
1122
|
+
else:
|
|
1123
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1124
|
+
|
|
1125
|
+
request = models.GetUsersDataRequest(
|
|
1126
|
+
extra_fields_user_data=extra_fields_user_data,
|
|
1127
|
+
)
|
|
1128
|
+
|
|
1129
|
+
req = self._build_request(
|
|
1130
|
+
method="GET",
|
|
1131
|
+
path="/user_data",
|
|
1132
|
+
base_url=base_url,
|
|
1133
|
+
url_variables=url_variables,
|
|
1134
|
+
request=request,
|
|
1135
|
+
request_body_required=False,
|
|
1136
|
+
request_has_path_params=False,
|
|
1137
|
+
request_has_query_params=True,
|
|
1138
|
+
user_agent_header="user-agent",
|
|
1139
|
+
accept_header_value="application/vnd.api+json",
|
|
1140
|
+
http_headers=http_headers,
|
|
1141
|
+
security=self.sdk_configuration.security,
|
|
1142
|
+
timeout_ms=timeout_ms,
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1145
|
+
if retries == UNSET:
|
|
1146
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1147
|
+
retries = self.sdk_configuration.retry_config
|
|
1148
|
+
|
|
1149
|
+
retry_config = None
|
|
1150
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1151
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1152
|
+
|
|
1153
|
+
http_res = self.do_request(
|
|
1154
|
+
hook_ctx=HookContext(
|
|
1155
|
+
config=self.sdk_configuration,
|
|
1156
|
+
base_url=base_url or "",
|
|
1157
|
+
operation_id="get-users-data",
|
|
1158
|
+
oauth2_scopes=[],
|
|
1159
|
+
security_source=get_security_from_env(
|
|
1160
|
+
self.sdk_configuration.security, models.Security
|
|
1161
|
+
),
|
|
1162
|
+
),
|
|
1163
|
+
request=req,
|
|
1164
|
+
error_status_codes=["4XX", "5XX"],
|
|
1165
|
+
retry_config=retry_config,
|
|
1166
|
+
)
|
|
1167
|
+
|
|
1168
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1169
|
+
return utils.unmarshal_json(http_res.text, models.GetUsersDataResponseBody)
|
|
1170
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1171
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1172
|
+
raise models.APIError(
|
|
1173
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1174
|
+
)
|
|
1175
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1176
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1177
|
+
raise models.APIError(
|
|
1178
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1179
|
+
)
|
|
1180
|
+
|
|
1181
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1182
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1183
|
+
raise models.APIError(
|
|
1184
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1185
|
+
http_res.status_code,
|
|
1186
|
+
http_res_text,
|
|
1187
|
+
http_res,
|
|
1188
|
+
)
|
|
1189
|
+
|
|
1190
|
+
async def get_users_data_async(
|
|
1191
|
+
self,
|
|
1192
|
+
*,
|
|
1193
|
+
extra_fields_user_data: Optional[str] = "decoded_content",
|
|
1194
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1195
|
+
server_url: Optional[str] = None,
|
|
1196
|
+
timeout_ms: Optional[int] = None,
|
|
1197
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1198
|
+
) -> models.GetUsersDataResponseBody:
|
|
1199
|
+
r"""List all User Data
|
|
1200
|
+
|
|
1201
|
+
List all Users Data in the project. These scripts can be used to configure servers with user data.
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
:param extra_fields_user_data: The `decoded_content` is provided as an extra attribute that shows content in decoded form.
|
|
1205
|
+
:param retries: Override the default retry configuration for this method
|
|
1206
|
+
:param server_url: Override the default server URL for this method
|
|
1207
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1208
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1209
|
+
"""
|
|
1210
|
+
base_url = None
|
|
1211
|
+
url_variables = None
|
|
1212
|
+
if timeout_ms is None:
|
|
1213
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1214
|
+
|
|
1215
|
+
if server_url is not None:
|
|
1216
|
+
base_url = server_url
|
|
1217
|
+
else:
|
|
1218
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1219
|
+
|
|
1220
|
+
request = models.GetUsersDataRequest(
|
|
1221
|
+
extra_fields_user_data=extra_fields_user_data,
|
|
1222
|
+
)
|
|
1223
|
+
|
|
1224
|
+
req = self._build_request_async(
|
|
1225
|
+
method="GET",
|
|
1226
|
+
path="/user_data",
|
|
1227
|
+
base_url=base_url,
|
|
1228
|
+
url_variables=url_variables,
|
|
1229
|
+
request=request,
|
|
1230
|
+
request_body_required=False,
|
|
1231
|
+
request_has_path_params=False,
|
|
1232
|
+
request_has_query_params=True,
|
|
1233
|
+
user_agent_header="user-agent",
|
|
1234
|
+
accept_header_value="application/vnd.api+json",
|
|
1235
|
+
http_headers=http_headers,
|
|
1236
|
+
security=self.sdk_configuration.security,
|
|
1237
|
+
timeout_ms=timeout_ms,
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
if retries == UNSET:
|
|
1241
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1242
|
+
retries = self.sdk_configuration.retry_config
|
|
1243
|
+
|
|
1244
|
+
retry_config = None
|
|
1245
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1246
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1247
|
+
|
|
1248
|
+
http_res = await self.do_request_async(
|
|
1249
|
+
hook_ctx=HookContext(
|
|
1250
|
+
config=self.sdk_configuration,
|
|
1251
|
+
base_url=base_url or "",
|
|
1252
|
+
operation_id="get-users-data",
|
|
1253
|
+
oauth2_scopes=[],
|
|
1254
|
+
security_source=get_security_from_env(
|
|
1255
|
+
self.sdk_configuration.security, models.Security
|
|
1256
|
+
),
|
|
1257
|
+
),
|
|
1258
|
+
request=req,
|
|
1259
|
+
error_status_codes=["4XX", "5XX"],
|
|
1260
|
+
retry_config=retry_config,
|
|
1261
|
+
)
|
|
1262
|
+
|
|
1263
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1264
|
+
return utils.unmarshal_json(http_res.text, models.GetUsersDataResponseBody)
|
|
1265
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1266
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1267
|
+
raise models.APIError(
|
|
1268
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1269
|
+
)
|
|
1270
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1271
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1272
|
+
raise models.APIError(
|
|
1273
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1274
|
+
)
|
|
1275
|
+
|
|
1276
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1277
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1278
|
+
raise models.APIError(
|
|
1279
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1280
|
+
http_res.status_code,
|
|
1281
|
+
http_res_text,
|
|
1282
|
+
http_res,
|
|
1283
|
+
)
|
|
1284
|
+
|
|
1285
|
+
def post_user_data(
|
|
1286
|
+
self,
|
|
1287
|
+
*,
|
|
1288
|
+
data: Union[
|
|
1289
|
+
models.PostUserDataUserDataData, models.PostUserDataUserDataDataTypedDict
|
|
1290
|
+
],
|
|
1291
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1292
|
+
server_url: Optional[str] = None,
|
|
1293
|
+
timeout_ms: Optional[int] = None,
|
|
1294
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1295
|
+
) -> models.UserData:
|
|
1296
|
+
r"""Create an User Data
|
|
1297
|
+
|
|
1298
|
+
Allows you to create User Data in a team, which can be used to perform custom setup on your servers after deploy and reinstall.
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
:param data:
|
|
1302
|
+
:param retries: Override the default retry configuration for this method
|
|
1303
|
+
:param server_url: Override the default server URL for this method
|
|
1304
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1305
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1306
|
+
"""
|
|
1307
|
+
base_url = None
|
|
1308
|
+
url_variables = None
|
|
1309
|
+
if timeout_ms is None:
|
|
1310
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1311
|
+
|
|
1312
|
+
if server_url is not None:
|
|
1313
|
+
base_url = server_url
|
|
1314
|
+
else:
|
|
1315
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1316
|
+
|
|
1317
|
+
request = models.PostUserDataUserDataRequestBody(
|
|
1318
|
+
data=utils.get_pydantic_model(data, models.PostUserDataUserDataData),
|
|
1319
|
+
)
|
|
1320
|
+
|
|
1321
|
+
req = self._build_request(
|
|
1322
|
+
method="POST",
|
|
1323
|
+
path="/user_data",
|
|
1324
|
+
base_url=base_url,
|
|
1325
|
+
url_variables=url_variables,
|
|
1326
|
+
request=request,
|
|
1327
|
+
request_body_required=True,
|
|
1328
|
+
request_has_path_params=False,
|
|
1329
|
+
request_has_query_params=True,
|
|
1330
|
+
user_agent_header="user-agent",
|
|
1331
|
+
accept_header_value="application/vnd.api+json",
|
|
1332
|
+
http_headers=http_headers,
|
|
1333
|
+
security=self.sdk_configuration.security,
|
|
1334
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1335
|
+
request, False, False, "json", models.PostUserDataUserDataRequestBody
|
|
1336
|
+
),
|
|
1337
|
+
timeout_ms=timeout_ms,
|
|
1338
|
+
)
|
|
1339
|
+
|
|
1340
|
+
if retries == UNSET:
|
|
1341
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1342
|
+
retries = self.sdk_configuration.retry_config
|
|
1343
|
+
|
|
1344
|
+
retry_config = None
|
|
1345
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1346
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1347
|
+
|
|
1348
|
+
http_res = self.do_request(
|
|
1349
|
+
hook_ctx=HookContext(
|
|
1350
|
+
config=self.sdk_configuration,
|
|
1351
|
+
base_url=base_url or "",
|
|
1352
|
+
operation_id="post-user-data",
|
|
1353
|
+
oauth2_scopes=[],
|
|
1354
|
+
security_source=get_security_from_env(
|
|
1355
|
+
self.sdk_configuration.security, models.Security
|
|
1356
|
+
),
|
|
1357
|
+
),
|
|
1358
|
+
request=req,
|
|
1359
|
+
error_status_codes=["4XX", "5XX"],
|
|
1360
|
+
retry_config=retry_config,
|
|
1361
|
+
)
|
|
1362
|
+
|
|
1363
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
1364
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1365
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1366
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1367
|
+
raise models.APIError(
|
|
1368
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1369
|
+
)
|
|
1370
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1371
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1372
|
+
raise models.APIError(
|
|
1373
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1374
|
+
)
|
|
1375
|
+
|
|
1376
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1377
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1378
|
+
raise models.APIError(
|
|
1379
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1380
|
+
http_res.status_code,
|
|
1381
|
+
http_res_text,
|
|
1382
|
+
http_res,
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
async def post_user_data_async(
|
|
1386
|
+
self,
|
|
1387
|
+
*,
|
|
1388
|
+
data: Union[
|
|
1389
|
+
models.PostUserDataUserDataData, models.PostUserDataUserDataDataTypedDict
|
|
1390
|
+
],
|
|
1391
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1392
|
+
server_url: Optional[str] = None,
|
|
1393
|
+
timeout_ms: Optional[int] = None,
|
|
1394
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1395
|
+
) -> models.UserData:
|
|
1396
|
+
r"""Create an User Data
|
|
1397
|
+
|
|
1398
|
+
Allows you to create User Data in a team, which can be used to perform custom setup on your servers after deploy and reinstall.
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
:param data:
|
|
1402
|
+
:param retries: Override the default retry configuration for this method
|
|
1403
|
+
:param server_url: Override the default server URL for this method
|
|
1404
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1405
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1406
|
+
"""
|
|
1407
|
+
base_url = None
|
|
1408
|
+
url_variables = None
|
|
1409
|
+
if timeout_ms is None:
|
|
1410
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1411
|
+
|
|
1412
|
+
if server_url is not None:
|
|
1413
|
+
base_url = server_url
|
|
1414
|
+
else:
|
|
1415
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1416
|
+
|
|
1417
|
+
request = models.PostUserDataUserDataRequestBody(
|
|
1418
|
+
data=utils.get_pydantic_model(data, models.PostUserDataUserDataData),
|
|
1419
|
+
)
|
|
1420
|
+
|
|
1421
|
+
req = self._build_request_async(
|
|
1422
|
+
method="POST",
|
|
1423
|
+
path="/user_data",
|
|
1424
|
+
base_url=base_url,
|
|
1425
|
+
url_variables=url_variables,
|
|
1426
|
+
request=request,
|
|
1427
|
+
request_body_required=True,
|
|
1428
|
+
request_has_path_params=False,
|
|
1429
|
+
request_has_query_params=True,
|
|
1430
|
+
user_agent_header="user-agent",
|
|
1431
|
+
accept_header_value="application/vnd.api+json",
|
|
1432
|
+
http_headers=http_headers,
|
|
1433
|
+
security=self.sdk_configuration.security,
|
|
1434
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1435
|
+
request, False, False, "json", models.PostUserDataUserDataRequestBody
|
|
1436
|
+
),
|
|
1437
|
+
timeout_ms=timeout_ms,
|
|
1438
|
+
)
|
|
1439
|
+
|
|
1440
|
+
if retries == UNSET:
|
|
1441
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1442
|
+
retries = self.sdk_configuration.retry_config
|
|
1443
|
+
|
|
1444
|
+
retry_config = None
|
|
1445
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1446
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1447
|
+
|
|
1448
|
+
http_res = await self.do_request_async(
|
|
1449
|
+
hook_ctx=HookContext(
|
|
1450
|
+
config=self.sdk_configuration,
|
|
1451
|
+
base_url=base_url or "",
|
|
1452
|
+
operation_id="post-user-data",
|
|
1453
|
+
oauth2_scopes=[],
|
|
1454
|
+
security_source=get_security_from_env(
|
|
1455
|
+
self.sdk_configuration.security, models.Security
|
|
1456
|
+
),
|
|
1457
|
+
),
|
|
1458
|
+
request=req,
|
|
1459
|
+
error_status_codes=["4XX", "5XX"],
|
|
1460
|
+
retry_config=retry_config,
|
|
1461
|
+
)
|
|
1462
|
+
|
|
1463
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
1464
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1465
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1466
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1467
|
+
raise models.APIError(
|
|
1468
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1469
|
+
)
|
|
1470
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1471
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1472
|
+
raise models.APIError(
|
|
1473
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1474
|
+
)
|
|
1475
|
+
|
|
1476
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1477
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1478
|
+
raise models.APIError(
|
|
1479
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1480
|
+
http_res.status_code,
|
|
1481
|
+
http_res_text,
|
|
1482
|
+
http_res,
|
|
1483
|
+
)
|
|
1484
|
+
|
|
1485
|
+
def get_user_data(
|
|
1486
|
+
self,
|
|
1487
|
+
*,
|
|
1488
|
+
user_data_id: str,
|
|
1489
|
+
extra_fields_user_data: Optional[str] = "decoded_content",
|
|
1490
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1491
|
+
server_url: Optional[str] = None,
|
|
1492
|
+
timeout_ms: Optional[int] = None,
|
|
1493
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1494
|
+
) -> models.UserData:
|
|
1495
|
+
r"""Retrieve an User Data
|
|
1496
|
+
|
|
1497
|
+
Get User Data in the project. These scripts can be used to configure servers with user data.
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
:param user_data_id:
|
|
1501
|
+
:param extra_fields_user_data: The `decoded_content` is provided as an extra attribute that shows content in decoded form.
|
|
1502
|
+
:param retries: Override the default retry configuration for this method
|
|
1503
|
+
:param server_url: Override the default server URL for this method
|
|
1504
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1505
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1506
|
+
"""
|
|
1507
|
+
base_url = None
|
|
1508
|
+
url_variables = None
|
|
1509
|
+
if timeout_ms is None:
|
|
1510
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1511
|
+
|
|
1512
|
+
if server_url is not None:
|
|
1513
|
+
base_url = server_url
|
|
1514
|
+
else:
|
|
1515
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1516
|
+
|
|
1517
|
+
request = models.GetUserDataRequest(
|
|
1518
|
+
user_data_id=user_data_id,
|
|
1519
|
+
extra_fields_user_data=extra_fields_user_data,
|
|
1520
|
+
)
|
|
1521
|
+
|
|
1522
|
+
req = self._build_request(
|
|
1523
|
+
method="GET",
|
|
1524
|
+
path="/user_data/{user_data_id}",
|
|
1525
|
+
base_url=base_url,
|
|
1526
|
+
url_variables=url_variables,
|
|
1527
|
+
request=request,
|
|
1528
|
+
request_body_required=False,
|
|
1529
|
+
request_has_path_params=True,
|
|
1530
|
+
request_has_query_params=True,
|
|
1531
|
+
user_agent_header="user-agent",
|
|
1532
|
+
accept_header_value="application/vnd.api+json",
|
|
1533
|
+
http_headers=http_headers,
|
|
1534
|
+
security=self.sdk_configuration.security,
|
|
1535
|
+
timeout_ms=timeout_ms,
|
|
1536
|
+
)
|
|
1537
|
+
|
|
1538
|
+
if retries == UNSET:
|
|
1539
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1540
|
+
retries = self.sdk_configuration.retry_config
|
|
1541
|
+
|
|
1542
|
+
retry_config = None
|
|
1543
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1544
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1545
|
+
|
|
1546
|
+
http_res = self.do_request(
|
|
1547
|
+
hook_ctx=HookContext(
|
|
1548
|
+
config=self.sdk_configuration,
|
|
1549
|
+
base_url=base_url or "",
|
|
1550
|
+
operation_id="get-user-data",
|
|
1551
|
+
oauth2_scopes=[],
|
|
1552
|
+
security_source=get_security_from_env(
|
|
1553
|
+
self.sdk_configuration.security, models.Security
|
|
1554
|
+
),
|
|
1555
|
+
),
|
|
1556
|
+
request=req,
|
|
1557
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
1558
|
+
retry_config=retry_config,
|
|
1559
|
+
)
|
|
1560
|
+
|
|
1561
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1562
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1563
|
+
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1564
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1565
|
+
raise models.APIError(
|
|
1566
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1567
|
+
)
|
|
1568
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1569
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1570
|
+
raise models.APIError(
|
|
1571
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1572
|
+
)
|
|
1573
|
+
|
|
1574
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1575
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1576
|
+
raise models.APIError(
|
|
1577
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1578
|
+
http_res.status_code,
|
|
1579
|
+
http_res_text,
|
|
1580
|
+
http_res,
|
|
1581
|
+
)
|
|
1582
|
+
|
|
1583
|
+
async def get_user_data_async(
|
|
1584
|
+
self,
|
|
1585
|
+
*,
|
|
1586
|
+
user_data_id: str,
|
|
1587
|
+
extra_fields_user_data: Optional[str] = "decoded_content",
|
|
1588
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1589
|
+
server_url: Optional[str] = None,
|
|
1590
|
+
timeout_ms: Optional[int] = None,
|
|
1591
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1592
|
+
) -> models.UserData:
|
|
1593
|
+
r"""Retrieve an User Data
|
|
1594
|
+
|
|
1595
|
+
Get User Data in the project. These scripts can be used to configure servers with user data.
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
:param user_data_id:
|
|
1599
|
+
:param extra_fields_user_data: The `decoded_content` is provided as an extra attribute that shows content in decoded form.
|
|
1600
|
+
:param retries: Override the default retry configuration for this method
|
|
1601
|
+
:param server_url: Override the default server URL for this method
|
|
1602
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1603
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1604
|
+
"""
|
|
1605
|
+
base_url = None
|
|
1606
|
+
url_variables = None
|
|
1607
|
+
if timeout_ms is None:
|
|
1608
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1609
|
+
|
|
1610
|
+
if server_url is not None:
|
|
1611
|
+
base_url = server_url
|
|
1612
|
+
else:
|
|
1613
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1614
|
+
|
|
1615
|
+
request = models.GetUserDataRequest(
|
|
1616
|
+
user_data_id=user_data_id,
|
|
1617
|
+
extra_fields_user_data=extra_fields_user_data,
|
|
1618
|
+
)
|
|
1619
|
+
|
|
1620
|
+
req = self._build_request_async(
|
|
1621
|
+
method="GET",
|
|
1622
|
+
path="/user_data/{user_data_id}",
|
|
1623
|
+
base_url=base_url,
|
|
1624
|
+
url_variables=url_variables,
|
|
1625
|
+
request=request,
|
|
1626
|
+
request_body_required=False,
|
|
1627
|
+
request_has_path_params=True,
|
|
1628
|
+
request_has_query_params=True,
|
|
1629
|
+
user_agent_header="user-agent",
|
|
1630
|
+
accept_header_value="application/vnd.api+json",
|
|
1631
|
+
http_headers=http_headers,
|
|
1632
|
+
security=self.sdk_configuration.security,
|
|
1633
|
+
timeout_ms=timeout_ms,
|
|
1634
|
+
)
|
|
1635
|
+
|
|
1636
|
+
if retries == UNSET:
|
|
1637
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1638
|
+
retries = self.sdk_configuration.retry_config
|
|
1639
|
+
|
|
1640
|
+
retry_config = None
|
|
1641
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1642
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1643
|
+
|
|
1644
|
+
http_res = await self.do_request_async(
|
|
1645
|
+
hook_ctx=HookContext(
|
|
1646
|
+
config=self.sdk_configuration,
|
|
1647
|
+
base_url=base_url or "",
|
|
1648
|
+
operation_id="get-user-data",
|
|
1649
|
+
oauth2_scopes=[],
|
|
1650
|
+
security_source=get_security_from_env(
|
|
1651
|
+
self.sdk_configuration.security, models.Security
|
|
1652
|
+
),
|
|
1653
|
+
),
|
|
1654
|
+
request=req,
|
|
1655
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
1656
|
+
retry_config=retry_config,
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1660
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1661
|
+
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1662
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1663
|
+
raise models.APIError(
|
|
1664
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1665
|
+
)
|
|
1666
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1667
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1668
|
+
raise models.APIError(
|
|
1669
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1670
|
+
)
|
|
1671
|
+
|
|
1672
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1673
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1674
|
+
raise models.APIError(
|
|
1675
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1676
|
+
http_res.status_code,
|
|
1677
|
+
http_res_text,
|
|
1678
|
+
http_res,
|
|
1679
|
+
)
|
|
1680
|
+
|
|
1681
|
+
def patch_user_data(
|
|
1682
|
+
self,
|
|
1683
|
+
*,
|
|
1684
|
+
user_data_id: str,
|
|
1685
|
+
data: Union[
|
|
1686
|
+
models.PatchUserDataUserDataData, models.PatchUserDataUserDataDataTypedDict
|
|
1687
|
+
],
|
|
1688
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1689
|
+
server_url: Optional[str] = None,
|
|
1690
|
+
timeout_ms: Optional[int] = None,
|
|
1691
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1692
|
+
) -> models.UserData:
|
|
1693
|
+
r"""Update an User Data
|
|
1694
|
+
|
|
1695
|
+
Allow you update User Data in a team.
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
:param user_data_id:
|
|
1699
|
+
:param data:
|
|
1700
|
+
:param retries: Override the default retry configuration for this method
|
|
1701
|
+
:param server_url: Override the default server URL for this method
|
|
1702
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1703
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1704
|
+
"""
|
|
1705
|
+
base_url = None
|
|
1706
|
+
url_variables = None
|
|
1707
|
+
if timeout_ms is None:
|
|
1708
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1709
|
+
|
|
1710
|
+
if server_url is not None:
|
|
1711
|
+
base_url = server_url
|
|
1712
|
+
else:
|
|
1713
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1714
|
+
|
|
1715
|
+
request = models.PatchUserDataRequest(
|
|
1716
|
+
user_data_id=user_data_id,
|
|
1717
|
+
request_body=models.PatchUserDataUserDataRequestBody(
|
|
1718
|
+
data=utils.get_pydantic_model(data, models.PatchUserDataUserDataData),
|
|
1719
|
+
),
|
|
1720
|
+
)
|
|
1721
|
+
|
|
1722
|
+
req = self._build_request(
|
|
1723
|
+
method="PATCH",
|
|
1724
|
+
path="/user_data/{user_data_id}",
|
|
1725
|
+
base_url=base_url,
|
|
1726
|
+
url_variables=url_variables,
|
|
1727
|
+
request=request,
|
|
1728
|
+
request_body_required=False,
|
|
1729
|
+
request_has_path_params=True,
|
|
1730
|
+
request_has_query_params=True,
|
|
1731
|
+
user_agent_header="user-agent",
|
|
1732
|
+
accept_header_value="application/vnd.api+json",
|
|
1733
|
+
http_headers=http_headers,
|
|
1734
|
+
security=self.sdk_configuration.security,
|
|
1735
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1736
|
+
request.request_body,
|
|
1737
|
+
False,
|
|
1738
|
+
True,
|
|
1739
|
+
"json",
|
|
1740
|
+
Optional[models.PatchUserDataUserDataRequestBody],
|
|
1741
|
+
),
|
|
1742
|
+
timeout_ms=timeout_ms,
|
|
1743
|
+
)
|
|
1744
|
+
|
|
1745
|
+
if retries == UNSET:
|
|
1746
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1747
|
+
retries = self.sdk_configuration.retry_config
|
|
1748
|
+
|
|
1749
|
+
retry_config = None
|
|
1750
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1751
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1752
|
+
|
|
1753
|
+
http_res = self.do_request(
|
|
1754
|
+
hook_ctx=HookContext(
|
|
1755
|
+
config=self.sdk_configuration,
|
|
1756
|
+
base_url=base_url or "",
|
|
1757
|
+
operation_id="patch-user-data",
|
|
1758
|
+
oauth2_scopes=[],
|
|
1759
|
+
security_source=get_security_from_env(
|
|
1760
|
+
self.sdk_configuration.security, models.Security
|
|
1761
|
+
),
|
|
1762
|
+
),
|
|
1763
|
+
request=req,
|
|
1764
|
+
error_status_codes=["4XX", "5XX"],
|
|
1765
|
+
retry_config=retry_config,
|
|
1766
|
+
)
|
|
1767
|
+
|
|
1768
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1769
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1770
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1771
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1772
|
+
raise models.APIError(
|
|
1773
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1774
|
+
)
|
|
1775
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1776
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1777
|
+
raise models.APIError(
|
|
1778
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1779
|
+
)
|
|
1780
|
+
|
|
1781
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1782
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1783
|
+
raise models.APIError(
|
|
1784
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1785
|
+
http_res.status_code,
|
|
1786
|
+
http_res_text,
|
|
1787
|
+
http_res,
|
|
1788
|
+
)
|
|
1789
|
+
|
|
1790
|
+
async def patch_user_data_async(
|
|
1791
|
+
self,
|
|
1792
|
+
*,
|
|
1793
|
+
user_data_id: str,
|
|
1794
|
+
data: Union[
|
|
1795
|
+
models.PatchUserDataUserDataData, models.PatchUserDataUserDataDataTypedDict
|
|
1796
|
+
],
|
|
1797
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1798
|
+
server_url: Optional[str] = None,
|
|
1799
|
+
timeout_ms: Optional[int] = None,
|
|
1800
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1801
|
+
) -> models.UserData:
|
|
1802
|
+
r"""Update an User Data
|
|
1803
|
+
|
|
1804
|
+
Allow you update User Data in a team.
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
:param user_data_id:
|
|
1808
|
+
:param data:
|
|
1809
|
+
:param retries: Override the default retry configuration for this method
|
|
1810
|
+
:param server_url: Override the default server URL for this method
|
|
1811
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1812
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1813
|
+
"""
|
|
1814
|
+
base_url = None
|
|
1815
|
+
url_variables = None
|
|
1816
|
+
if timeout_ms is None:
|
|
1817
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1818
|
+
|
|
1819
|
+
if server_url is not None:
|
|
1820
|
+
base_url = server_url
|
|
1821
|
+
else:
|
|
1822
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1823
|
+
|
|
1824
|
+
request = models.PatchUserDataRequest(
|
|
1825
|
+
user_data_id=user_data_id,
|
|
1826
|
+
request_body=models.PatchUserDataUserDataRequestBody(
|
|
1827
|
+
data=utils.get_pydantic_model(data, models.PatchUserDataUserDataData),
|
|
1828
|
+
),
|
|
1829
|
+
)
|
|
1830
|
+
|
|
1831
|
+
req = self._build_request_async(
|
|
1832
|
+
method="PATCH",
|
|
1833
|
+
path="/user_data/{user_data_id}",
|
|
1834
|
+
base_url=base_url,
|
|
1835
|
+
url_variables=url_variables,
|
|
1836
|
+
request=request,
|
|
1837
|
+
request_body_required=False,
|
|
1838
|
+
request_has_path_params=True,
|
|
1839
|
+
request_has_query_params=True,
|
|
1840
|
+
user_agent_header="user-agent",
|
|
1841
|
+
accept_header_value="application/vnd.api+json",
|
|
1842
|
+
http_headers=http_headers,
|
|
1843
|
+
security=self.sdk_configuration.security,
|
|
1844
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1845
|
+
request.request_body,
|
|
1846
|
+
False,
|
|
1847
|
+
True,
|
|
1848
|
+
"json",
|
|
1849
|
+
Optional[models.PatchUserDataUserDataRequestBody],
|
|
1850
|
+
),
|
|
1851
|
+
timeout_ms=timeout_ms,
|
|
1852
|
+
)
|
|
1853
|
+
|
|
1854
|
+
if retries == UNSET:
|
|
1855
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1856
|
+
retries = self.sdk_configuration.retry_config
|
|
1857
|
+
|
|
1858
|
+
retry_config = None
|
|
1859
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1860
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1861
|
+
|
|
1862
|
+
http_res = await self.do_request_async(
|
|
1863
|
+
hook_ctx=HookContext(
|
|
1864
|
+
config=self.sdk_configuration,
|
|
1865
|
+
base_url=base_url or "",
|
|
1866
|
+
operation_id="patch-user-data",
|
|
1867
|
+
oauth2_scopes=[],
|
|
1868
|
+
security_source=get_security_from_env(
|
|
1869
|
+
self.sdk_configuration.security, models.Security
|
|
1870
|
+
),
|
|
1871
|
+
),
|
|
1872
|
+
request=req,
|
|
1873
|
+
error_status_codes=["4XX", "5XX"],
|
|
1874
|
+
retry_config=retry_config,
|
|
1875
|
+
)
|
|
1876
|
+
|
|
1877
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1878
|
+
return utils.unmarshal_json(http_res.text, models.UserData)
|
|
1879
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1880
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1881
|
+
raise models.APIError(
|
|
1882
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1883
|
+
)
|
|
1884
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1885
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1886
|
+
raise models.APIError(
|
|
1887
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1888
|
+
)
|
|
1889
|
+
|
|
1890
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1891
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1892
|
+
raise models.APIError(
|
|
1893
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1894
|
+
http_res.status_code,
|
|
1895
|
+
http_res_text,
|
|
1896
|
+
http_res,
|
|
1897
|
+
)
|
|
1898
|
+
|
|
1899
|
+
def delete_user_data(
|
|
1900
|
+
self,
|
|
1901
|
+
*,
|
|
1902
|
+
user_data_id: str,
|
|
1903
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1904
|
+
server_url: Optional[str] = None,
|
|
1905
|
+
timeout_ms: Optional[int] = None,
|
|
1906
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1907
|
+
):
|
|
1908
|
+
r"""Delete an User Data
|
|
1909
|
+
|
|
1910
|
+
:param user_data_id:
|
|
1911
|
+
:param retries: Override the default retry configuration for this method
|
|
1912
|
+
:param server_url: Override the default server URL for this method
|
|
1913
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1914
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1915
|
+
"""
|
|
1916
|
+
base_url = None
|
|
1917
|
+
url_variables = None
|
|
1918
|
+
if timeout_ms is None:
|
|
1919
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1920
|
+
|
|
1921
|
+
if server_url is not None:
|
|
1922
|
+
base_url = server_url
|
|
1923
|
+
else:
|
|
1924
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1925
|
+
|
|
1926
|
+
request = models.DeleteUserDataRequest(
|
|
1927
|
+
user_data_id=user_data_id,
|
|
1928
|
+
)
|
|
1929
|
+
|
|
1930
|
+
req = self._build_request(
|
|
1931
|
+
method="DELETE",
|
|
1932
|
+
path="/user_data/{user_data_id}",
|
|
1933
|
+
base_url=base_url,
|
|
1934
|
+
url_variables=url_variables,
|
|
1935
|
+
request=request,
|
|
1936
|
+
request_body_required=False,
|
|
1937
|
+
request_has_path_params=True,
|
|
1938
|
+
request_has_query_params=True,
|
|
1939
|
+
user_agent_header="user-agent",
|
|
1940
|
+
accept_header_value="*/*",
|
|
1941
|
+
http_headers=http_headers,
|
|
1942
|
+
security=self.sdk_configuration.security,
|
|
1943
|
+
timeout_ms=timeout_ms,
|
|
1944
|
+
)
|
|
1945
|
+
|
|
1946
|
+
if retries == UNSET:
|
|
1947
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1948
|
+
retries = self.sdk_configuration.retry_config
|
|
1949
|
+
|
|
1950
|
+
retry_config = None
|
|
1951
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1952
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1953
|
+
|
|
1954
|
+
http_res = self.do_request(
|
|
1955
|
+
hook_ctx=HookContext(
|
|
1956
|
+
config=self.sdk_configuration,
|
|
1957
|
+
base_url=base_url or "",
|
|
1958
|
+
operation_id="delete-user-data",
|
|
1959
|
+
oauth2_scopes=[],
|
|
1960
|
+
security_source=get_security_from_env(
|
|
1961
|
+
self.sdk_configuration.security, models.Security
|
|
1962
|
+
),
|
|
1963
|
+
),
|
|
1964
|
+
request=req,
|
|
1965
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
1966
|
+
retry_config=retry_config,
|
|
1967
|
+
)
|
|
1968
|
+
|
|
1969
|
+
if utils.match_response(http_res, "204", "*"):
|
|
1970
|
+
return
|
|
1971
|
+
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
1972
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1973
|
+
raise models.APIError(
|
|
1974
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1975
|
+
)
|
|
1976
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1977
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1978
|
+
raise models.APIError(
|
|
1979
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1980
|
+
)
|
|
1981
|
+
|
|
1982
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1983
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1984
|
+
raise models.APIError(
|
|
1985
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1986
|
+
http_res.status_code,
|
|
1987
|
+
http_res_text,
|
|
1988
|
+
http_res,
|
|
1989
|
+
)
|
|
1990
|
+
|
|
1991
|
+
async def delete_user_data_async(
|
|
1992
|
+
self,
|
|
1993
|
+
*,
|
|
1994
|
+
user_data_id: str,
|
|
1995
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1996
|
+
server_url: Optional[str] = None,
|
|
1997
|
+
timeout_ms: Optional[int] = None,
|
|
1998
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1999
|
+
):
|
|
2000
|
+
r"""Delete an User Data
|
|
2001
|
+
|
|
2002
|
+
:param user_data_id:
|
|
2003
|
+
:param retries: Override the default retry configuration for this method
|
|
2004
|
+
:param server_url: Override the default server URL for this method
|
|
2005
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2006
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2007
|
+
"""
|
|
2008
|
+
base_url = None
|
|
2009
|
+
url_variables = None
|
|
2010
|
+
if timeout_ms is None:
|
|
2011
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2012
|
+
|
|
2013
|
+
if server_url is not None:
|
|
2014
|
+
base_url = server_url
|
|
2015
|
+
else:
|
|
2016
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2017
|
+
|
|
2018
|
+
request = models.DeleteUserDataRequest(
|
|
2019
|
+
user_data_id=user_data_id,
|
|
2020
|
+
)
|
|
2021
|
+
|
|
2022
|
+
req = self._build_request_async(
|
|
2023
|
+
method="DELETE",
|
|
2024
|
+
path="/user_data/{user_data_id}",
|
|
2025
|
+
base_url=base_url,
|
|
2026
|
+
url_variables=url_variables,
|
|
2027
|
+
request=request,
|
|
2028
|
+
request_body_required=False,
|
|
2029
|
+
request_has_path_params=True,
|
|
2030
|
+
request_has_query_params=True,
|
|
2031
|
+
user_agent_header="user-agent",
|
|
2032
|
+
accept_header_value="*/*",
|
|
2033
|
+
http_headers=http_headers,
|
|
2034
|
+
security=self.sdk_configuration.security,
|
|
2035
|
+
timeout_ms=timeout_ms,
|
|
2036
|
+
)
|
|
2037
|
+
|
|
2038
|
+
if retries == UNSET:
|
|
2039
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2040
|
+
retries = self.sdk_configuration.retry_config
|
|
2041
|
+
|
|
2042
|
+
retry_config = None
|
|
2043
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2044
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2045
|
+
|
|
2046
|
+
http_res = await self.do_request_async(
|
|
2047
|
+
hook_ctx=HookContext(
|
|
2048
|
+
config=self.sdk_configuration,
|
|
2049
|
+
base_url=base_url or "",
|
|
2050
|
+
operation_id="delete-user-data",
|
|
2051
|
+
oauth2_scopes=[],
|
|
2052
|
+
security_source=get_security_from_env(
|
|
2053
|
+
self.sdk_configuration.security, models.Security
|
|
2054
|
+
),
|
|
2055
|
+
),
|
|
2056
|
+
request=req,
|
|
2057
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
2058
|
+
retry_config=retry_config,
|
|
2059
|
+
)
|
|
2060
|
+
|
|
2061
|
+
if utils.match_response(http_res, "204", "*"):
|
|
2062
|
+
return
|
|
2063
|
+
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
|
2064
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2065
|
+
raise models.APIError(
|
|
2066
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2067
|
+
)
|
|
2068
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2069
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2070
|
+
raise models.APIError(
|
|
2071
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2072
|
+
)
|
|
2073
|
+
|
|
2074
|
+
content_type = http_res.headers.get("Content-Type")
|
|
2075
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2076
|
+
raise models.APIError(
|
|
2077
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2078
|
+
http_res.status_code,
|
|
2079
|
+
http_res_text,
|
|
2080
|
+
http_res,
|
|
2081
|
+
)
|