docket-client 0.3.2__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.
- docket/__init__.py +8 -0
- docket/api/__init__.py +1 -0
- docket/api/access/__init__.py +1 -0
- docket/api/access/add_principal.py +193 -0
- docket/api/access/archive_role_assignment.py +182 -0
- docket/api/access/create_api_token.py +198 -0
- docket/api/access/create_application_principal.py +188 -0
- docket/api/access/create_role_assignment.py +194 -0
- docket/api/access/list_api_tokens.py +184 -0
- docket/api/access/list_principals.py +184 -0
- docket/api/access/list_role_assignments.py +200 -0
- docket/api/access/revoke_api_token.py +173 -0
- docket/api/identity/__init__.py +1 -0
- docket/api/identity/create_my_api_token.py +206 -0
- docket/api/identity/get_me.py +127 -0
- docket/api/identity/list_my_api_tokens.py +151 -0
- docket/api/identity/revoke_my_api_token.py +178 -0
- docket/api/recurring_acquisitions/__init__.py +1 -0
- docket/api/recurring_acquisitions/archive_recurring_acquisition.py +207 -0
- docket/api/recurring_acquisitions/create_recurring_acquisition.py +218 -0
- docket/api/recurring_acquisitions/get_recurring_acquisition.py +163 -0
- docket/api/recurring_acquisitions/list_recurring_acquisitions.py +248 -0
- docket/api/recurring_acquisitions/preview_recurring_acquisition.py +187 -0
- docket/api/recurring_acquisitions/preview_split_recurring_acquisition.py +232 -0
- docket/api/recurring_acquisitions/split_recurring_acquisition.py +258 -0
- docket/api/runs/__init__.py +1 -0
- docket/api/runs/get_run.py +160 -0
- docket/api/runs/list_runs.py +180 -0
- docket/api/runs/report_run_outcome.py +206 -0
- docket/api/scheduled_acquisitions/__init__.py +1 -0
- docket/api/scheduled_acquisitions/archive_scheduled_acquisition.py +203 -0
- docket/api/scheduled_acquisitions/create_scheduled_acquisition.py +185 -0
- docket/api/scheduled_acquisitions/get_resolved_settings.py +169 -0
- docket/api/scheduled_acquisitions/get_scheduled_acquisition.py +159 -0
- docket/api/scheduled_acquisitions/list_active_acquisitions.py +297 -0
- docket/api/scheduled_acquisitions/list_runs_for_scheduled_acquisition.py +191 -0
- docket/api/scheduled_acquisitions/list_scheduled_acquisitions.py +332 -0
- docket/api/scheduled_acquisitions/preview_scheduled_acquisition_edit.py +224 -0
- docket/api/scheduled_acquisitions/set_planning_status.py +199 -0
- docket/api/scheduled_acquisitions/start_run.py +221 -0
- docket/api/scheduled_acquisitions/update_scheduled_acquisition.py +226 -0
- docket/api/settings/__init__.py +1 -0
- docket/api/settings/list_behavior_curriculum_discriminator_values.py +188 -0
- docket/api/settings/list_behavior_curriculum_settings.py +199 -0
- docket/api/settings/list_fip_discriminator_values.py +184 -0
- docket/api/settings/list_fip_settings.py +195 -0
- docket/api/settings/list_live_behavior_curriculum_settings.py +233 -0
- docket/api/settings/list_live_fip_settings.py +225 -0
- docket/api/settings/preview_behavior_curriculum_settings.py +191 -0
- docket/api/settings/preview_fip_settings.py +177 -0
- docket/api/settings/push_behavior_curriculum_settings.py +222 -0
- docket/api/settings/push_fip_settings.py +206 -0
- docket/api/templates/__init__.py +1 -0
- docket/api/templates/archive_template.py +203 -0
- docket/api/templates/create_template.py +206 -0
- docket/api/templates/get_template.py +159 -0
- docket/api/templates/list_templates.py +174 -0
- docket/api/templates/update_template.py +234 -0
- docket/api/vocabulary/__init__.py +1 -0
- docket/api/vocabulary/list_instruments.py +165 -0
- docket/api/vocabulary/list_persons.py +132 -0
- docket/api/vocabulary/list_projects.py +132 -0
- docket/api/vocabulary/list_subjects.py +132 -0
- docket/api/vocabulary/lookup_person.py +166 -0
- docket/api/vocabulary/lookup_subject.py +166 -0
- docket/api/vocabulary/sync_vocabulary.py +148 -0
- docket/client.py +272 -0
- docket/errors.py +16 -0
- docket/models/__init__.py +221 -0
- docket/models/access_role.py +12 -0
- docket/models/access_role_nullable_type_1.py +12 -0
- docket/models/access_role_nullable_type_2_type_1.py +12 -0
- docket/models/access_role_nullable_type_3_type_1.py +12 -0
- docket/models/acquisition_variable.py +72 -0
- docket/models/acquisition_warning.py +126 -0
- docket/models/add_principal_request.py +83 -0
- docket/models/api_token_response.py +271 -0
- docket/models/api_token_status.py +10 -0
- docket/models/archive_recurring_acquisition_request.py +77 -0
- docket/models/archive_recurring_acquisition_response.py +83 -0
- docket/models/archive_scheduled_acquisition_request.py +78 -0
- docket/models/archive_template_request.py +66 -0
- docket/models/auth_mode.py +10 -0
- docket/models/behavior_curriculum_push_settings_request.py +85 -0
- docket/models/behavior_curriculum_settings.py +55 -0
- docket/models/behavior_curriculum_settings_preview_response.py +102 -0
- docket/models/behavior_curriculum_settings_preview_response_promoted.py +50 -0
- docket/models/behavior_curriculum_settings_version_response.py +160 -0
- docket/models/behavior_curriculum_settings_version_response_promoted.py +50 -0
- docket/models/caller_kind.py +11 -0
- docket/models/create_api_token_request.py +97 -0
- docket/models/create_application_principal_request.py +65 -0
- docket/models/create_personal_api_token_request.py +167 -0
- docket/models/create_recurring_acquisition_request.py +269 -0
- docket/models/create_role_assignment_request.py +99 -0
- docket/models/create_scheduled_acquisition_request.py +265 -0
- docket/models/create_template_request.py +323 -0
- docket/models/created_api_token_response.py +82 -0
- docket/models/effective_status.py +15 -0
- docket/models/fip_color.py +13 -0
- docket/models/fip_fiber.py +93 -0
- docket/models/fip_mode.py +9 -0
- docket/models/fip_push_settings_request.py +82 -0
- docket/models/fip_settings.py +91 -0
- docket/models/fip_settings_preview_response.py +97 -0
- docket/models/fip_settings_preview_response_promoted.py +50 -0
- docket/models/fip_settings_version_response.py +155 -0
- docket/models/fip_settings_version_response_promoted.py +50 -0
- docket/models/future_occurrences.py +9 -0
- docket/models/get_resolved_settings_response_200.py +65 -0
- docket/models/held_role_response.py +116 -0
- docket/models/http_validation_problem_details.py +204 -0
- docket/models/http_validation_problem_details_errors.py +59 -0
- docket/models/instrument_response.py +91 -0
- docket/models/kept_occurrence.py +85 -0
- docket/models/kept_occurrence_reason.py +10 -0
- docket/models/list_active_acquisitions_effective_status_item.py +15 -0
- docket/models/list_scheduled_acquisitions_planning_status.py +11 -0
- docket/models/me_caller.py +118 -0
- docket/models/me_permission.py +98 -0
- docket/models/me_response.py +158 -0
- docket/models/me_role.py +75 -0
- docket/models/occurrence_preview.py +121 -0
- docket/models/occurrence_summary.py +126 -0
- docket/models/occurrence_warnings.py +91 -0
- docket/models/permission_action.py +12 -0
- docket/models/person_assignment.py +74 -0
- docket/models/person_lookup_response.py +131 -0
- docket/models/person_response.py +103 -0
- docket/models/person_role.py +9 -0
- docket/models/personal_token_limits.py +92 -0
- docket/models/planning_status.py +11 -0
- docket/models/principal_kind.py +9 -0
- docket/models/principal_response.py +216 -0
- docket/models/problem_details.py +177 -0
- docket/models/project_response.py +75 -0
- docket/models/recurrence_exception_kind.py +13 -0
- docket/models/recurrence_exception_response.py +103 -0
- docket/models/recurrence_frequency.py +9 -0
- docket/models/recurrence_preview_response.py +101 -0
- docket/models/recurrence_rule.py +207 -0
- docket/models/recurring_acquisition_created_response.py +123 -0
- docket/models/recurring_acquisition_detail_response.py +105 -0
- docket/models/recurring_acquisition_response.py +326 -0
- docket/models/report_run_outcome_request.py +89 -0
- docket/models/resolution_mode.py +10 -0
- docket/models/resolved_settings.py +73 -0
- docket/models/role_assignment_response.py +157 -0
- docket/models/role_origin.py +10 -0
- docket/models/role_source_kind.py +10 -0
- docket/models/run_origin.py +9 -0
- docket/models/run_outcome.py +9 -0
- docket/models/run_response.py +181 -0
- docket/models/run_settings_snapshot.py +72 -0
- docket/models/run_start_response.py +91 -0
- docket/models/run_start_response_settings.py +65 -0
- docket/models/run_status.py +11 -0
- docket/models/scheduled_acquisition_edit_preview_response.py +150 -0
- docket/models/scheduled_acquisition_response.py +366 -0
- docket/models/set_planning_status_request.py +90 -0
- docket/models/settings_selector.py +138 -0
- docket/models/skipped_occurrence.py +85 -0
- docket/models/split_preview_response.py +129 -0
- docket/models/split_recurring_acquisition_request.py +261 -0
- docket/models/split_recurring_acquisition_response.py +159 -0
- docket/models/start_run_request.py +73 -0
- docket/models/subject_lookup_response.py +149 -0
- docket/models/subject_response.py +128 -0
- docket/models/sync_counts.py +80 -0
- docket/models/sync_response.py +81 -0
- docket/models/template_response.py +302 -0
- docket/models/update_scheduled_acquisition_request.py +235 -0
- docket/models/update_template_request.py +279 -0
- docket/models/weekday.py +14 -0
- docket/types.py +54 -0
- docket_auth/__init__.py +239 -0
- docket_client-0.3.2.dist-info/METADATA +233 -0
- docket_client-0.3.2.dist-info/RECORD +188 -0
- docket_client-0.3.2.dist-info/WHEEL +4 -0
- docket_client-0.3.2.dist-info/entry_points.txt +2 -0
- docket_mcp/__init__.py +6 -0
- docket_mcp/api.py +207 -0
- docket_mcp/config.py +57 -0
- docket_mcp/server.py +78 -0
- docket_mcp/signin.py +155 -0
- docket_mcp/slots.py +80 -0
- docket_mcp/times.py +160 -0
- docket_mcp/tools.py +1202 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.behavior_curriculum_push_settings_request import (
|
|
12
|
+
BehaviorCurriculumPushSettingsRequest,
|
|
13
|
+
)
|
|
14
|
+
from ...models.behavior_curriculum_settings_version_response import (
|
|
15
|
+
BehaviorCurriculumSettingsVersionResponse,
|
|
16
|
+
)
|
|
17
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
18
|
+
from ...models.problem_details import ProblemDetails
|
|
19
|
+
from ...types import UNSET, Unset
|
|
20
|
+
from typing import cast
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _get_kwargs(
|
|
24
|
+
*,
|
|
25
|
+
body: BehaviorCurriculumPushSettingsRequest,
|
|
26
|
+
idempotency_key: str | Unset = UNSET,
|
|
27
|
+
) -> dict[str, Any]:
|
|
28
|
+
headers: dict[str, Any] = {}
|
|
29
|
+
if not isinstance(idempotency_key, Unset):
|
|
30
|
+
headers["Idempotency-Key"] = idempotency_key
|
|
31
|
+
|
|
32
|
+
_kwargs: dict[str, Any] = {
|
|
33
|
+
"method": "post",
|
|
34
|
+
"url": "/api/v1/settings/behavior-curriculum",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_kwargs["json"] = body.to_dict()
|
|
38
|
+
|
|
39
|
+
headers["Content-Type"] = "application/json"
|
|
40
|
+
|
|
41
|
+
_kwargs["headers"] = headers
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _parse_response(
|
|
46
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
47
|
+
) -> (
|
|
48
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None
|
|
49
|
+
):
|
|
50
|
+
if response.status_code == 201:
|
|
51
|
+
response_201 = BehaviorCurriculumSettingsVersionResponse.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_201
|
|
54
|
+
|
|
55
|
+
if response.status_code == 401:
|
|
56
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
return response_401
|
|
59
|
+
|
|
60
|
+
if response.status_code == 403:
|
|
61
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
62
|
+
|
|
63
|
+
return response_403
|
|
64
|
+
|
|
65
|
+
if response.status_code == 409:
|
|
66
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
67
|
+
|
|
68
|
+
return response_409
|
|
69
|
+
|
|
70
|
+
if response.status_code == 422:
|
|
71
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
72
|
+
|
|
73
|
+
return response_422
|
|
74
|
+
|
|
75
|
+
if response.status_code == 503:
|
|
76
|
+
response_503 = ProblemDetails.from_dict(response.json())
|
|
77
|
+
|
|
78
|
+
return response_503
|
|
79
|
+
|
|
80
|
+
if client.raise_on_unexpected_status:
|
|
81
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
82
|
+
else:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _build_response(
|
|
87
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
88
|
+
) -> Response[
|
|
89
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
90
|
+
]:
|
|
91
|
+
return Response(
|
|
92
|
+
status_code=HTTPStatus(response.status_code),
|
|
93
|
+
content=response.content,
|
|
94
|
+
headers=response.headers,
|
|
95
|
+
parsed=_parse_response(client=client, response=response),
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync_detailed(
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient,
|
|
102
|
+
body: BehaviorCurriculumPushSettingsRequest,
|
|
103
|
+
idempotency_key: str | Unset = UNSET,
|
|
104
|
+
) -> Response[
|
|
105
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
106
|
+
]:
|
|
107
|
+
"""Push a new behavior_curriculum settings version; supersedes the live version in the same scope.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
idempotency_key (str | Unset):
|
|
111
|
+
body (BehaviorCurriculumPushSettingsRequest): Push a new settings version for a subject.
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
Response[BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
kwargs = _get_kwargs(
|
|
122
|
+
body=body,
|
|
123
|
+
idempotency_key=idempotency_key,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
response = client.get_httpx_client().request(
|
|
127
|
+
**kwargs,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
return _build_response(client=client, response=response)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def sync(
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient,
|
|
136
|
+
body: BehaviorCurriculumPushSettingsRequest,
|
|
137
|
+
idempotency_key: str | Unset = UNSET,
|
|
138
|
+
) -> (
|
|
139
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None
|
|
140
|
+
):
|
|
141
|
+
"""Push a new behavior_curriculum settings version; supersedes the live version in the same scope.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
idempotency_key (str | Unset):
|
|
145
|
+
body (BehaviorCurriculumPushSettingsRequest): Push a new settings version for a subject.
|
|
146
|
+
|
|
147
|
+
Raises:
|
|
148
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
149
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
return sync_detailed(
|
|
156
|
+
client=client,
|
|
157
|
+
body=body,
|
|
158
|
+
idempotency_key=idempotency_key,
|
|
159
|
+
).parsed
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
async def asyncio_detailed(
|
|
163
|
+
*,
|
|
164
|
+
client: AuthenticatedClient,
|
|
165
|
+
body: BehaviorCurriculumPushSettingsRequest,
|
|
166
|
+
idempotency_key: str | Unset = UNSET,
|
|
167
|
+
) -> Response[
|
|
168
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
169
|
+
]:
|
|
170
|
+
"""Push a new behavior_curriculum settings version; supersedes the live version in the same scope.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
idempotency_key (str | Unset):
|
|
174
|
+
body (BehaviorCurriculumPushSettingsRequest): Push a new settings version for a subject.
|
|
175
|
+
|
|
176
|
+
Raises:
|
|
177
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
178
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
Response[BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
kwargs = _get_kwargs(
|
|
185
|
+
body=body,
|
|
186
|
+
idempotency_key=idempotency_key,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
190
|
+
|
|
191
|
+
return _build_response(client=client, response=response)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
async def asyncio(
|
|
195
|
+
*,
|
|
196
|
+
client: AuthenticatedClient,
|
|
197
|
+
body: BehaviorCurriculumPushSettingsRequest,
|
|
198
|
+
idempotency_key: str | Unset = UNSET,
|
|
199
|
+
) -> (
|
|
200
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None
|
|
201
|
+
):
|
|
202
|
+
"""Push a new behavior_curriculum settings version; supersedes the live version in the same scope.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
idempotency_key (str | Unset):
|
|
206
|
+
body (BehaviorCurriculumPushSettingsRequest): Push a new settings version for a subject.
|
|
207
|
+
|
|
208
|
+
Raises:
|
|
209
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
210
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
BehaviorCurriculumSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
await asyncio_detailed(
|
|
218
|
+
client=client,
|
|
219
|
+
body=body,
|
|
220
|
+
idempotency_key=idempotency_key,
|
|
221
|
+
)
|
|
222
|
+
).parsed
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.fip_push_settings_request import FipPushSettingsRequest
|
|
12
|
+
from ...models.fip_settings_version_response import FipSettingsVersionResponse
|
|
13
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
14
|
+
from ...models.problem_details import ProblemDetails
|
|
15
|
+
from ...types import UNSET, Unset
|
|
16
|
+
from typing import cast
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
*,
|
|
21
|
+
body: FipPushSettingsRequest,
|
|
22
|
+
idempotency_key: str | Unset = UNSET,
|
|
23
|
+
) -> dict[str, Any]:
|
|
24
|
+
headers: dict[str, Any] = {}
|
|
25
|
+
if not isinstance(idempotency_key, Unset):
|
|
26
|
+
headers["Idempotency-Key"] = idempotency_key
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "post",
|
|
30
|
+
"url": "/api/v1/settings/fip",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
|
|
35
|
+
headers["Content-Type"] = "application/json"
|
|
36
|
+
|
|
37
|
+
_kwargs["headers"] = headers
|
|
38
|
+
return _kwargs
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _parse_response(
|
|
42
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
43
|
+
) -> FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None:
|
|
44
|
+
if response.status_code == 201:
|
|
45
|
+
response_201 = FipSettingsVersionResponse.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_201
|
|
48
|
+
|
|
49
|
+
if response.status_code == 401:
|
|
50
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_401
|
|
53
|
+
|
|
54
|
+
if response.status_code == 403:
|
|
55
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
return response_403
|
|
58
|
+
|
|
59
|
+
if response.status_code == 409:
|
|
60
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
61
|
+
|
|
62
|
+
return response_409
|
|
63
|
+
|
|
64
|
+
if response.status_code == 422:
|
|
65
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_422
|
|
68
|
+
|
|
69
|
+
if response.status_code == 503:
|
|
70
|
+
response_503 = ProblemDetails.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
return response_503
|
|
73
|
+
|
|
74
|
+
if client.raise_on_unexpected_status:
|
|
75
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
76
|
+
else:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _build_response(
|
|
81
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
82
|
+
) -> Response[FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]:
|
|
83
|
+
return Response(
|
|
84
|
+
status_code=HTTPStatus(response.status_code),
|
|
85
|
+
content=response.content,
|
|
86
|
+
headers=response.headers,
|
|
87
|
+
parsed=_parse_response(client=client, response=response),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync_detailed(
|
|
92
|
+
*,
|
|
93
|
+
client: AuthenticatedClient,
|
|
94
|
+
body: FipPushSettingsRequest,
|
|
95
|
+
idempotency_key: str | Unset = UNSET,
|
|
96
|
+
) -> Response[FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]:
|
|
97
|
+
"""Push a new fip settings version; supersedes the live version in the same scope.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
idempotency_key (str | Unset):
|
|
101
|
+
body (FipPushSettingsRequest): Push a new settings version for a subject.
|
|
102
|
+
|
|
103
|
+
Raises:
|
|
104
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
105
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
Response[FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
kwargs = _get_kwargs(
|
|
112
|
+
body=body,
|
|
113
|
+
idempotency_key=idempotency_key,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
response = client.get_httpx_client().request(
|
|
117
|
+
**kwargs,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
return _build_response(client=client, response=response)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def sync(
|
|
124
|
+
*,
|
|
125
|
+
client: AuthenticatedClient,
|
|
126
|
+
body: FipPushSettingsRequest,
|
|
127
|
+
idempotency_key: str | Unset = UNSET,
|
|
128
|
+
) -> FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None:
|
|
129
|
+
"""Push a new fip settings version; supersedes the live version in the same scope.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
idempotency_key (str | Unset):
|
|
133
|
+
body (FipPushSettingsRequest): Push a new settings version for a subject.
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
return sync_detailed(
|
|
144
|
+
client=client,
|
|
145
|
+
body=body,
|
|
146
|
+
idempotency_key=idempotency_key,
|
|
147
|
+
).parsed
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio_detailed(
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient,
|
|
153
|
+
body: FipPushSettingsRequest,
|
|
154
|
+
idempotency_key: str | Unset = UNSET,
|
|
155
|
+
) -> Response[FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]:
|
|
156
|
+
"""Push a new fip settings version; supersedes the live version in the same scope.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
idempotency_key (str | Unset):
|
|
160
|
+
body (FipPushSettingsRequest): Push a new settings version for a subject.
|
|
161
|
+
|
|
162
|
+
Raises:
|
|
163
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
164
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
Response[FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails]
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
kwargs = _get_kwargs(
|
|
171
|
+
body=body,
|
|
172
|
+
idempotency_key=idempotency_key,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
176
|
+
|
|
177
|
+
return _build_response(client=client, response=response)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
async def asyncio(
|
|
181
|
+
*,
|
|
182
|
+
client: AuthenticatedClient,
|
|
183
|
+
body: FipPushSettingsRequest,
|
|
184
|
+
idempotency_key: str | Unset = UNSET,
|
|
185
|
+
) -> FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails | None:
|
|
186
|
+
"""Push a new fip settings version; supersedes the live version in the same scope.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
idempotency_key (str | Unset):
|
|
190
|
+
body (FipPushSettingsRequest): Push a new settings version for a subject.
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
194
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
FipSettingsVersionResponse | HttpValidationProblemDetails | ProblemDetails
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
await asyncio_detailed(
|
|
202
|
+
client=client,
|
|
203
|
+
body=body,
|
|
204
|
+
idempotency_key=idempotency_key,
|
|
205
|
+
)
|
|
206
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.archive_template_request import ArchiveTemplateRequest
|
|
12
|
+
from ...models.problem_details import ProblemDetails
|
|
13
|
+
from ...models.template_response import TemplateResponse
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
id: int,
|
|
19
|
+
*,
|
|
20
|
+
body: ArchiveTemplateRequest,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
headers: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "post",
|
|
26
|
+
"url": "/api/v1/templates/{id}/archive".format(
|
|
27
|
+
id=quote(str(id), safe=""),
|
|
28
|
+
),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_kwargs["json"] = body.to_dict()
|
|
32
|
+
|
|
33
|
+
headers["Content-Type"] = "application/json"
|
|
34
|
+
|
|
35
|
+
_kwargs["headers"] = headers
|
|
36
|
+
return _kwargs
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
41
|
+
) -> ProblemDetails | TemplateResponse | None:
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
response_200 = TemplateResponse.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_200
|
|
46
|
+
|
|
47
|
+
if response.status_code == 401:
|
|
48
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_401
|
|
51
|
+
|
|
52
|
+
if response.status_code == 403:
|
|
53
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_403
|
|
56
|
+
|
|
57
|
+
if response.status_code == 404:
|
|
58
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_404
|
|
61
|
+
|
|
62
|
+
if response.status_code == 409:
|
|
63
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
return response_409
|
|
66
|
+
|
|
67
|
+
if client.raise_on_unexpected_status:
|
|
68
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
69
|
+
else:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _build_response(
|
|
74
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
75
|
+
) -> Response[ProblemDetails | TemplateResponse]:
|
|
76
|
+
return Response(
|
|
77
|
+
status_code=HTTPStatus(response.status_code),
|
|
78
|
+
content=response.content,
|
|
79
|
+
headers=response.headers,
|
|
80
|
+
parsed=_parse_response(client=client, response=response),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sync_detailed(
|
|
85
|
+
id: int,
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient,
|
|
88
|
+
body: ArchiveTemplateRequest,
|
|
89
|
+
) -> Response[ProblemDetails | TemplateResponse]:
|
|
90
|
+
"""Archive a template: hidden from default listings and its name becomes free. Nothing is deleted.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
id (int):
|
|
94
|
+
body (ArchiveTemplateRequest): Archive a template: hidden from default listings, its name
|
|
95
|
+
free for reuse. Past uses are unaffected.
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[ProblemDetails | TemplateResponse]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
id=id,
|
|
107
|
+
body=body,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = client.get_httpx_client().request(
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def sync(
|
|
118
|
+
id: int,
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient,
|
|
121
|
+
body: ArchiveTemplateRequest,
|
|
122
|
+
) -> ProblemDetails | TemplateResponse | None:
|
|
123
|
+
"""Archive a template: hidden from default listings and its name becomes free. Nothing is deleted.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
id (int):
|
|
127
|
+
body (ArchiveTemplateRequest): Archive a template: hidden from default listings, its name
|
|
128
|
+
free for reuse. Past uses are unaffected.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
132
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
ProblemDetails | TemplateResponse
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
return sync_detailed(
|
|
139
|
+
id=id,
|
|
140
|
+
client=client,
|
|
141
|
+
body=body,
|
|
142
|
+
).parsed
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
async def asyncio_detailed(
|
|
146
|
+
id: int,
|
|
147
|
+
*,
|
|
148
|
+
client: AuthenticatedClient,
|
|
149
|
+
body: ArchiveTemplateRequest,
|
|
150
|
+
) -> Response[ProblemDetails | TemplateResponse]:
|
|
151
|
+
"""Archive a template: hidden from default listings and its name becomes free. Nothing is deleted.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
id (int):
|
|
155
|
+
body (ArchiveTemplateRequest): Archive a template: hidden from default listings, its name
|
|
156
|
+
free for reuse. Past uses are unaffected.
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
Response[ProblemDetails | TemplateResponse]
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
kwargs = _get_kwargs(
|
|
167
|
+
id=id,
|
|
168
|
+
body=body,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
172
|
+
|
|
173
|
+
return _build_response(client=client, response=response)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
async def asyncio(
|
|
177
|
+
id: int,
|
|
178
|
+
*,
|
|
179
|
+
client: AuthenticatedClient,
|
|
180
|
+
body: ArchiveTemplateRequest,
|
|
181
|
+
) -> ProblemDetails | TemplateResponse | None:
|
|
182
|
+
"""Archive a template: hidden from default listings and its name becomes free. Nothing is deleted.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
id (int):
|
|
186
|
+
body (ArchiveTemplateRequest): Archive a template: hidden from default listings, its name
|
|
187
|
+
free for reuse. Past uses are unaffected.
|
|
188
|
+
|
|
189
|
+
Raises:
|
|
190
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
191
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
ProblemDetails | TemplateResponse
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
await asyncio_detailed(
|
|
199
|
+
id=id,
|
|
200
|
+
client=client,
|
|
201
|
+
body=body,
|
|
202
|
+
)
|
|
203
|
+
).parsed
|