unitysvc-py 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unitysvc_py/__init__.py +68 -0
- unitysvc_py/_generated/__init__.py +8 -0
- unitysvc_py/_generated/api/__init__.py +1 -0
- unitysvc_py/_generated/api/customer_aliases/__init__.py +1 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_create_alias.py +241 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_delete_alias.py +221 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_get_alias.py +217 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_list_aliases.py +273 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_set_alias_routing.py +237 -0
- unitysvc_py/_generated/api/customer_aliases/customer_aliases_update_alias.py +251 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/__init__.py +1 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_create_recurrent_request.py +241 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_get_recurrent_request_detail.py +225 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_list_recurrent_requests.py +315 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_remove_recurrent_request.py +221 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_trigger_recurrent_request.py +237 -0
- unitysvc_py/_generated/api/customer_recurrent_requests/customer_recurrent_requests_update_recurrent_request.py +255 -0
- unitysvc_py/_generated/api/customer_secrets/__init__.py +1 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_check_secret_exists.py +236 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_create_secret.py +261 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_delete_secret.py +241 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_get_secret.py +233 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_list_secrets.py +254 -0
- unitysvc_py/_generated/api/customer_secrets/customer_secrets_update_secret.py +259 -0
- unitysvc_py/_generated/client.py +263 -0
- unitysvc_py/_generated/errors.py +14 -0
- unitysvc_py/_generated/models/__init__.py +59 -0
- unitysvc_py/_generated/models/http_validation_error.py +94 -0
- unitysvc_py/_generated/models/message.py +71 -0
- unitysvc_py/_generated/models/recurrent_request_create.py +242 -0
- unitysvc_py/_generated/models/recurrent_request_create_body_template_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_create_request_headers_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_public.py +337 -0
- unitysvc_py/_generated/models/recurrent_request_public_body_template_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_public_schedule_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_public_state_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_status_enum.py +10 -0
- unitysvc_py/_generated/models/recurrent_request_update.py +250 -0
- unitysvc_py/_generated/models/recurrent_request_update_body_template_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_update_request_headers_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_request_update_schedule_type_0.py +62 -0
- unitysvc_py/_generated/models/recurrent_requests_public.py +98 -0
- unitysvc_py/_generated/models/secret_create.py +82 -0
- unitysvc_py/_generated/models/secret_exists_response.py +80 -0
- unitysvc_py/_generated/models/secret_owner_type_enum.py +10 -0
- unitysvc_py/_generated/models/secret_public.py +176 -0
- unitysvc_py/_generated/models/secret_update.py +74 -0
- unitysvc_py/_generated/models/secrets_public.py +98 -0
- unitysvc_py/_generated/models/service_alias_create.py +173 -0
- unitysvc_py/_generated/models/service_alias_create_routing_key_override_type_0.py +62 -0
- unitysvc_py/_generated/models/service_alias_update.py +207 -0
- unitysvc_py/_generated/models/service_alias_update_request_routing_key_type_0.py +62 -0
- unitysvc_py/_generated/models/service_alias_update_routing_key_override_type_0.py +62 -0
- unitysvc_py/_generated/models/validation_error.py +102 -0
- unitysvc_py/_generated/types.py +53 -0
- unitysvc_py/_http.py +57 -0
- unitysvc_py/aclient.py +152 -0
- unitysvc_py/cli.py +87 -0
- unitysvc_py/client.py +186 -0
- unitysvc_py/commands/__init__.py +5 -0
- unitysvc_py/commands/_helpers.py +104 -0
- unitysvc_py/commands/aliases.py +109 -0
- unitysvc_py/commands/recurrent_requests.py +127 -0
- unitysvc_py/commands/secrets.py +159 -0
- unitysvc_py/exceptions.py +120 -0
- unitysvc_py/py.typed +0 -0
- unitysvc_py/resources/__init__.py +8 -0
- unitysvc_py/resources/aaliases.py +104 -0
- unitysvc_py/resources/aliases.py +128 -0
- unitysvc_py/resources/arecurrent_requests.py +131 -0
- unitysvc_py/resources/asecrets.py +103 -0
- unitysvc_py/resources/recurrent_requests.py +150 -0
- unitysvc_py/resources/secrets.py +122 -0
- unitysvc_py-0.1.0.dist-info/METADATA +200 -0
- unitysvc_py-0.1.0.dist-info/RECORD +79 -0
- unitysvc_py-0.1.0.dist-info/WHEEL +5 -0
- unitysvc_py-0.1.0.dist-info/entry_points.txt +2 -0
- unitysvc_py-0.1.0.dist-info/licenses/LICENSE +21 -0
- unitysvc_py-0.1.0.dist-info/top_level.txt +1 -0
unitysvc_py/__init__.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""UnitySVC Python SDK — customer-facing tools for UnitySVC.
|
|
2
|
+
|
|
3
|
+
This package provides:
|
|
4
|
+
|
|
5
|
+
- The :class:`Client` / :class:`AsyncClient` HTTP SDK targeting the
|
|
6
|
+
customer-tagged ``/v1/customer/*`` endpoints (aliases, recurrent
|
|
7
|
+
requests, secrets).
|
|
8
|
+
- The ``usvc`` CLI for managing the same resources from the terminal.
|
|
9
|
+
|
|
10
|
+
Quick start::
|
|
11
|
+
|
|
12
|
+
from unitysvc_py import Client
|
|
13
|
+
|
|
14
|
+
client = Client(api_key="svcpass_...")
|
|
15
|
+
secrets = client.secrets.list()
|
|
16
|
+
|
|
17
|
+
The customer context is encoded entirely in the API key, so no
|
|
18
|
+
separate ``customer_id`` is required. The default base URL points at
|
|
19
|
+
the staging environment; override with the ``base_url`` constructor
|
|
20
|
+
argument or the ``UNITYSVC_API_URL`` env var.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from .aclient import AsyncClient
|
|
24
|
+
from .client import (
|
|
25
|
+
DEFAULT_API_URL,
|
|
26
|
+
ENV_API_BASE_URL,
|
|
27
|
+
ENV_API_KEY,
|
|
28
|
+
ENV_API_URL,
|
|
29
|
+
ENV_S3_BASE_URL,
|
|
30
|
+
ENV_SMTP_BASE_URL,
|
|
31
|
+
Client,
|
|
32
|
+
)
|
|
33
|
+
from .exceptions import (
|
|
34
|
+
APIError,
|
|
35
|
+
AuthenticationError,
|
|
36
|
+
ConflictError,
|
|
37
|
+
NotFoundError,
|
|
38
|
+
PermissionError,
|
|
39
|
+
RateLimitError,
|
|
40
|
+
ServerError,
|
|
41
|
+
UnitysvcSDKError,
|
|
42
|
+
ValidationError,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
__author__ = """Bo Peng"""
|
|
46
|
+
__email__ = "bo.peng@unitysvc.com"
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
# Client
|
|
50
|
+
"Client",
|
|
51
|
+
"AsyncClient",
|
|
52
|
+
"DEFAULT_API_URL",
|
|
53
|
+
"ENV_API_KEY",
|
|
54
|
+
"ENV_API_URL",
|
|
55
|
+
"ENV_API_BASE_URL",
|
|
56
|
+
"ENV_S3_BASE_URL",
|
|
57
|
+
"ENV_SMTP_BASE_URL",
|
|
58
|
+
# Exceptions
|
|
59
|
+
"UnitysvcSDKError",
|
|
60
|
+
"APIError",
|
|
61
|
+
"AuthenticationError",
|
|
62
|
+
"PermissionError",
|
|
63
|
+
"NotFoundError",
|
|
64
|
+
"ValidationError",
|
|
65
|
+
"ConflictError",
|
|
66
|
+
"RateLimitError",
|
|
67
|
+
"ServerError",
|
|
68
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains methods for accessing the API """
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.service_alias_create import ServiceAliasCreate
|
|
12
|
+
from ...types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
from typing import cast, Union
|
|
15
|
+
from typing import Union
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
*,
|
|
21
|
+
body: ServiceAliasCreate,
|
|
22
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
23
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
24
|
+
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
headers: dict[str, Any] = {}
|
|
27
|
+
if not isinstance(authorization, Unset):
|
|
28
|
+
headers["authorization"] = authorization
|
|
29
|
+
|
|
30
|
+
if not isinstance(x_role_id, Unset):
|
|
31
|
+
headers["x-role-id"] = x_role_id
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
_kwargs: dict[str, Any] = {
|
|
40
|
+
"method": "post",
|
|
41
|
+
"url": "/aliases/",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_kwargs["json"] = body.to_dict()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
headers["Content-Type"] = "application/json"
|
|
48
|
+
|
|
49
|
+
_kwargs["headers"] = headers
|
|
50
|
+
return _kwargs
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[HTTPValidationError]:
|
|
55
|
+
if response.status_code == 422:
|
|
56
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
return response_422
|
|
61
|
+
|
|
62
|
+
if client.raise_on_unexpected_status:
|
|
63
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
64
|
+
else:
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[HTTPValidationError]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
*,
|
|
79
|
+
client: Union[AuthenticatedClient, Client],
|
|
80
|
+
body: ServiceAliasCreate,
|
|
81
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
82
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
83
|
+
|
|
84
|
+
) -> Response[HTTPValidationError]:
|
|
85
|
+
""" Create Alias
|
|
86
|
+
|
|
87
|
+
Create a new URL alias for the current customer.
|
|
88
|
+
|
|
89
|
+
If ``is_routing`` is True (the default) and another alias is already
|
|
90
|
+
routing the same (name, request_routing_key), this one is created as
|
|
91
|
+
non-routing instead. Users can later switch routing via the
|
|
92
|
+
``/aliases/{id}/route`` endpoint.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
authorization (Union[None, Unset, str]):
|
|
96
|
+
x_role_id (Union[None, Unset, str]):
|
|
97
|
+
body (ServiceAliasCreate): Schema for creating a ServiceAlias.
|
|
98
|
+
|
|
99
|
+
Raises:
|
|
100
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
101
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
Response[HTTPValidationError]
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
kwargs = _get_kwargs(
|
|
109
|
+
body=body,
|
|
110
|
+
authorization=authorization,
|
|
111
|
+
x_role_id=x_role_id,
|
|
112
|
+
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
response = client.get_httpx_client().request(
|
|
116
|
+
**kwargs,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return _build_response(client=client, response=response)
|
|
120
|
+
|
|
121
|
+
def sync(
|
|
122
|
+
*,
|
|
123
|
+
client: Union[AuthenticatedClient, Client],
|
|
124
|
+
body: ServiceAliasCreate,
|
|
125
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
126
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
127
|
+
|
|
128
|
+
) -> Optional[HTTPValidationError]:
|
|
129
|
+
""" Create Alias
|
|
130
|
+
|
|
131
|
+
Create a new URL alias for the current customer.
|
|
132
|
+
|
|
133
|
+
If ``is_routing`` is True (the default) and another alias is already
|
|
134
|
+
routing the same (name, request_routing_key), this one is created as
|
|
135
|
+
non-routing instead. Users can later switch routing via the
|
|
136
|
+
``/aliases/{id}/route`` endpoint.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
authorization (Union[None, Unset, str]):
|
|
140
|
+
x_role_id (Union[None, Unset, str]):
|
|
141
|
+
body (ServiceAliasCreate): Schema for creating a ServiceAlias.
|
|
142
|
+
|
|
143
|
+
Raises:
|
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
HTTPValidationError
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
return sync_detailed(
|
|
153
|
+
client=client,
|
|
154
|
+
body=body,
|
|
155
|
+
authorization=authorization,
|
|
156
|
+
x_role_id=x_role_id,
|
|
157
|
+
|
|
158
|
+
).parsed
|
|
159
|
+
|
|
160
|
+
async def asyncio_detailed(
|
|
161
|
+
*,
|
|
162
|
+
client: Union[AuthenticatedClient, Client],
|
|
163
|
+
body: ServiceAliasCreate,
|
|
164
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
165
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
166
|
+
|
|
167
|
+
) -> Response[HTTPValidationError]:
|
|
168
|
+
""" Create Alias
|
|
169
|
+
|
|
170
|
+
Create a new URL alias for the current customer.
|
|
171
|
+
|
|
172
|
+
If ``is_routing`` is True (the default) and another alias is already
|
|
173
|
+
routing the same (name, request_routing_key), this one is created as
|
|
174
|
+
non-routing instead. Users can later switch routing via the
|
|
175
|
+
``/aliases/{id}/route`` endpoint.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
authorization (Union[None, Unset, str]):
|
|
179
|
+
x_role_id (Union[None, Unset, str]):
|
|
180
|
+
body (ServiceAliasCreate): Schema for creating a ServiceAlias.
|
|
181
|
+
|
|
182
|
+
Raises:
|
|
183
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
184
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
Response[HTTPValidationError]
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
kwargs = _get_kwargs(
|
|
192
|
+
body=body,
|
|
193
|
+
authorization=authorization,
|
|
194
|
+
x_role_id=x_role_id,
|
|
195
|
+
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
response = await client.get_async_httpx_client().request(
|
|
199
|
+
**kwargs
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
return _build_response(client=client, response=response)
|
|
203
|
+
|
|
204
|
+
async def asyncio(
|
|
205
|
+
*,
|
|
206
|
+
client: Union[AuthenticatedClient, Client],
|
|
207
|
+
body: ServiceAliasCreate,
|
|
208
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
209
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
210
|
+
|
|
211
|
+
) -> Optional[HTTPValidationError]:
|
|
212
|
+
""" Create Alias
|
|
213
|
+
|
|
214
|
+
Create a new URL alias for the current customer.
|
|
215
|
+
|
|
216
|
+
If ``is_routing`` is True (the default) and another alias is already
|
|
217
|
+
routing the same (name, request_routing_key), this one is created as
|
|
218
|
+
non-routing instead. Users can later switch routing via the
|
|
219
|
+
``/aliases/{id}/route`` endpoint.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
authorization (Union[None, Unset, str]):
|
|
223
|
+
x_role_id (Union[None, Unset, str]):
|
|
224
|
+
body (ServiceAliasCreate): Schema for creating a ServiceAlias.
|
|
225
|
+
|
|
226
|
+
Raises:
|
|
227
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
228
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
HTTPValidationError
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
return (await asyncio_detailed(
|
|
236
|
+
client=client,
|
|
237
|
+
body=body,
|
|
238
|
+
authorization=authorization,
|
|
239
|
+
x_role_id=x_role_id,
|
|
240
|
+
|
|
241
|
+
)).parsed
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ...client import AuthenticatedClient, Client
|
|
7
|
+
from ...types import Response, UNSET
|
|
8
|
+
from ... import errors
|
|
9
|
+
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...types import UNSET, Unset
|
|
12
|
+
from typing import cast
|
|
13
|
+
from typing import cast, Union
|
|
14
|
+
from typing import Union
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
alias_id: UUID,
|
|
21
|
+
*,
|
|
22
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
23
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
24
|
+
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
headers: dict[str, Any] = {}
|
|
27
|
+
if not isinstance(authorization, Unset):
|
|
28
|
+
headers["authorization"] = authorization
|
|
29
|
+
|
|
30
|
+
if not isinstance(x_role_id, Unset):
|
|
31
|
+
headers["x-role-id"] = x_role_id
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
_kwargs: dict[str, Any] = {
|
|
40
|
+
"method": "delete",
|
|
41
|
+
"url": "/aliases/{alias_id}".format(alias_id=alias_id,),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_kwargs["headers"] = headers
|
|
46
|
+
return _kwargs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
|
|
51
|
+
if response.status_code == 200:
|
|
52
|
+
response_200 = response.json()
|
|
53
|
+
return response_200
|
|
54
|
+
|
|
55
|
+
if response.status_code == 422:
|
|
56
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
return response_422
|
|
61
|
+
|
|
62
|
+
if client.raise_on_unexpected_status:
|
|
63
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
64
|
+
else:
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
alias_id: UUID,
|
|
79
|
+
*,
|
|
80
|
+
client: Union[AuthenticatedClient, Client],
|
|
81
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
82
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
83
|
+
|
|
84
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
85
|
+
""" Delete Alias
|
|
86
|
+
|
|
87
|
+
Deactivate an alias (sets deactivated_at for billing proration).
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
alias_id (UUID):
|
|
91
|
+
authorization (Union[None, Unset, str]):
|
|
92
|
+
x_role_id (Union[None, Unset, str]):
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
96
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Response[Union[Any, HTTPValidationError]]
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
kwargs = _get_kwargs(
|
|
104
|
+
alias_id=alias_id,
|
|
105
|
+
authorization=authorization,
|
|
106
|
+
x_role_id=x_role_id,
|
|
107
|
+
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = client.get_httpx_client().request(
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
def sync(
|
|
117
|
+
alias_id: UUID,
|
|
118
|
+
*,
|
|
119
|
+
client: Union[AuthenticatedClient, Client],
|
|
120
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
121
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
122
|
+
|
|
123
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
124
|
+
""" Delete Alias
|
|
125
|
+
|
|
126
|
+
Deactivate an alias (sets deactivated_at for billing proration).
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
alias_id (UUID):
|
|
130
|
+
authorization (Union[None, Unset, str]):
|
|
131
|
+
x_role_id (Union[None, Unset, str]):
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
135
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Union[Any, HTTPValidationError]
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
return sync_detailed(
|
|
143
|
+
alias_id=alias_id,
|
|
144
|
+
client=client,
|
|
145
|
+
authorization=authorization,
|
|
146
|
+
x_role_id=x_role_id,
|
|
147
|
+
|
|
148
|
+
).parsed
|
|
149
|
+
|
|
150
|
+
async def asyncio_detailed(
|
|
151
|
+
alias_id: UUID,
|
|
152
|
+
*,
|
|
153
|
+
client: Union[AuthenticatedClient, Client],
|
|
154
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
155
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
156
|
+
|
|
157
|
+
) -> Response[Union[Any, HTTPValidationError]]:
|
|
158
|
+
""" Delete Alias
|
|
159
|
+
|
|
160
|
+
Deactivate an alias (sets deactivated_at for billing proration).
|
|
161
|
+
|
|
162
|
+
Args:
|
|
163
|
+
alias_id (UUID):
|
|
164
|
+
authorization (Union[None, Unset, str]):
|
|
165
|
+
x_role_id (Union[None, Unset, str]):
|
|
166
|
+
|
|
167
|
+
Raises:
|
|
168
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
169
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
Response[Union[Any, HTTPValidationError]]
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
kwargs = _get_kwargs(
|
|
177
|
+
alias_id=alias_id,
|
|
178
|
+
authorization=authorization,
|
|
179
|
+
x_role_id=x_role_id,
|
|
180
|
+
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
response = await client.get_async_httpx_client().request(
|
|
184
|
+
**kwargs
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
return _build_response(client=client, response=response)
|
|
188
|
+
|
|
189
|
+
async def asyncio(
|
|
190
|
+
alias_id: UUID,
|
|
191
|
+
*,
|
|
192
|
+
client: Union[AuthenticatedClient, Client],
|
|
193
|
+
authorization: Union[None, Unset, str] = UNSET,
|
|
194
|
+
x_role_id: Union[None, Unset, str] = UNSET,
|
|
195
|
+
|
|
196
|
+
) -> Optional[Union[Any, HTTPValidationError]]:
|
|
197
|
+
""" Delete Alias
|
|
198
|
+
|
|
199
|
+
Deactivate an alias (sets deactivated_at for billing proration).
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
alias_id (UUID):
|
|
203
|
+
authorization (Union[None, Unset, str]):
|
|
204
|
+
x_role_id (Union[None, Unset, str]):
|
|
205
|
+
|
|
206
|
+
Raises:
|
|
207
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
208
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
Union[Any, HTTPValidationError]
|
|
212
|
+
"""
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
return (await asyncio_detailed(
|
|
216
|
+
alias_id=alias_id,
|
|
217
|
+
client=client,
|
|
218
|
+
authorization=authorization,
|
|
219
|
+
x_role_id=x_role_id,
|
|
220
|
+
|
|
221
|
+
)).parsed
|