latitudesh-python-sdk 1.1.0__py3-none-any.whl → 2.0.1__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.

Files changed (93) hide show
  1. latitudesh_python_sdk/_hooks/types.py +7 -0
  2. latitudesh_python_sdk/_version.py +6 -4
  3. latitudesh_python_sdk/apikeys.py +73 -156
  4. latitudesh_python_sdk/basesdk.py +16 -24
  5. latitudesh_python_sdk/billing.py +13 -32
  6. latitudesh_python_sdk/events_sdk.py +11 -34
  7. latitudesh_python_sdk/firewalls_sdk.py +105 -264
  8. latitudesh_python_sdk/httpclient.py +6 -16
  9. latitudesh_python_sdk/ipaddresses_sdk.py +29 -68
  10. latitudesh_python_sdk/models/__init__.py +2586 -1126
  11. latitudesh_python_sdk/models/apierror.py +30 -14
  12. latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
  13. latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
  14. latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
  15. latitudesh_python_sdk/models/custom_tag.py +15 -0
  16. latitudesh_python_sdk/models/custom_tag_data.py +54 -0
  17. latitudesh_python_sdk/models/custom_tags.py +26 -0
  18. latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
  19. latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
  20. latitudesh_python_sdk/models/deploy_config.py +11 -6
  21. latitudesh_python_sdk/models/error_object.py +11 -6
  22. latitudesh_python_sdk/models/event_data.py +98 -0
  23. latitudesh_python_sdk/models/events.py +16 -1
  24. latitudesh_python_sdk/models/filesystem_data.py +4 -0
  25. latitudesh_python_sdk/models/firewall.py +15 -0
  26. latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
  27. latitudesh_python_sdk/models/firewall_assignments.py +29 -0
  28. latitudesh_python_sdk/models/firewall_data.py +71 -0
  29. latitudesh_python_sdk/models/firewall_server.py +4 -1
  30. latitudesh_python_sdk/models/firewalls.py +7 -7
  31. latitudesh_python_sdk/models/get_firewall_assignmentsop.py +3 -3
  32. latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
  33. latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
  34. latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
  35. latitudesh_python_sdk/models/get_user_dataop.py +31 -0
  36. latitudesh_python_sdk/models/get_users_dataop.py +35 -0
  37. latitudesh_python_sdk/models/latitudesherror.py +26 -0
  38. latitudesh_python_sdk/models/no_response_error.py +13 -0
  39. latitudesh_python_sdk/models/operating_system_data.py +65 -0
  40. latitudesh_python_sdk/models/operating_systems.py +15 -0
  41. latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
  42. latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
  43. latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
  44. latitudesh_python_sdk/models/post_user_dataop.py +45 -0
  45. latitudesh_python_sdk/models/project_include.py +3 -0
  46. latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
  47. latitudesh_python_sdk/models/region_resource_data.py +4 -4
  48. latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
  49. latitudesh_python_sdk/models/role.py +11 -0
  50. latitudesh_python_sdk/models/server.py +11 -6
  51. latitudesh_python_sdk/models/server_data.py +14 -3
  52. latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
  53. latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
  54. latitudesh_python_sdk/models/storage_plan_data.py +47 -0
  55. latitudesh_python_sdk/models/storage_plans.py +14 -3
  56. latitudesh_python_sdk/models/update_serverop.py +58 -10
  57. latitudesh_python_sdk/models/user_data.py +11 -0
  58. latitudesh_python_sdk/models/virtual_network.py +30 -6
  59. latitudesh_python_sdk/models/virtual_network1.py +15 -0
  60. latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
  61. latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
  62. latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
  63. latitudesh_python_sdk/models/virtual_network_data.py +88 -0
  64. latitudesh_python_sdk/models/virtual_networks.py +3 -3
  65. latitudesh_python_sdk/operatingsystems_sdk.py +13 -32
  66. latitudesh_python_sdk/plans.py +99 -214
  67. latitudesh_python_sdk/privatenetworks.py +131 -290
  68. latitudesh_python_sdk/projects_sdk.py +79 -158
  69. latitudesh_python_sdk/regions_sdk.py +25 -66
  70. latitudesh_python_sdk/roles.py +25 -64
  71. latitudesh_python_sdk/sdk.py +110 -73
  72. latitudesh_python_sdk/sdkconfiguration.py +0 -7
  73. latitudesh_python_sdk/servers_sdk.py +305 -646
  74. latitudesh_python_sdk/sshkeys_sdk.py +1856 -0
  75. latitudesh_python_sdk/storage.py +41 -120
  76. latitudesh_python_sdk/tags.py +67 -146
  77. latitudesh_python_sdk/teams_sdk.py +41 -100
  78. latitudesh_python_sdk/teamsmembers.py +37 -96
  79. latitudesh_python_sdk/traffic_sdk.py +37 -76
  80. latitudesh_python_sdk/userdata_sdk.py +959 -149
  81. latitudesh_python_sdk/userprofile.py +37 -100
  82. latitudesh_python_sdk/utils/__init__.py +131 -46
  83. latitudesh_python_sdk/utils/forms.py +49 -28
  84. latitudesh_python_sdk/utils/serializers.py +3 -2
  85. latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
  86. latitudesh_python_sdk/virtualmachines.py +71 -140
  87. latitudesh_python_sdk/vpnsessions.py +93 -172
  88. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +76 -43
  89. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +91 -67
  90. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +1 -1
  91. latitudesh_python_sdk/models/storage_plan.py +0 -36
  92. latitudesh_python_sdk/sshkeys.py +0 -1050
  93. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
@@ -3,18 +3,22 @@
3
3
  from .basesdk import BaseSDK
4
4
  from latitudesh_python_sdk import models, utils
5
5
  from latitudesh_python_sdk._hooks import HookContext
6
- from latitudesh_python_sdk.types import BaseModel, OptionalNullable, UNSET
6
+ from latitudesh_python_sdk.types import OptionalNullable, UNSET
7
7
  from latitudesh_python_sdk.utils import get_security_from_env
8
- from typing import Mapping, Optional, Union, cast
8
+ from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
+ from typing import Mapping, Optional, Union
9
10
 
10
11
 
11
12
  class VirtualMachines(BaseSDK):
12
13
  def create(
13
14
  self,
14
15
  *,
15
- request: Union[
16
- models.VirtualMachinePayload, models.VirtualMachinePayloadTypedDict
17
- ] = models.VirtualMachinePayload(),
16
+ data: Optional[
17
+ Union[
18
+ models.VirtualMachinePayloadData,
19
+ models.VirtualMachinePayloadDataTypedDict,
20
+ ]
21
+ ] = None,
18
22
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
23
  server_url: Optional[str] = None,
20
24
  timeout_ms: Optional[int] = None,
@@ -25,7 +29,7 @@ class VirtualMachines(BaseSDK):
25
29
  Creates a new Virtual Machine.
26
30
 
27
31
 
28
- :param request: The request object to send.
32
+ :param data:
29
33
  :param retries: Override the default retry configuration for this method
30
34
  :param server_url: Override the default server URL for this method
31
35
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -41,9 +45,11 @@ class VirtualMachines(BaseSDK):
41
45
  else:
42
46
  base_url = self._get_url(base_url, url_variables)
43
47
 
44
- if not isinstance(request, BaseModel):
45
- request = utils.unmarshal(request, models.VirtualMachinePayload)
46
- request = cast(models.VirtualMachinePayload, request)
48
+ request = models.VirtualMachinePayload(
49
+ data=utils.get_pydantic_model(
50
+ data, Optional[models.VirtualMachinePayloadData]
51
+ ),
52
+ )
47
53
 
48
54
  req = self._build_request(
49
55
  method="POST",
@@ -59,7 +65,7 @@ class VirtualMachines(BaseSDK):
59
65
  http_headers=http_headers,
60
66
  security=self.sdk_configuration.security,
61
67
  get_serialized_body=lambda: utils.serialize_request_body(
62
- request, False, True, "json", Optional[models.VirtualMachinePayload]
68
+ request, False, False, "json", models.VirtualMachinePayload
63
69
  ),
64
70
  timeout_ms=timeout_ms,
65
71
  )
@@ -74,6 +80,7 @@ class VirtualMachines(BaseSDK):
74
80
 
75
81
  http_res = self.do_request(
76
82
  hook_ctx=HookContext(
83
+ config=self.sdk_configuration,
77
84
  base_url=base_url or "",
78
85
  operation_id="create-virtual-machine",
79
86
  oauth2_scopes=[],
@@ -87,33 +94,25 @@ class VirtualMachines(BaseSDK):
87
94
  )
88
95
 
89
96
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
90
- return utils.unmarshal_json(http_res.text, models.VirtualMachine)
97
+ return unmarshal_json_response(models.VirtualMachine, http_res)
91
98
  if utils.match_response(http_res, ["409", "422", "4XX"], "*"):
92
99
  http_res_text = utils.stream_to_text(http_res)
93
- raise models.APIError(
94
- "API error occurred", http_res.status_code, http_res_text, http_res
95
- )
100
+ raise models.APIError("API error occurred", http_res, http_res_text)
96
101
  if utils.match_response(http_res, "5XX", "*"):
97
102
  http_res_text = utils.stream_to_text(http_res)
98
- raise models.APIError(
99
- "API error occurred", http_res.status_code, http_res_text, http_res
100
- )
101
-
102
- content_type = http_res.headers.get("Content-Type")
103
- http_res_text = utils.stream_to_text(http_res)
104
- raise models.APIError(
105
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
106
- http_res.status_code,
107
- http_res_text,
108
- http_res,
109
- )
103
+ raise models.APIError("API error occurred", http_res, http_res_text)
104
+
105
+ raise models.APIError("Unexpected response received", http_res)
110
106
 
111
107
  async def create_async(
112
108
  self,
113
109
  *,
114
- request: Union[
115
- models.VirtualMachinePayload, models.VirtualMachinePayloadTypedDict
116
- ] = models.VirtualMachinePayload(),
110
+ data: Optional[
111
+ Union[
112
+ models.VirtualMachinePayloadData,
113
+ models.VirtualMachinePayloadDataTypedDict,
114
+ ]
115
+ ] = None,
117
116
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
118
117
  server_url: Optional[str] = None,
119
118
  timeout_ms: Optional[int] = None,
@@ -124,7 +123,7 @@ class VirtualMachines(BaseSDK):
124
123
  Creates a new Virtual Machine.
125
124
 
126
125
 
127
- :param request: The request object to send.
126
+ :param data:
128
127
  :param retries: Override the default retry configuration for this method
129
128
  :param server_url: Override the default server URL for this method
130
129
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -140,9 +139,11 @@ class VirtualMachines(BaseSDK):
140
139
  else:
141
140
  base_url = self._get_url(base_url, url_variables)
142
141
 
143
- if not isinstance(request, BaseModel):
144
- request = utils.unmarshal(request, models.VirtualMachinePayload)
145
- request = cast(models.VirtualMachinePayload, request)
142
+ request = models.VirtualMachinePayload(
143
+ data=utils.get_pydantic_model(
144
+ data, Optional[models.VirtualMachinePayloadData]
145
+ ),
146
+ )
146
147
 
147
148
  req = self._build_request_async(
148
149
  method="POST",
@@ -158,7 +159,7 @@ class VirtualMachines(BaseSDK):
158
159
  http_headers=http_headers,
159
160
  security=self.sdk_configuration.security,
160
161
  get_serialized_body=lambda: utils.serialize_request_body(
161
- request, False, True, "json", Optional[models.VirtualMachinePayload]
162
+ request, False, False, "json", models.VirtualMachinePayload
162
163
  ),
163
164
  timeout_ms=timeout_ms,
164
165
  )
@@ -173,6 +174,7 @@ class VirtualMachines(BaseSDK):
173
174
 
174
175
  http_res = await self.do_request_async(
175
176
  hook_ctx=HookContext(
177
+ config=self.sdk_configuration,
176
178
  base_url=base_url or "",
177
179
  operation_id="create-virtual-machine",
178
180
  oauth2_scopes=[],
@@ -186,26 +188,15 @@ class VirtualMachines(BaseSDK):
186
188
  )
187
189
 
188
190
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
189
- return utils.unmarshal_json(http_res.text, models.VirtualMachine)
191
+ return unmarshal_json_response(models.VirtualMachine, http_res)
190
192
  if utils.match_response(http_res, ["409", "422", "4XX"], "*"):
191
193
  http_res_text = await utils.stream_to_text_async(http_res)
192
- raise models.APIError(
193
- "API error occurred", http_res.status_code, http_res_text, http_res
194
- )
194
+ raise models.APIError("API error occurred", http_res, http_res_text)
195
195
  if utils.match_response(http_res, "5XX", "*"):
196
196
  http_res_text = await utils.stream_to_text_async(http_res)
197
- raise models.APIError(
198
- "API error occurred", http_res.status_code, http_res_text, http_res
199
- )
200
-
201
- content_type = http_res.headers.get("Content-Type")
202
- http_res_text = await utils.stream_to_text_async(http_res)
203
- raise models.APIError(
204
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
205
- http_res.status_code,
206
- http_res_text,
207
- http_res,
208
- )
197
+ raise models.APIError("API error occurred", http_res, http_res_text)
198
+
199
+ raise models.APIError("Unexpected response received", http_res)
209
200
 
210
201
  def list(
211
202
  self,
@@ -267,6 +258,7 @@ class VirtualMachines(BaseSDK):
267
258
 
268
259
  http_res = self.do_request(
269
260
  hook_ctx=HookContext(
261
+ config=self.sdk_configuration,
270
262
  base_url=base_url or "",
271
263
  operation_id="index-virtual-machine",
272
264
  oauth2_scopes=[],
@@ -283,23 +275,12 @@ class VirtualMachines(BaseSDK):
283
275
  return
284
276
  if utils.match_response(http_res, "4XX", "*"):
285
277
  http_res_text = utils.stream_to_text(http_res)
286
- raise models.APIError(
287
- "API error occurred", http_res.status_code, http_res_text, http_res
288
- )
278
+ raise models.APIError("API error occurred", http_res, http_res_text)
289
279
  if utils.match_response(http_res, "5XX", "*"):
290
280
  http_res_text = utils.stream_to_text(http_res)
291
- raise models.APIError(
292
- "API error occurred", http_res.status_code, http_res_text, http_res
293
- )
294
-
295
- content_type = http_res.headers.get("Content-Type")
296
- http_res_text = utils.stream_to_text(http_res)
297
- raise models.APIError(
298
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
299
- http_res.status_code,
300
- http_res_text,
301
- http_res,
302
- )
281
+ raise models.APIError("API error occurred", http_res, http_res_text)
282
+
283
+ raise models.APIError("Unexpected response received", http_res)
303
284
 
304
285
  async def list_async(
305
286
  self,
@@ -361,6 +342,7 @@ class VirtualMachines(BaseSDK):
361
342
 
362
343
  http_res = await self.do_request_async(
363
344
  hook_ctx=HookContext(
345
+ config=self.sdk_configuration,
364
346
  base_url=base_url or "",
365
347
  operation_id="index-virtual-machine",
366
348
  oauth2_scopes=[],
@@ -377,23 +359,12 @@ class VirtualMachines(BaseSDK):
377
359
  return
378
360
  if utils.match_response(http_res, "4XX", "*"):
379
361
  http_res_text = await utils.stream_to_text_async(http_res)
380
- raise models.APIError(
381
- "API error occurred", http_res.status_code, http_res_text, http_res
382
- )
362
+ raise models.APIError("API error occurred", http_res, http_res_text)
383
363
  if utils.match_response(http_res, "5XX", "*"):
384
364
  http_res_text = await utils.stream_to_text_async(http_res)
385
- raise models.APIError(
386
- "API error occurred", http_res.status_code, http_res_text, http_res
387
- )
388
-
389
- content_type = http_res.headers.get("Content-Type")
390
- http_res_text = await utils.stream_to_text_async(http_res)
391
- raise models.APIError(
392
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
393
- http_res.status_code,
394
- http_res_text,
395
- http_res,
396
- )
365
+ raise models.APIError("API error occurred", http_res, http_res_text)
366
+
367
+ raise models.APIError("Unexpected response received", http_res)
397
368
 
398
369
  def get(
399
370
  self,
@@ -455,6 +426,7 @@ class VirtualMachines(BaseSDK):
455
426
 
456
427
  http_res = self.do_request(
457
428
  hook_ctx=HookContext(
429
+ config=self.sdk_configuration,
458
430
  base_url=base_url or "",
459
431
  operation_id="show-virtual-machine",
460
432
  oauth2_scopes=[],
@@ -471,23 +443,12 @@ class VirtualMachines(BaseSDK):
471
443
  return
472
444
  if utils.match_response(http_res, "4XX", "*"):
473
445
  http_res_text = utils.stream_to_text(http_res)
474
- raise models.APIError(
475
- "API error occurred", http_res.status_code, http_res_text, http_res
476
- )
446
+ raise models.APIError("API error occurred", http_res, http_res_text)
477
447
  if utils.match_response(http_res, "5XX", "*"):
478
448
  http_res_text = utils.stream_to_text(http_res)
479
- raise models.APIError(
480
- "API error occurred", http_res.status_code, http_res_text, http_res
481
- )
482
-
483
- content_type = http_res.headers.get("Content-Type")
484
- http_res_text = utils.stream_to_text(http_res)
485
- raise models.APIError(
486
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
487
- http_res.status_code,
488
- http_res_text,
489
- http_res,
490
- )
449
+ raise models.APIError("API error occurred", http_res, http_res_text)
450
+
451
+ raise models.APIError("Unexpected response received", http_res)
491
452
 
492
453
  async def get_async(
493
454
  self,
@@ -549,6 +510,7 @@ class VirtualMachines(BaseSDK):
549
510
 
550
511
  http_res = await self.do_request_async(
551
512
  hook_ctx=HookContext(
513
+ config=self.sdk_configuration,
552
514
  base_url=base_url or "",
553
515
  operation_id="show-virtual-machine",
554
516
  oauth2_scopes=[],
@@ -565,23 +527,12 @@ class VirtualMachines(BaseSDK):
565
527
  return
566
528
  if utils.match_response(http_res, "4XX", "*"):
567
529
  http_res_text = await utils.stream_to_text_async(http_res)
568
- raise models.APIError(
569
- "API error occurred", http_res.status_code, http_res_text, http_res
570
- )
530
+ raise models.APIError("API error occurred", http_res, http_res_text)
571
531
  if utils.match_response(http_res, "5XX", "*"):
572
532
  http_res_text = await utils.stream_to_text_async(http_res)
573
- raise models.APIError(
574
- "API error occurred", http_res.status_code, http_res_text, http_res
575
- )
576
-
577
- content_type = http_res.headers.get("Content-Type")
578
- http_res_text = await utils.stream_to_text_async(http_res)
579
- raise models.APIError(
580
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
581
- http_res.status_code,
582
- http_res_text,
583
- http_res,
584
- )
533
+ raise models.APIError("API error occurred", http_res, http_res_text)
534
+
535
+ raise models.APIError("Unexpected response received", http_res)
585
536
 
586
537
  def delete(
587
538
  self,
@@ -643,6 +594,7 @@ class VirtualMachines(BaseSDK):
643
594
 
644
595
  http_res = self.do_request(
645
596
  hook_ctx=HookContext(
597
+ config=self.sdk_configuration,
646
598
  base_url=base_url or "",
647
599
  operation_id="destroy-virtual-machine",
648
600
  oauth2_scopes=[],
@@ -659,23 +611,12 @@ class VirtualMachines(BaseSDK):
659
611
  return
660
612
  if utils.match_response(http_res, "4XX", "*"):
661
613
  http_res_text = utils.stream_to_text(http_res)
662
- raise models.APIError(
663
- "API error occurred", http_res.status_code, http_res_text, http_res
664
- )
614
+ raise models.APIError("API error occurred", http_res, http_res_text)
665
615
  if utils.match_response(http_res, "5XX", "*"):
666
616
  http_res_text = utils.stream_to_text(http_res)
667
- raise models.APIError(
668
- "API error occurred", http_res.status_code, http_res_text, http_res
669
- )
670
-
671
- content_type = http_res.headers.get("Content-Type")
672
- http_res_text = utils.stream_to_text(http_res)
673
- raise models.APIError(
674
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
675
- http_res.status_code,
676
- http_res_text,
677
- http_res,
678
- )
617
+ raise models.APIError("API error occurred", http_res, http_res_text)
618
+
619
+ raise models.APIError("Unexpected response received", http_res)
679
620
 
680
621
  async def delete_async(
681
622
  self,
@@ -737,6 +678,7 @@ class VirtualMachines(BaseSDK):
737
678
 
738
679
  http_res = await self.do_request_async(
739
680
  hook_ctx=HookContext(
681
+ config=self.sdk_configuration,
740
682
  base_url=base_url or "",
741
683
  operation_id="destroy-virtual-machine",
742
684
  oauth2_scopes=[],
@@ -753,20 +695,9 @@ class VirtualMachines(BaseSDK):
753
695
  return
754
696
  if utils.match_response(http_res, "4XX", "*"):
755
697
  http_res_text = await utils.stream_to_text_async(http_res)
756
- raise models.APIError(
757
- "API error occurred", http_res.status_code, http_res_text, http_res
758
- )
698
+ raise models.APIError("API error occurred", http_res, http_res_text)
759
699
  if utils.match_response(http_res, "5XX", "*"):
760
700
  http_res_text = await utils.stream_to_text_async(http_res)
761
- raise models.APIError(
762
- "API error occurred", http_res.status_code, http_res_text, http_res
763
- )
764
-
765
- content_type = http_res.headers.get("Content-Type")
766
- http_res_text = await utils.stream_to_text_async(http_res)
767
- raise models.APIError(
768
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
769
- http_res.status_code,
770
- http_res_text,
771
- http_res,
772
- )
701
+ raise models.APIError("API error occurred", http_res, http_res_text)
702
+
703
+ raise models.APIError("Unexpected response received", http_res)