latitudesh-python-sdk 0.0.6__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 (206) hide show
  1. latitudesh_python_sdk/__init__.py +18 -0
  2. latitudesh_python_sdk/_hooks/__init__.py +5 -0
  3. latitudesh_python_sdk/_hooks/registration.py +13 -0
  4. latitudesh_python_sdk/_hooks/sdkhooks.py +76 -0
  5. latitudesh_python_sdk/_hooks/types.py +106 -0
  6. latitudesh_python_sdk/_version.py +15 -0
  7. latitudesh_python_sdk/apikeys.py +802 -0
  8. latitudesh_python_sdk/basesdk.py +366 -0
  9. latitudesh_python_sdk/billing.py +210 -0
  10. latitudesh_python_sdk/events_sdk.py +240 -0
  11. latitudesh_python_sdk/firewalls_sdk.py +1640 -0
  12. latitudesh_python_sdk/httpclient.py +136 -0
  13. latitudesh_python_sdk/ipaddresses_sdk.py +448 -0
  14. latitudesh_python_sdk/models/__init__.py +1927 -0
  15. latitudesh_python_sdk/models/api_key.py +81 -0
  16. latitudesh_python_sdk/models/apierror.py +22 -0
  17. latitudesh_python_sdk/models/assign_server_virtual_networkop.py +43 -0
  18. latitudesh_python_sdk/models/bandwidth_packages.py +67 -0
  19. latitudesh_python_sdk/models/bandwidth_plan.py +72 -0
  20. latitudesh_python_sdk/models/bandwidth_plans.py +15 -0
  21. latitudesh_python_sdk/models/billing_usage.py +158 -0
  22. latitudesh_python_sdk/models/create_api_key.py +40 -0
  23. latitudesh_python_sdk/models/create_firewall_assignmentop.py +61 -0
  24. latitudesh_python_sdk/models/create_firewallop.py +69 -0
  25. latitudesh_python_sdk/models/create_ipmi_sessionop.py +16 -0
  26. latitudesh_python_sdk/models/create_projectop.py +79 -0
  27. latitudesh_python_sdk/models/create_server_actionop.py +69 -0
  28. latitudesh_python_sdk/models/create_server_out_of_bandop.py +61 -0
  29. latitudesh_python_sdk/models/create_server_reinstallop.py +140 -0
  30. latitudesh_python_sdk/models/create_serverop.py +173 -0
  31. latitudesh_python_sdk/models/create_tagop.py +50 -0
  32. latitudesh_python_sdk/models/create_virtual_networkop.py +72 -0
  33. latitudesh_python_sdk/models/custom_tag.py +54 -0
  34. latitudesh_python_sdk/models/delete_api_keyop.py +16 -0
  35. latitudesh_python_sdk/models/delete_firewall_assignmentop.py +25 -0
  36. latitudesh_python_sdk/models/delete_firewallop.py +18 -0
  37. latitudesh_python_sdk/models/delete_project_ssh_keyop.py +23 -0
  38. latitudesh_python_sdk/models/delete_project_user_dataop.py +23 -0
  39. latitudesh_python_sdk/models/delete_projectop.py +18 -0
  40. latitudesh_python_sdk/models/delete_storage_filesystemsop.py +16 -0
  41. latitudesh_python_sdk/models/delete_virtual_networks_assignmentsop.py +16 -0
  42. latitudesh_python_sdk/models/delete_vpn_sessionop.py +16 -0
  43. latitudesh_python_sdk/models/deploy_config.py +74 -0
  44. latitudesh_python_sdk/models/destroy_serverop.py +31 -0
  45. latitudesh_python_sdk/models/destroy_tagop.py +16 -0
  46. latitudesh_python_sdk/models/destroy_team_memberop.py +18 -0
  47. latitudesh_python_sdk/models/destroy_virtual_machineop.py +16 -0
  48. latitudesh_python_sdk/models/destroy_virtual_networkop.py +18 -0
  49. latitudesh_python_sdk/models/error_object.py +49 -0
  50. latitudesh_python_sdk/models/events.py +90 -0
  51. latitudesh_python_sdk/models/filesystem_data.py +53 -0
  52. latitudesh_python_sdk/models/firewall.py +71 -0
  53. latitudesh_python_sdk/models/firewall_server.py +50 -0
  54. latitudesh_python_sdk/models/firewalls.py +26 -0
  55. latitudesh_python_sdk/models/get_bandwidth_plansop.py +33 -0
  56. latitudesh_python_sdk/models/get_billing_usageop.py +46 -0
  57. latitudesh_python_sdk/models/get_eventsop.py +98 -0
  58. latitudesh_python_sdk/models/get_firewall_assignmentsop.py +18 -0
  59. latitudesh_python_sdk/models/get_firewallop.py +18 -0
  60. latitudesh_python_sdk/models/get_ipop.py +33 -0
  61. latitudesh_python_sdk/models/get_ipsop.py +91 -0
  62. latitudesh_python_sdk/models/get_planop.py +16 -0
  63. latitudesh_python_sdk/models/get_plans_operating_systemop.py +19 -0
  64. latitudesh_python_sdk/models/get_plansop.py +125 -0
  65. latitudesh_python_sdk/models/get_project_ssh_keyop.py +37 -0
  66. latitudesh_python_sdk/models/get_project_ssh_keysop.py +33 -0
  67. latitudesh_python_sdk/models/get_project_user_dataop.py +38 -0
  68. latitudesh_python_sdk/models/get_project_users_dataop.py +46 -0
  69. latitudesh_python_sdk/models/get_projectsop.py +76 -0
  70. latitudesh_python_sdk/models/get_regionop.py +18 -0
  71. latitudesh_python_sdk/models/get_role_idop.py +16 -0
  72. latitudesh_python_sdk/models/get_rolesop.py +19 -0
  73. latitudesh_python_sdk/models/get_server_deploy_configop.py +18 -0
  74. latitudesh_python_sdk/models/get_server_out_of_bandop.py +18 -0
  75. latitudesh_python_sdk/models/get_serverop.py +33 -0
  76. latitudesh_python_sdk/models/get_serversop.py +156 -0
  77. latitudesh_python_sdk/models/get_storage_filesystemsop.py +22 -0
  78. latitudesh_python_sdk/models/get_traffic_consumptionop.py +45 -0
  79. latitudesh_python_sdk/models/get_traffic_quotaop.py +20 -0
  80. latitudesh_python_sdk/models/get_user_profileop.py +19 -0
  81. latitudesh_python_sdk/models/get_virtual_networkop.py +32 -0
  82. latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +40 -0
  83. latitudesh_python_sdk/models/get_virtual_networksop.py +40 -0
  84. latitudesh_python_sdk/models/get_vpn_sessionsop.py +70 -0
  85. latitudesh_python_sdk/models/index_virtual_machineop.py +22 -0
  86. latitudesh_python_sdk/models/ip_address.py +122 -0
  87. latitudesh_python_sdk/models/ip_addresses.py +15 -0
  88. latitudesh_python_sdk/models/ipmi_session.py +53 -0
  89. latitudesh_python_sdk/models/list_firewallsop.py +20 -0
  90. latitudesh_python_sdk/models/membership.py +63 -0
  91. latitudesh_python_sdk/models/operating_systems.py +57 -0
  92. latitudesh_python_sdk/models/out_of_band_connection.py +88 -0
  93. latitudesh_python_sdk/models/patch_current_teamop.py +91 -0
  94. latitudesh_python_sdk/models/patch_storage_filesystemsop.py +79 -0
  95. latitudesh_python_sdk/models/patch_user_profileop.py +88 -0
  96. latitudesh_python_sdk/models/plan.py +15 -0
  97. latitudesh_python_sdk/models/plan_data.py +206 -0
  98. latitudesh_python_sdk/models/post_api_keyop.py +19 -0
  99. latitudesh_python_sdk/models/post_project_ssh_keyop.py +81 -0
  100. latitudesh_python_sdk/models/post_project_user_dataop.py +68 -0
  101. latitudesh_python_sdk/models/post_storage_filesystemsop.py +63 -0
  102. latitudesh_python_sdk/models/post_team_membersop.py +54 -0
  103. latitudesh_python_sdk/models/post_teamop.py +67 -0
  104. latitudesh_python_sdk/models/post_vpn_sessionop.py +63 -0
  105. latitudesh_python_sdk/models/project.py +130 -0
  106. latitudesh_python_sdk/models/project_include.py +72 -0
  107. latitudesh_python_sdk/models/projects.py +15 -0
  108. latitudesh_python_sdk/models/put_project_ssh_keyop.py +87 -0
  109. latitudesh_python_sdk/models/put_project_user_dataop.py +76 -0
  110. latitudesh_python_sdk/models/put_vpn_sessionop.py +16 -0
  111. latitudesh_python_sdk/models/region.py +50 -0
  112. latitudesh_python_sdk/models/region_resource_data.py +37 -0
  113. latitudesh_python_sdk/models/regions.py +50 -0
  114. latitudesh_python_sdk/models/role.py +15 -0
  115. latitudesh_python_sdk/models/role_data.py +35 -0
  116. latitudesh_python_sdk/models/security.py +25 -0
  117. latitudesh_python_sdk/models/server.py +54 -0
  118. latitudesh_python_sdk/models/server_action.py +52 -0
  119. latitudesh_python_sdk/models/server_data.py +219 -0
  120. latitudesh_python_sdk/models/server_exit_rescue_modeop.py +16 -0
  121. latitudesh_python_sdk/models/server_lockop.py +16 -0
  122. latitudesh_python_sdk/models/server_rescue.py +22 -0
  123. latitudesh_python_sdk/models/server_schedule_deletion.py +44 -0
  124. latitudesh_python_sdk/models/server_schedule_deletionop.py +16 -0
  125. latitudesh_python_sdk/models/server_start_rescue_modeop.py +16 -0
  126. latitudesh_python_sdk/models/server_unlockop.py +16 -0
  127. latitudesh_python_sdk/models/server_unschedule_deletionop.py +16 -0
  128. latitudesh_python_sdk/models/servers.py +26 -0
  129. latitudesh_python_sdk/models/show_virtual_machineop.py +16 -0
  130. latitudesh_python_sdk/models/ssh_key.py +15 -0
  131. latitudesh_python_sdk/models/ssh_key_data.py +55 -0
  132. latitudesh_python_sdk/models/storage_plan.py +36 -0
  133. latitudesh_python_sdk/models/storage_plans.py +15 -0
  134. latitudesh_python_sdk/models/team.py +74 -0
  135. latitudesh_python_sdk/models/team_include.py +43 -0
  136. latitudesh_python_sdk/models/team_members.py +51 -0
  137. latitudesh_python_sdk/models/teams.py +26 -0
  138. latitudesh_python_sdk/models/traffic.py +133 -0
  139. latitudesh_python_sdk/models/traffic_quota.py +106 -0
  140. latitudesh_python_sdk/models/update_api_key.py +48 -0
  141. latitudesh_python_sdk/models/update_api_keyop.py +41 -0
  142. latitudesh_python_sdk/models/update_firewallop.py +89 -0
  143. latitudesh_python_sdk/models/update_plans_bandwidthop.py +50 -0
  144. latitudesh_python_sdk/models/update_projectop.py +95 -0
  145. latitudesh_python_sdk/models/update_server_deploy_configop.py +122 -0
  146. latitudesh_python_sdk/models/update_serverop.py +69 -0
  147. latitudesh_python_sdk/models/update_tagop.py +74 -0
  148. latitudesh_python_sdk/models/update_virtual_networkop.py +67 -0
  149. latitudesh_python_sdk/models/user.py +59 -0
  150. latitudesh_python_sdk/models/user_data.py +15 -0
  151. latitudesh_python_sdk/models/user_data_properties.py +46 -0
  152. latitudesh_python_sdk/models/user_include.py +52 -0
  153. latitudesh_python_sdk/models/user_team.py +61 -0
  154. latitudesh_python_sdk/models/user_teams.py +26 -0
  155. latitudesh_python_sdk/models/user_update.py +37 -0
  156. latitudesh_python_sdk/models/virtual_machine.py +25 -0
  157. latitudesh_python_sdk/models/virtual_machine_payload.py +41 -0
  158. latitudesh_python_sdk/models/virtual_machine_plans.py +180 -0
  159. latitudesh_python_sdk/models/virtual_network.py +103 -0
  160. latitudesh_python_sdk/models/virtual_network1.py +84 -0
  161. latitudesh_python_sdk/models/virtual_network_assignment.py +37 -0
  162. latitudesh_python_sdk/models/virtual_network_assignments.py +29 -0
  163. latitudesh_python_sdk/models/virtual_networks.py +26 -0
  164. latitudesh_python_sdk/models/vpn_session_data_with_password.py +77 -0
  165. latitudesh_python_sdk/models/vpn_session_with_password.py +18 -0
  166. latitudesh_python_sdk/operatingsystems_sdk.py +188 -0
  167. latitudesh_python_sdk/plans.py +1178 -0
  168. latitudesh_python_sdk/privatenetworks.py +1672 -0
  169. latitudesh_python_sdk/projects_sdk.py +864 -0
  170. latitudesh_python_sdk/py.typed +1 -0
  171. latitudesh_python_sdk/regions_sdk.py +376 -0
  172. latitudesh_python_sdk/roles.py +374 -0
  173. latitudesh_python_sdk/sdk.py +214 -0
  174. latitudesh_python_sdk/sdkconfiguration.py +57 -0
  175. latitudesh_python_sdk/servers_sdk.py +3810 -0
  176. latitudesh_python_sdk/sshkeys.py +1050 -0
  177. latitudesh_python_sdk/storage.py +820 -0
  178. latitudesh_python_sdk/tags.py +786 -0
  179. latitudesh_python_sdk/teams_sdk.py +596 -0
  180. latitudesh_python_sdk/teamsmembers.py +578 -0
  181. latitudesh_python_sdk/traffic_sdk.py +400 -0
  182. latitudesh_python_sdk/types/__init__.py +21 -0
  183. latitudesh_python_sdk/types/basemodel.py +39 -0
  184. latitudesh_python_sdk/userdata_sdk.py +1052 -0
  185. latitudesh_python_sdk/userprofile.py +596 -0
  186. latitudesh_python_sdk/utils/__init__.py +101 -0
  187. latitudesh_python_sdk/utils/annotations.py +55 -0
  188. latitudesh_python_sdk/utils/enums.py +34 -0
  189. latitudesh_python_sdk/utils/eventstreaming.py +238 -0
  190. latitudesh_python_sdk/utils/forms.py +202 -0
  191. latitudesh_python_sdk/utils/headers.py +136 -0
  192. latitudesh_python_sdk/utils/logger.py +27 -0
  193. latitudesh_python_sdk/utils/metadata.py +118 -0
  194. latitudesh_python_sdk/utils/queryparams.py +205 -0
  195. latitudesh_python_sdk/utils/requestbodies.py +66 -0
  196. latitudesh_python_sdk/utils/retries.py +217 -0
  197. latitudesh_python_sdk/utils/security.py +192 -0
  198. latitudesh_python_sdk/utils/serializers.py +219 -0
  199. latitudesh_python_sdk/utils/url.py +155 -0
  200. latitudesh_python_sdk/utils/values.py +137 -0
  201. latitudesh_python_sdk/virtualmachines.py +772 -0
  202. latitudesh_python_sdk/vpnsessions.py +818 -0
  203. latitudesh_python_sdk-0.0.6.dist-info/LICENSE +21 -0
  204. latitudesh_python_sdk-0.0.6.dist-info/METADATA +730 -0
  205. latitudesh_python_sdk-0.0.6.dist-info/RECORD +206 -0
  206. latitudesh_python_sdk-0.0.6.dist-info/WHEEL +4 -0
@@ -0,0 +1,596 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from latitudesh_python_sdk import models, utils
5
+ from latitudesh_python_sdk._hooks import HookContext
6
+ from latitudesh_python_sdk.types import OptionalNullable, UNSET
7
+ from latitudesh_python_sdk.utils import get_security_from_env
8
+ from typing import Any, Mapping, Optional, Union
9
+
10
+
11
+ class TeamsSDK(BaseSDK):
12
+ def get(
13
+ self,
14
+ *,
15
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
16
+ server_url: Optional[str] = None,
17
+ timeout_ms: Optional[int] = None,
18
+ http_headers: Optional[Mapping[str, str]] = None,
19
+ ) -> models.Teams:
20
+ r"""Retrieve the team
21
+
22
+ :param retries: Override the default retry configuration for this method
23
+ :param server_url: Override the default server URL for this method
24
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
25
+ :param http_headers: Additional headers to set or replace on requests.
26
+ """
27
+ base_url = None
28
+ url_variables = None
29
+ if timeout_ms is None:
30
+ timeout_ms = self.sdk_configuration.timeout_ms
31
+
32
+ if server_url is not None:
33
+ base_url = server_url
34
+ else:
35
+ base_url = self._get_url(base_url, url_variables)
36
+ req = self._build_request(
37
+ method="GET",
38
+ path="/team",
39
+ base_url=base_url,
40
+ url_variables=url_variables,
41
+ request=None,
42
+ request_body_required=False,
43
+ request_has_path_params=False,
44
+ request_has_query_params=True,
45
+ user_agent_header="user-agent",
46
+ accept_header_value="application/vnd.api+json",
47
+ http_headers=http_headers,
48
+ security=self.sdk_configuration.security,
49
+ timeout_ms=timeout_ms,
50
+ )
51
+
52
+ if retries == UNSET:
53
+ if self.sdk_configuration.retry_config is not UNSET:
54
+ retries = self.sdk_configuration.retry_config
55
+
56
+ retry_config = None
57
+ if isinstance(retries, utils.RetryConfig):
58
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
59
+
60
+ http_res = self.do_request(
61
+ hook_ctx=HookContext(
62
+ base_url=base_url or "",
63
+ operation_id="get-team",
64
+ oauth2_scopes=[],
65
+ security_source=get_security_from_env(
66
+ self.sdk_configuration.security, models.Security
67
+ ),
68
+ ),
69
+ request=req,
70
+ error_status_codes=["4XX", "5XX"],
71
+ retry_config=retry_config,
72
+ )
73
+
74
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
75
+ return utils.unmarshal_json(http_res.text, models.Teams)
76
+ if utils.match_response(http_res, "4XX", "*"):
77
+ http_res_text = utils.stream_to_text(http_res)
78
+ raise models.APIError(
79
+ "API error occurred", http_res.status_code, http_res_text, http_res
80
+ )
81
+ if utils.match_response(http_res, "5XX", "*"):
82
+ http_res_text = utils.stream_to_text(http_res)
83
+ raise models.APIError(
84
+ "API error occurred", http_res.status_code, http_res_text, http_res
85
+ )
86
+
87
+ content_type = http_res.headers.get("Content-Type")
88
+ http_res_text = utils.stream_to_text(http_res)
89
+ raise models.APIError(
90
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
91
+ http_res.status_code,
92
+ http_res_text,
93
+ http_res,
94
+ )
95
+
96
+ async def get_async(
97
+ self,
98
+ *,
99
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
100
+ server_url: Optional[str] = None,
101
+ timeout_ms: Optional[int] = None,
102
+ http_headers: Optional[Mapping[str, str]] = None,
103
+ ) -> models.Teams:
104
+ r"""Retrieve the team
105
+
106
+ :param retries: Override the default retry configuration for this method
107
+ :param server_url: Override the default server URL for this method
108
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
109
+ :param http_headers: Additional headers to set or replace on requests.
110
+ """
111
+ base_url = None
112
+ url_variables = None
113
+ if timeout_ms is None:
114
+ timeout_ms = self.sdk_configuration.timeout_ms
115
+
116
+ if server_url is not None:
117
+ base_url = server_url
118
+ else:
119
+ base_url = self._get_url(base_url, url_variables)
120
+ req = self._build_request_async(
121
+ method="GET",
122
+ path="/team",
123
+ base_url=base_url,
124
+ url_variables=url_variables,
125
+ request=None,
126
+ request_body_required=False,
127
+ request_has_path_params=False,
128
+ request_has_query_params=True,
129
+ user_agent_header="user-agent",
130
+ accept_header_value="application/vnd.api+json",
131
+ http_headers=http_headers,
132
+ security=self.sdk_configuration.security,
133
+ timeout_ms=timeout_ms,
134
+ )
135
+
136
+ if retries == UNSET:
137
+ if self.sdk_configuration.retry_config is not UNSET:
138
+ retries = self.sdk_configuration.retry_config
139
+
140
+ retry_config = None
141
+ if isinstance(retries, utils.RetryConfig):
142
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
143
+
144
+ http_res = await self.do_request_async(
145
+ hook_ctx=HookContext(
146
+ base_url=base_url or "",
147
+ operation_id="get-team",
148
+ oauth2_scopes=[],
149
+ security_source=get_security_from_env(
150
+ self.sdk_configuration.security, models.Security
151
+ ),
152
+ ),
153
+ request=req,
154
+ error_status_codes=["4XX", "5XX"],
155
+ retry_config=retry_config,
156
+ )
157
+
158
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
159
+ return utils.unmarshal_json(http_res.text, models.Teams)
160
+ if utils.match_response(http_res, "4XX", "*"):
161
+ http_res_text = await utils.stream_to_text_async(http_res)
162
+ raise models.APIError(
163
+ "API error occurred", http_res.status_code, http_res_text, http_res
164
+ )
165
+ if utils.match_response(http_res, "5XX", "*"):
166
+ http_res_text = await utils.stream_to_text_async(http_res)
167
+ raise models.APIError(
168
+ "API error occurred", http_res.status_code, http_res_text, http_res
169
+ )
170
+
171
+ content_type = http_res.headers.get("Content-Type")
172
+ http_res_text = await utils.stream_to_text_async(http_res)
173
+ raise models.APIError(
174
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
175
+ http_res.status_code,
176
+ http_res_text,
177
+ http_res,
178
+ )
179
+
180
+ def create(
181
+ self,
182
+ *,
183
+ data: Union[models.PostTeamTeamsData, models.PostTeamTeamsDataTypedDict],
184
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
185
+ server_url: Optional[str] = None,
186
+ timeout_ms: Optional[int] = None,
187
+ http_headers: Optional[Mapping[str, str]] = None,
188
+ ) -> models.PostTeamResponseBody:
189
+ r"""Create a team
190
+
191
+ :param data:
192
+ :param retries: Override the default retry configuration for this method
193
+ :param server_url: Override the default server URL for this method
194
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
195
+ :param http_headers: Additional headers to set or replace on requests.
196
+ """
197
+ base_url = None
198
+ url_variables = None
199
+ if timeout_ms is None:
200
+ timeout_ms = self.sdk_configuration.timeout_ms
201
+
202
+ if server_url is not None:
203
+ base_url = server_url
204
+ else:
205
+ base_url = self._get_url(base_url, url_variables)
206
+
207
+ request = models.PostTeamTeamsRequestBody(
208
+ data=utils.get_pydantic_model(data, models.PostTeamTeamsData),
209
+ )
210
+
211
+ req = self._build_request(
212
+ method="POST",
213
+ path="/team",
214
+ base_url=base_url,
215
+ url_variables=url_variables,
216
+ request=request,
217
+ request_body_required=True,
218
+ request_has_path_params=False,
219
+ request_has_query_params=True,
220
+ user_agent_header="user-agent",
221
+ accept_header_value="application/vnd.api+json",
222
+ http_headers=http_headers,
223
+ security=self.sdk_configuration.security,
224
+ get_serialized_body=lambda: utils.serialize_request_body(
225
+ request, False, False, "json", models.PostTeamTeamsRequestBody
226
+ ),
227
+ timeout_ms=timeout_ms,
228
+ )
229
+
230
+ if retries == UNSET:
231
+ if self.sdk_configuration.retry_config is not UNSET:
232
+ retries = self.sdk_configuration.retry_config
233
+
234
+ retry_config = None
235
+ if isinstance(retries, utils.RetryConfig):
236
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
237
+
238
+ http_res = self.do_request(
239
+ hook_ctx=HookContext(
240
+ base_url=base_url or "",
241
+ operation_id="post-team",
242
+ oauth2_scopes=[],
243
+ security_source=get_security_from_env(
244
+ self.sdk_configuration.security, models.Security
245
+ ),
246
+ ),
247
+ request=req,
248
+ error_status_codes=["406", "422", "4XX", "5XX"],
249
+ retry_config=retry_config,
250
+ )
251
+
252
+ response_data: Any = None
253
+ if utils.match_response(http_res, "201", "application/vnd.api+json"):
254
+ return utils.unmarshal_json(http_res.text, models.PostTeamResponseBody)
255
+ if utils.match_response(http_res, ["406", "422"], "application/vnd.api+json"):
256
+ response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
257
+ raise models.ErrorObject(data=response_data)
258
+ if utils.match_response(http_res, "4XX", "*"):
259
+ http_res_text = utils.stream_to_text(http_res)
260
+ raise models.APIError(
261
+ "API error occurred", http_res.status_code, http_res_text, http_res
262
+ )
263
+ if utils.match_response(http_res, "5XX", "*"):
264
+ http_res_text = utils.stream_to_text(http_res)
265
+ raise models.APIError(
266
+ "API error occurred", http_res.status_code, http_res_text, http_res
267
+ )
268
+
269
+ content_type = http_res.headers.get("Content-Type")
270
+ http_res_text = utils.stream_to_text(http_res)
271
+ raise models.APIError(
272
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
273
+ http_res.status_code,
274
+ http_res_text,
275
+ http_res,
276
+ )
277
+
278
+ async def create_async(
279
+ self,
280
+ *,
281
+ data: Union[models.PostTeamTeamsData, models.PostTeamTeamsDataTypedDict],
282
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
283
+ server_url: Optional[str] = None,
284
+ timeout_ms: Optional[int] = None,
285
+ http_headers: Optional[Mapping[str, str]] = None,
286
+ ) -> models.PostTeamResponseBody:
287
+ r"""Create a team
288
+
289
+ :param data:
290
+ :param retries: Override the default retry configuration for this method
291
+ :param server_url: Override the default server URL for this method
292
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
293
+ :param http_headers: Additional headers to set or replace on requests.
294
+ """
295
+ base_url = None
296
+ url_variables = None
297
+ if timeout_ms is None:
298
+ timeout_ms = self.sdk_configuration.timeout_ms
299
+
300
+ if server_url is not None:
301
+ base_url = server_url
302
+ else:
303
+ base_url = self._get_url(base_url, url_variables)
304
+
305
+ request = models.PostTeamTeamsRequestBody(
306
+ data=utils.get_pydantic_model(data, models.PostTeamTeamsData),
307
+ )
308
+
309
+ req = self._build_request_async(
310
+ method="POST",
311
+ path="/team",
312
+ base_url=base_url,
313
+ url_variables=url_variables,
314
+ request=request,
315
+ request_body_required=True,
316
+ request_has_path_params=False,
317
+ request_has_query_params=True,
318
+ user_agent_header="user-agent",
319
+ accept_header_value="application/vnd.api+json",
320
+ http_headers=http_headers,
321
+ security=self.sdk_configuration.security,
322
+ get_serialized_body=lambda: utils.serialize_request_body(
323
+ request, False, False, "json", models.PostTeamTeamsRequestBody
324
+ ),
325
+ timeout_ms=timeout_ms,
326
+ )
327
+
328
+ if retries == UNSET:
329
+ if self.sdk_configuration.retry_config is not UNSET:
330
+ retries = self.sdk_configuration.retry_config
331
+
332
+ retry_config = None
333
+ if isinstance(retries, utils.RetryConfig):
334
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
335
+
336
+ http_res = await self.do_request_async(
337
+ hook_ctx=HookContext(
338
+ base_url=base_url or "",
339
+ operation_id="post-team",
340
+ oauth2_scopes=[],
341
+ security_source=get_security_from_env(
342
+ self.sdk_configuration.security, models.Security
343
+ ),
344
+ ),
345
+ request=req,
346
+ error_status_codes=["406", "422", "4XX", "5XX"],
347
+ retry_config=retry_config,
348
+ )
349
+
350
+ response_data: Any = None
351
+ if utils.match_response(http_res, "201", "application/vnd.api+json"):
352
+ return utils.unmarshal_json(http_res.text, models.PostTeamResponseBody)
353
+ if utils.match_response(http_res, ["406", "422"], "application/vnd.api+json"):
354
+ response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
355
+ raise models.ErrorObject(data=response_data)
356
+ if utils.match_response(http_res, "4XX", "*"):
357
+ http_res_text = await utils.stream_to_text_async(http_res)
358
+ raise models.APIError(
359
+ "API error occurred", http_res.status_code, http_res_text, http_res
360
+ )
361
+ if utils.match_response(http_res, "5XX", "*"):
362
+ http_res_text = await utils.stream_to_text_async(http_res)
363
+ raise models.APIError(
364
+ "API error occurred", http_res.status_code, http_res_text, http_res
365
+ )
366
+
367
+ content_type = http_res.headers.get("Content-Type")
368
+ http_res_text = await utils.stream_to_text_async(http_res)
369
+ raise models.APIError(
370
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
371
+ http_res.status_code,
372
+ http_res_text,
373
+ http_res,
374
+ )
375
+
376
+ def update(
377
+ self,
378
+ *,
379
+ team_id: str,
380
+ data: Union[
381
+ models.PatchCurrentTeamTeamsData, models.PatchCurrentTeamTeamsDataTypedDict
382
+ ],
383
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
384
+ server_url: Optional[str] = None,
385
+ timeout_ms: Optional[int] = None,
386
+ http_headers: Optional[Mapping[str, str]] = None,
387
+ ) -> models.PatchCurrentTeamResponseBody:
388
+ r"""Update a team
389
+
390
+ :param team_id:
391
+ :param data:
392
+ :param retries: Override the default retry configuration for this method
393
+ :param server_url: Override the default server URL for this method
394
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
395
+ :param http_headers: Additional headers to set or replace on requests.
396
+ """
397
+ base_url = None
398
+ url_variables = None
399
+ if timeout_ms is None:
400
+ timeout_ms = self.sdk_configuration.timeout_ms
401
+
402
+ if server_url is not None:
403
+ base_url = server_url
404
+ else:
405
+ base_url = self._get_url(base_url, url_variables)
406
+
407
+ request = models.PatchCurrentTeamRequest(
408
+ team_id=team_id,
409
+ request_body=models.PatchCurrentTeamTeamsRequestBody(
410
+ data=utils.get_pydantic_model(data, models.PatchCurrentTeamTeamsData),
411
+ ),
412
+ )
413
+
414
+ req = self._build_request(
415
+ method="PATCH",
416
+ path="/team/{team_id}",
417
+ base_url=base_url,
418
+ url_variables=url_variables,
419
+ request=request,
420
+ request_body_required=True,
421
+ request_has_path_params=True,
422
+ request_has_query_params=True,
423
+ user_agent_header="user-agent",
424
+ accept_header_value="application/vnd.api+json",
425
+ http_headers=http_headers,
426
+ security=self.sdk_configuration.security,
427
+ get_serialized_body=lambda: utils.serialize_request_body(
428
+ request.request_body,
429
+ False,
430
+ False,
431
+ "json",
432
+ models.PatchCurrentTeamTeamsRequestBody,
433
+ ),
434
+ timeout_ms=timeout_ms,
435
+ )
436
+
437
+ if retries == UNSET:
438
+ if self.sdk_configuration.retry_config is not UNSET:
439
+ retries = self.sdk_configuration.retry_config
440
+
441
+ retry_config = None
442
+ if isinstance(retries, utils.RetryConfig):
443
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
444
+
445
+ http_res = self.do_request(
446
+ hook_ctx=HookContext(
447
+ base_url=base_url or "",
448
+ operation_id="patch-current-team",
449
+ oauth2_scopes=[],
450
+ security_source=get_security_from_env(
451
+ self.sdk_configuration.security, models.Security
452
+ ),
453
+ ),
454
+ request=req,
455
+ error_status_codes=["403", "404", "4XX", "5XX"],
456
+ retry_config=retry_config,
457
+ )
458
+
459
+ response_data: Any = None
460
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
461
+ return utils.unmarshal_json(
462
+ http_res.text, models.PatchCurrentTeamResponseBody
463
+ )
464
+ if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
465
+ response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
466
+ raise models.ErrorObject(data=response_data)
467
+ if utils.match_response(http_res, "4XX", "*"):
468
+ http_res_text = utils.stream_to_text(http_res)
469
+ raise models.APIError(
470
+ "API error occurred", http_res.status_code, http_res_text, http_res
471
+ )
472
+ if utils.match_response(http_res, "5XX", "*"):
473
+ 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
+ )
477
+
478
+ content_type = http_res.headers.get("Content-Type")
479
+ http_res_text = utils.stream_to_text(http_res)
480
+ raise models.APIError(
481
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
482
+ http_res.status_code,
483
+ http_res_text,
484
+ http_res,
485
+ )
486
+
487
+ async def update_async(
488
+ self,
489
+ *,
490
+ team_id: str,
491
+ data: Union[
492
+ models.PatchCurrentTeamTeamsData, models.PatchCurrentTeamTeamsDataTypedDict
493
+ ],
494
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
495
+ server_url: Optional[str] = None,
496
+ timeout_ms: Optional[int] = None,
497
+ http_headers: Optional[Mapping[str, str]] = None,
498
+ ) -> models.PatchCurrentTeamResponseBody:
499
+ r"""Update a team
500
+
501
+ :param team_id:
502
+ :param data:
503
+ :param retries: Override the default retry configuration for this method
504
+ :param server_url: Override the default server URL for this method
505
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
506
+ :param http_headers: Additional headers to set or replace on requests.
507
+ """
508
+ base_url = None
509
+ url_variables = None
510
+ if timeout_ms is None:
511
+ timeout_ms = self.sdk_configuration.timeout_ms
512
+
513
+ if server_url is not None:
514
+ base_url = server_url
515
+ else:
516
+ base_url = self._get_url(base_url, url_variables)
517
+
518
+ request = models.PatchCurrentTeamRequest(
519
+ team_id=team_id,
520
+ request_body=models.PatchCurrentTeamTeamsRequestBody(
521
+ data=utils.get_pydantic_model(data, models.PatchCurrentTeamTeamsData),
522
+ ),
523
+ )
524
+
525
+ req = self._build_request_async(
526
+ method="PATCH",
527
+ path="/team/{team_id}",
528
+ base_url=base_url,
529
+ url_variables=url_variables,
530
+ request=request,
531
+ request_body_required=True,
532
+ request_has_path_params=True,
533
+ request_has_query_params=True,
534
+ user_agent_header="user-agent",
535
+ accept_header_value="application/vnd.api+json",
536
+ http_headers=http_headers,
537
+ security=self.sdk_configuration.security,
538
+ get_serialized_body=lambda: utils.serialize_request_body(
539
+ request.request_body,
540
+ False,
541
+ False,
542
+ "json",
543
+ models.PatchCurrentTeamTeamsRequestBody,
544
+ ),
545
+ timeout_ms=timeout_ms,
546
+ )
547
+
548
+ if retries == UNSET:
549
+ if self.sdk_configuration.retry_config is not UNSET:
550
+ retries = self.sdk_configuration.retry_config
551
+
552
+ retry_config = None
553
+ if isinstance(retries, utils.RetryConfig):
554
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
555
+
556
+ http_res = await self.do_request_async(
557
+ hook_ctx=HookContext(
558
+ base_url=base_url or "",
559
+ operation_id="patch-current-team",
560
+ oauth2_scopes=[],
561
+ security_source=get_security_from_env(
562
+ self.sdk_configuration.security, models.Security
563
+ ),
564
+ ),
565
+ request=req,
566
+ error_status_codes=["403", "404", "4XX", "5XX"],
567
+ retry_config=retry_config,
568
+ )
569
+
570
+ response_data: Any = None
571
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
572
+ return utils.unmarshal_json(
573
+ http_res.text, models.PatchCurrentTeamResponseBody
574
+ )
575
+ if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
576
+ response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
577
+ raise models.ErrorObject(data=response_data)
578
+ if utils.match_response(http_res, "4XX", "*"):
579
+ http_res_text = await utils.stream_to_text_async(http_res)
580
+ raise models.APIError(
581
+ "API error occurred", http_res.status_code, http_res_text, http_res
582
+ )
583
+ if utils.match_response(http_res, "5XX", "*"):
584
+ http_res_text = await utils.stream_to_text_async(http_res)
585
+ raise models.APIError(
586
+ "API error occurred", http_res.status_code, http_res_text, http_res
587
+ )
588
+
589
+ content_type = http_res.headers.get("Content-Type")
590
+ http_res_text = await utils.stream_to_text_async(http_res)
591
+ raise models.APIError(
592
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
593
+ http_res.status_code,
594
+ http_res_text,
595
+ http_res,
596
+ )