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.
- latitudesh_python_sdk/__init__.py +18 -0
- latitudesh_python_sdk/_hooks/__init__.py +5 -0
- latitudesh_python_sdk/_hooks/registration.py +13 -0
- latitudesh_python_sdk/_hooks/sdkhooks.py +76 -0
- latitudesh_python_sdk/_hooks/types.py +106 -0
- latitudesh_python_sdk/_version.py +15 -0
- latitudesh_python_sdk/apikeys.py +802 -0
- latitudesh_python_sdk/basesdk.py +366 -0
- latitudesh_python_sdk/billing.py +210 -0
- latitudesh_python_sdk/events_sdk.py +240 -0
- latitudesh_python_sdk/firewalls_sdk.py +1640 -0
- latitudesh_python_sdk/httpclient.py +136 -0
- latitudesh_python_sdk/ipaddresses_sdk.py +448 -0
- latitudesh_python_sdk/models/__init__.py +1927 -0
- latitudesh_python_sdk/models/api_key.py +81 -0
- latitudesh_python_sdk/models/apierror.py +22 -0
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +43 -0
- latitudesh_python_sdk/models/bandwidth_packages.py +67 -0
- latitudesh_python_sdk/models/bandwidth_plan.py +72 -0
- latitudesh_python_sdk/models/bandwidth_plans.py +15 -0
- latitudesh_python_sdk/models/billing_usage.py +158 -0
- latitudesh_python_sdk/models/create_api_key.py +40 -0
- latitudesh_python_sdk/models/create_firewall_assignmentop.py +61 -0
- latitudesh_python_sdk/models/create_firewallop.py +69 -0
- latitudesh_python_sdk/models/create_ipmi_sessionop.py +16 -0
- latitudesh_python_sdk/models/create_projectop.py +79 -0
- latitudesh_python_sdk/models/create_server_actionop.py +69 -0
- latitudesh_python_sdk/models/create_server_out_of_bandop.py +61 -0
- latitudesh_python_sdk/models/create_server_reinstallop.py +140 -0
- latitudesh_python_sdk/models/create_serverop.py +173 -0
- latitudesh_python_sdk/models/create_tagop.py +50 -0
- latitudesh_python_sdk/models/create_virtual_networkop.py +72 -0
- latitudesh_python_sdk/models/custom_tag.py +54 -0
- latitudesh_python_sdk/models/delete_api_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_firewall_assignmentop.py +25 -0
- latitudesh_python_sdk/models/delete_firewallop.py +18 -0
- latitudesh_python_sdk/models/delete_project_ssh_keyop.py +23 -0
- latitudesh_python_sdk/models/delete_project_user_dataop.py +23 -0
- latitudesh_python_sdk/models/delete_projectop.py +18 -0
- latitudesh_python_sdk/models/delete_storage_filesystemsop.py +16 -0
- latitudesh_python_sdk/models/delete_virtual_networks_assignmentsop.py +16 -0
- latitudesh_python_sdk/models/delete_vpn_sessionop.py +16 -0
- latitudesh_python_sdk/models/deploy_config.py +74 -0
- latitudesh_python_sdk/models/destroy_serverop.py +31 -0
- latitudesh_python_sdk/models/destroy_tagop.py +16 -0
- latitudesh_python_sdk/models/destroy_team_memberop.py +18 -0
- latitudesh_python_sdk/models/destroy_virtual_machineop.py +16 -0
- latitudesh_python_sdk/models/destroy_virtual_networkop.py +18 -0
- latitudesh_python_sdk/models/error_object.py +49 -0
- latitudesh_python_sdk/models/events.py +90 -0
- latitudesh_python_sdk/models/filesystem_data.py +53 -0
- latitudesh_python_sdk/models/firewall.py +71 -0
- latitudesh_python_sdk/models/firewall_server.py +50 -0
- latitudesh_python_sdk/models/firewalls.py +26 -0
- latitudesh_python_sdk/models/get_bandwidth_plansop.py +33 -0
- latitudesh_python_sdk/models/get_billing_usageop.py +46 -0
- latitudesh_python_sdk/models/get_eventsop.py +98 -0
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +18 -0
- latitudesh_python_sdk/models/get_firewallop.py +18 -0
- latitudesh_python_sdk/models/get_ipop.py +33 -0
- latitudesh_python_sdk/models/get_ipsop.py +91 -0
- latitudesh_python_sdk/models/get_planop.py +16 -0
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +19 -0
- latitudesh_python_sdk/models/get_plansop.py +125 -0
- latitudesh_python_sdk/models/get_project_ssh_keyop.py +37 -0
- latitudesh_python_sdk/models/get_project_ssh_keysop.py +33 -0
- latitudesh_python_sdk/models/get_project_user_dataop.py +38 -0
- latitudesh_python_sdk/models/get_project_users_dataop.py +46 -0
- latitudesh_python_sdk/models/get_projectsop.py +76 -0
- latitudesh_python_sdk/models/get_regionop.py +18 -0
- latitudesh_python_sdk/models/get_role_idop.py +16 -0
- latitudesh_python_sdk/models/get_rolesop.py +19 -0
- latitudesh_python_sdk/models/get_server_deploy_configop.py +18 -0
- latitudesh_python_sdk/models/get_server_out_of_bandop.py +18 -0
- latitudesh_python_sdk/models/get_serverop.py +33 -0
- latitudesh_python_sdk/models/get_serversop.py +156 -0
- latitudesh_python_sdk/models/get_storage_filesystemsop.py +22 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +45 -0
- latitudesh_python_sdk/models/get_traffic_quotaop.py +20 -0
- latitudesh_python_sdk/models/get_user_profileop.py +19 -0
- latitudesh_python_sdk/models/get_virtual_networkop.py +32 -0
- latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +40 -0
- latitudesh_python_sdk/models/get_virtual_networksop.py +40 -0
- latitudesh_python_sdk/models/get_vpn_sessionsop.py +70 -0
- latitudesh_python_sdk/models/index_virtual_machineop.py +22 -0
- latitudesh_python_sdk/models/ip_address.py +122 -0
- latitudesh_python_sdk/models/ip_addresses.py +15 -0
- latitudesh_python_sdk/models/ipmi_session.py +53 -0
- latitudesh_python_sdk/models/list_firewallsop.py +20 -0
- latitudesh_python_sdk/models/membership.py +63 -0
- latitudesh_python_sdk/models/operating_systems.py +57 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +88 -0
- latitudesh_python_sdk/models/patch_current_teamop.py +91 -0
- latitudesh_python_sdk/models/patch_storage_filesystemsop.py +79 -0
- latitudesh_python_sdk/models/patch_user_profileop.py +88 -0
- latitudesh_python_sdk/models/plan.py +15 -0
- latitudesh_python_sdk/models/plan_data.py +206 -0
- latitudesh_python_sdk/models/post_api_keyop.py +19 -0
- latitudesh_python_sdk/models/post_project_ssh_keyop.py +81 -0
- latitudesh_python_sdk/models/post_project_user_dataop.py +68 -0
- latitudesh_python_sdk/models/post_storage_filesystemsop.py +63 -0
- latitudesh_python_sdk/models/post_team_membersop.py +54 -0
- latitudesh_python_sdk/models/post_teamop.py +67 -0
- latitudesh_python_sdk/models/post_vpn_sessionop.py +63 -0
- latitudesh_python_sdk/models/project.py +130 -0
- latitudesh_python_sdk/models/project_include.py +72 -0
- latitudesh_python_sdk/models/projects.py +15 -0
- latitudesh_python_sdk/models/put_project_ssh_keyop.py +87 -0
- latitudesh_python_sdk/models/put_project_user_dataop.py +76 -0
- latitudesh_python_sdk/models/put_vpn_sessionop.py +16 -0
- latitudesh_python_sdk/models/region.py +50 -0
- latitudesh_python_sdk/models/region_resource_data.py +37 -0
- latitudesh_python_sdk/models/regions.py +50 -0
- latitudesh_python_sdk/models/role.py +15 -0
- latitudesh_python_sdk/models/role_data.py +35 -0
- latitudesh_python_sdk/models/security.py +25 -0
- latitudesh_python_sdk/models/server.py +54 -0
- latitudesh_python_sdk/models/server_action.py +52 -0
- latitudesh_python_sdk/models/server_data.py +219 -0
- latitudesh_python_sdk/models/server_exit_rescue_modeop.py +16 -0
- latitudesh_python_sdk/models/server_lockop.py +16 -0
- latitudesh_python_sdk/models/server_rescue.py +22 -0
- latitudesh_python_sdk/models/server_schedule_deletion.py +44 -0
- latitudesh_python_sdk/models/server_schedule_deletionop.py +16 -0
- latitudesh_python_sdk/models/server_start_rescue_modeop.py +16 -0
- latitudesh_python_sdk/models/server_unlockop.py +16 -0
- latitudesh_python_sdk/models/server_unschedule_deletionop.py +16 -0
- latitudesh_python_sdk/models/servers.py +26 -0
- latitudesh_python_sdk/models/show_virtual_machineop.py +16 -0
- latitudesh_python_sdk/models/ssh_key.py +15 -0
- latitudesh_python_sdk/models/ssh_key_data.py +55 -0
- latitudesh_python_sdk/models/storage_plan.py +36 -0
- latitudesh_python_sdk/models/storage_plans.py +15 -0
- latitudesh_python_sdk/models/team.py +74 -0
- latitudesh_python_sdk/models/team_include.py +43 -0
- latitudesh_python_sdk/models/team_members.py +51 -0
- latitudesh_python_sdk/models/teams.py +26 -0
- latitudesh_python_sdk/models/traffic.py +133 -0
- latitudesh_python_sdk/models/traffic_quota.py +106 -0
- latitudesh_python_sdk/models/update_api_key.py +48 -0
- latitudesh_python_sdk/models/update_api_keyop.py +41 -0
- latitudesh_python_sdk/models/update_firewallop.py +89 -0
- latitudesh_python_sdk/models/update_plans_bandwidthop.py +50 -0
- latitudesh_python_sdk/models/update_projectop.py +95 -0
- latitudesh_python_sdk/models/update_server_deploy_configop.py +122 -0
- latitudesh_python_sdk/models/update_serverop.py +69 -0
- latitudesh_python_sdk/models/update_tagop.py +74 -0
- latitudesh_python_sdk/models/update_virtual_networkop.py +67 -0
- latitudesh_python_sdk/models/user.py +59 -0
- latitudesh_python_sdk/models/user_data.py +15 -0
- latitudesh_python_sdk/models/user_data_properties.py +46 -0
- latitudesh_python_sdk/models/user_include.py +52 -0
- latitudesh_python_sdk/models/user_team.py +61 -0
- latitudesh_python_sdk/models/user_teams.py +26 -0
- latitudesh_python_sdk/models/user_update.py +37 -0
- latitudesh_python_sdk/models/virtual_machine.py +25 -0
- latitudesh_python_sdk/models/virtual_machine_payload.py +41 -0
- latitudesh_python_sdk/models/virtual_machine_plans.py +180 -0
- latitudesh_python_sdk/models/virtual_network.py +103 -0
- latitudesh_python_sdk/models/virtual_network1.py +84 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +37 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +29 -0
- latitudesh_python_sdk/models/virtual_networks.py +26 -0
- latitudesh_python_sdk/models/vpn_session_data_with_password.py +77 -0
- latitudesh_python_sdk/models/vpn_session_with_password.py +18 -0
- latitudesh_python_sdk/operatingsystems_sdk.py +188 -0
- latitudesh_python_sdk/plans.py +1178 -0
- latitudesh_python_sdk/privatenetworks.py +1672 -0
- latitudesh_python_sdk/projects_sdk.py +864 -0
- latitudesh_python_sdk/py.typed +1 -0
- latitudesh_python_sdk/regions_sdk.py +376 -0
- latitudesh_python_sdk/roles.py +374 -0
- latitudesh_python_sdk/sdk.py +214 -0
- latitudesh_python_sdk/sdkconfiguration.py +57 -0
- latitudesh_python_sdk/servers_sdk.py +3810 -0
- latitudesh_python_sdk/sshkeys.py +1050 -0
- latitudesh_python_sdk/storage.py +820 -0
- latitudesh_python_sdk/tags.py +786 -0
- latitudesh_python_sdk/teams_sdk.py +596 -0
- latitudesh_python_sdk/teamsmembers.py +578 -0
- latitudesh_python_sdk/traffic_sdk.py +400 -0
- latitudesh_python_sdk/types/__init__.py +21 -0
- latitudesh_python_sdk/types/basemodel.py +39 -0
- latitudesh_python_sdk/userdata_sdk.py +1052 -0
- latitudesh_python_sdk/userprofile.py +596 -0
- latitudesh_python_sdk/utils/__init__.py +101 -0
- latitudesh_python_sdk/utils/annotations.py +55 -0
- latitudesh_python_sdk/utils/enums.py +34 -0
- latitudesh_python_sdk/utils/eventstreaming.py +238 -0
- latitudesh_python_sdk/utils/forms.py +202 -0
- latitudesh_python_sdk/utils/headers.py +136 -0
- latitudesh_python_sdk/utils/logger.py +27 -0
- latitudesh_python_sdk/utils/metadata.py +118 -0
- latitudesh_python_sdk/utils/queryparams.py +205 -0
- latitudesh_python_sdk/utils/requestbodies.py +66 -0
- latitudesh_python_sdk/utils/retries.py +217 -0
- latitudesh_python_sdk/utils/security.py +192 -0
- latitudesh_python_sdk/utils/serializers.py +219 -0
- latitudesh_python_sdk/utils/url.py +155 -0
- latitudesh_python_sdk/utils/values.py +137 -0
- latitudesh_python_sdk/virtualmachines.py +772 -0
- latitudesh_python_sdk/vpnsessions.py +818 -0
- latitudesh_python_sdk-0.0.6.dist-info/LICENSE +21 -0
- latitudesh_python_sdk-0.0.6.dist-info/METADATA +730 -0
- latitudesh_python_sdk-0.0.6.dist-info/RECORD +206 -0
- latitudesh_python_sdk-0.0.6.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,578 @@
|
|
|
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 TeamsMembers(BaseSDK):
|
|
12
|
+
def list(
|
|
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.TeamMembers:
|
|
20
|
+
r"""List all Team Members
|
|
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/members",
|
|
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-members",
|
|
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.TeamMembers)
|
|
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 list_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.TeamMembers:
|
|
104
|
+
r"""List all Team Members
|
|
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/members",
|
|
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-members",
|
|
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.TeamMembers)
|
|
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 add(
|
|
181
|
+
self,
|
|
182
|
+
*,
|
|
183
|
+
data: Union[
|
|
184
|
+
models.PostTeamMembersTeamsMembersData,
|
|
185
|
+
models.PostTeamMembersTeamsMembersDataTypedDict,
|
|
186
|
+
],
|
|
187
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
188
|
+
server_url: Optional[str] = None,
|
|
189
|
+
timeout_ms: Optional[int] = None,
|
|
190
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
191
|
+
) -> models.Membership:
|
|
192
|
+
r"""Add a Team Member
|
|
193
|
+
|
|
194
|
+
:param data:
|
|
195
|
+
:param retries: Override the default retry configuration for this method
|
|
196
|
+
:param server_url: Override the default server URL for this method
|
|
197
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
198
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
199
|
+
"""
|
|
200
|
+
base_url = None
|
|
201
|
+
url_variables = None
|
|
202
|
+
if timeout_ms is None:
|
|
203
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
204
|
+
|
|
205
|
+
if server_url is not None:
|
|
206
|
+
base_url = server_url
|
|
207
|
+
else:
|
|
208
|
+
base_url = self._get_url(base_url, url_variables)
|
|
209
|
+
|
|
210
|
+
request = models.PostTeamMembersTeamsMembersRequestBody(
|
|
211
|
+
data=utils.get_pydantic_model(data, models.PostTeamMembersTeamsMembersData),
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
req = self._build_request(
|
|
215
|
+
method="POST",
|
|
216
|
+
path="/team/members",
|
|
217
|
+
base_url=base_url,
|
|
218
|
+
url_variables=url_variables,
|
|
219
|
+
request=request,
|
|
220
|
+
request_body_required=True,
|
|
221
|
+
request_has_path_params=False,
|
|
222
|
+
request_has_query_params=True,
|
|
223
|
+
user_agent_header="user-agent",
|
|
224
|
+
accept_header_value="application/vnd.api+json",
|
|
225
|
+
http_headers=http_headers,
|
|
226
|
+
security=self.sdk_configuration.security,
|
|
227
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
228
|
+
request,
|
|
229
|
+
False,
|
|
230
|
+
False,
|
|
231
|
+
"json",
|
|
232
|
+
models.PostTeamMembersTeamsMembersRequestBody,
|
|
233
|
+
),
|
|
234
|
+
timeout_ms=timeout_ms,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
if retries == UNSET:
|
|
238
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
239
|
+
retries = self.sdk_configuration.retry_config
|
|
240
|
+
|
|
241
|
+
retry_config = None
|
|
242
|
+
if isinstance(retries, utils.RetryConfig):
|
|
243
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
244
|
+
|
|
245
|
+
http_res = self.do_request(
|
|
246
|
+
hook_ctx=HookContext(
|
|
247
|
+
base_url=base_url or "",
|
|
248
|
+
operation_id="post-team-members",
|
|
249
|
+
oauth2_scopes=[],
|
|
250
|
+
security_source=get_security_from_env(
|
|
251
|
+
self.sdk_configuration.security, models.Security
|
|
252
|
+
),
|
|
253
|
+
),
|
|
254
|
+
request=req,
|
|
255
|
+
error_status_codes=["403", "422", "4XX", "5XX"],
|
|
256
|
+
retry_config=retry_config,
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
response_data: Any = None
|
|
260
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
261
|
+
return utils.unmarshal_json(http_res.text, models.Membership)
|
|
262
|
+
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
263
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
264
|
+
raise models.ErrorObject(data=response_data)
|
|
265
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
266
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
267
|
+
raise models.APIError(
|
|
268
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
269
|
+
)
|
|
270
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
271
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
272
|
+
raise models.APIError(
|
|
273
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
content_type = http_res.headers.get("Content-Type")
|
|
277
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
278
|
+
raise models.APIError(
|
|
279
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
280
|
+
http_res.status_code,
|
|
281
|
+
http_res_text,
|
|
282
|
+
http_res,
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
async def add_async(
|
|
286
|
+
self,
|
|
287
|
+
*,
|
|
288
|
+
data: Union[
|
|
289
|
+
models.PostTeamMembersTeamsMembersData,
|
|
290
|
+
models.PostTeamMembersTeamsMembersDataTypedDict,
|
|
291
|
+
],
|
|
292
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
293
|
+
server_url: Optional[str] = None,
|
|
294
|
+
timeout_ms: Optional[int] = None,
|
|
295
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
296
|
+
) -> models.Membership:
|
|
297
|
+
r"""Add a Team Member
|
|
298
|
+
|
|
299
|
+
:param data:
|
|
300
|
+
:param retries: Override the default retry configuration for this method
|
|
301
|
+
:param server_url: Override the default server URL for this method
|
|
302
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
303
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
304
|
+
"""
|
|
305
|
+
base_url = None
|
|
306
|
+
url_variables = None
|
|
307
|
+
if timeout_ms is None:
|
|
308
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
309
|
+
|
|
310
|
+
if server_url is not None:
|
|
311
|
+
base_url = server_url
|
|
312
|
+
else:
|
|
313
|
+
base_url = self._get_url(base_url, url_variables)
|
|
314
|
+
|
|
315
|
+
request = models.PostTeamMembersTeamsMembersRequestBody(
|
|
316
|
+
data=utils.get_pydantic_model(data, models.PostTeamMembersTeamsMembersData),
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
req = self._build_request_async(
|
|
320
|
+
method="POST",
|
|
321
|
+
path="/team/members",
|
|
322
|
+
base_url=base_url,
|
|
323
|
+
url_variables=url_variables,
|
|
324
|
+
request=request,
|
|
325
|
+
request_body_required=True,
|
|
326
|
+
request_has_path_params=False,
|
|
327
|
+
request_has_query_params=True,
|
|
328
|
+
user_agent_header="user-agent",
|
|
329
|
+
accept_header_value="application/vnd.api+json",
|
|
330
|
+
http_headers=http_headers,
|
|
331
|
+
security=self.sdk_configuration.security,
|
|
332
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
333
|
+
request,
|
|
334
|
+
False,
|
|
335
|
+
False,
|
|
336
|
+
"json",
|
|
337
|
+
models.PostTeamMembersTeamsMembersRequestBody,
|
|
338
|
+
),
|
|
339
|
+
timeout_ms=timeout_ms,
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
if retries == UNSET:
|
|
343
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
344
|
+
retries = self.sdk_configuration.retry_config
|
|
345
|
+
|
|
346
|
+
retry_config = None
|
|
347
|
+
if isinstance(retries, utils.RetryConfig):
|
|
348
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
349
|
+
|
|
350
|
+
http_res = await self.do_request_async(
|
|
351
|
+
hook_ctx=HookContext(
|
|
352
|
+
base_url=base_url or "",
|
|
353
|
+
operation_id="post-team-members",
|
|
354
|
+
oauth2_scopes=[],
|
|
355
|
+
security_source=get_security_from_env(
|
|
356
|
+
self.sdk_configuration.security, models.Security
|
|
357
|
+
),
|
|
358
|
+
),
|
|
359
|
+
request=req,
|
|
360
|
+
error_status_codes=["403", "422", "4XX", "5XX"],
|
|
361
|
+
retry_config=retry_config,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
response_data: Any = None
|
|
365
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
366
|
+
return utils.unmarshal_json(http_res.text, models.Membership)
|
|
367
|
+
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
368
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
369
|
+
raise models.ErrorObject(data=response_data)
|
|
370
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
371
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
372
|
+
raise models.APIError(
|
|
373
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
374
|
+
)
|
|
375
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
376
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
377
|
+
raise models.APIError(
|
|
378
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
content_type = http_res.headers.get("Content-Type")
|
|
382
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
383
|
+
raise models.APIError(
|
|
384
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
385
|
+
http_res.status_code,
|
|
386
|
+
http_res_text,
|
|
387
|
+
http_res,
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
def remove_member(
|
|
391
|
+
self,
|
|
392
|
+
*,
|
|
393
|
+
user_id: str,
|
|
394
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
395
|
+
server_url: Optional[str] = None,
|
|
396
|
+
timeout_ms: Optional[int] = None,
|
|
397
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
398
|
+
):
|
|
399
|
+
r"""Remove a Team Member
|
|
400
|
+
|
|
401
|
+
:param user_id: The user ID
|
|
402
|
+
:param retries: Override the default retry configuration for this method
|
|
403
|
+
:param server_url: Override the default server URL for this method
|
|
404
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
405
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
406
|
+
"""
|
|
407
|
+
base_url = None
|
|
408
|
+
url_variables = None
|
|
409
|
+
if timeout_ms is None:
|
|
410
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
411
|
+
|
|
412
|
+
if server_url is not None:
|
|
413
|
+
base_url = server_url
|
|
414
|
+
else:
|
|
415
|
+
base_url = self._get_url(base_url, url_variables)
|
|
416
|
+
|
|
417
|
+
request = models.DestroyTeamMemberRequest(
|
|
418
|
+
user_id=user_id,
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
req = self._build_request(
|
|
422
|
+
method="DELETE",
|
|
423
|
+
path="/team/members/{user_id}",
|
|
424
|
+
base_url=base_url,
|
|
425
|
+
url_variables=url_variables,
|
|
426
|
+
request=request,
|
|
427
|
+
request_body_required=False,
|
|
428
|
+
request_has_path_params=True,
|
|
429
|
+
request_has_query_params=True,
|
|
430
|
+
user_agent_header="user-agent",
|
|
431
|
+
accept_header_value="application/vnd.api+json",
|
|
432
|
+
http_headers=http_headers,
|
|
433
|
+
security=self.sdk_configuration.security,
|
|
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="destroy-team-member",
|
|
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", "*"):
|
|
461
|
+
return
|
|
462
|
+
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
463
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
464
|
+
raise models.ErrorObject(data=response_data)
|
|
465
|
+
if utils.match_response(http_res, ["403", "4XX"], "*"):
|
|
466
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
467
|
+
raise models.APIError(
|
|
468
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
469
|
+
)
|
|
470
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
471
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
472
|
+
raise models.APIError(
|
|
473
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
content_type = http_res.headers.get("Content-Type")
|
|
477
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
478
|
+
raise models.APIError(
|
|
479
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
480
|
+
http_res.status_code,
|
|
481
|
+
http_res_text,
|
|
482
|
+
http_res,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
async def remove_member_async(
|
|
486
|
+
self,
|
|
487
|
+
*,
|
|
488
|
+
user_id: str,
|
|
489
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
490
|
+
server_url: Optional[str] = None,
|
|
491
|
+
timeout_ms: Optional[int] = None,
|
|
492
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
493
|
+
):
|
|
494
|
+
r"""Remove a Team Member
|
|
495
|
+
|
|
496
|
+
:param user_id: The user ID
|
|
497
|
+
:param retries: Override the default retry configuration for this method
|
|
498
|
+
:param server_url: Override the default server URL for this method
|
|
499
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
500
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
501
|
+
"""
|
|
502
|
+
base_url = None
|
|
503
|
+
url_variables = None
|
|
504
|
+
if timeout_ms is None:
|
|
505
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
506
|
+
|
|
507
|
+
if server_url is not None:
|
|
508
|
+
base_url = server_url
|
|
509
|
+
else:
|
|
510
|
+
base_url = self._get_url(base_url, url_variables)
|
|
511
|
+
|
|
512
|
+
request = models.DestroyTeamMemberRequest(
|
|
513
|
+
user_id=user_id,
|
|
514
|
+
)
|
|
515
|
+
|
|
516
|
+
req = self._build_request_async(
|
|
517
|
+
method="DELETE",
|
|
518
|
+
path="/team/members/{user_id}",
|
|
519
|
+
base_url=base_url,
|
|
520
|
+
url_variables=url_variables,
|
|
521
|
+
request=request,
|
|
522
|
+
request_body_required=False,
|
|
523
|
+
request_has_path_params=True,
|
|
524
|
+
request_has_query_params=True,
|
|
525
|
+
user_agent_header="user-agent",
|
|
526
|
+
accept_header_value="application/vnd.api+json",
|
|
527
|
+
http_headers=http_headers,
|
|
528
|
+
security=self.sdk_configuration.security,
|
|
529
|
+
timeout_ms=timeout_ms,
|
|
530
|
+
)
|
|
531
|
+
|
|
532
|
+
if retries == UNSET:
|
|
533
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
534
|
+
retries = self.sdk_configuration.retry_config
|
|
535
|
+
|
|
536
|
+
retry_config = None
|
|
537
|
+
if isinstance(retries, utils.RetryConfig):
|
|
538
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
539
|
+
|
|
540
|
+
http_res = await self.do_request_async(
|
|
541
|
+
hook_ctx=HookContext(
|
|
542
|
+
base_url=base_url or "",
|
|
543
|
+
operation_id="destroy-team-member",
|
|
544
|
+
oauth2_scopes=[],
|
|
545
|
+
security_source=get_security_from_env(
|
|
546
|
+
self.sdk_configuration.security, models.Security
|
|
547
|
+
),
|
|
548
|
+
),
|
|
549
|
+
request=req,
|
|
550
|
+
error_status_codes=["403", "404", "4XX", "5XX"],
|
|
551
|
+
retry_config=retry_config,
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
response_data: Any = None
|
|
555
|
+
if utils.match_response(http_res, "200", "*"):
|
|
556
|
+
return
|
|
557
|
+
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
558
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
559
|
+
raise models.ErrorObject(data=response_data)
|
|
560
|
+
if utils.match_response(http_res, ["403", "4XX"], "*"):
|
|
561
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
562
|
+
raise models.APIError(
|
|
563
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
564
|
+
)
|
|
565
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
566
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
567
|
+
raise models.APIError(
|
|
568
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
content_type = http_res.headers.get("Content-Type")
|
|
572
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
573
|
+
raise models.APIError(
|
|
574
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
575
|
+
http_res.status_code,
|
|
576
|
+
http_res_text,
|
|
577
|
+
http_res,
|
|
578
|
+
)
|