waldur-api-client 7.7.1__py3-none-any.whl → 7.7.3__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 waldur-api-client might be problematic. Click here for more details.
- waldur_api_client/api/marketplace_checklists/marketplace_checklists_questions_list.py +31 -32
- waldur_api_client/api/marketplace_checklists/marketplace_checklists_retrieve.py +15 -14
- waldur_api_client/api/marketplace_checklists_admin/__init__.py +1 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_checklist_questions.py +187 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_create.py +150 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_destroy.py +89 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_list.py +173 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_partial_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_retrieve.py +142 -0
- waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/__init__.py +1 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_create.py +150 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_destroy.py +89 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_list.py +212 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_partial_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_retrieve.py +142 -0
- waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/__init__.py +1 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_create.py +150 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_destroy.py +89 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_list.py +194 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_partial_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_retrieve.py +142 -0
- waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_update.py +164 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/__init__.py +1 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_create.py +148 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_destroy.py +89 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_list.py +192 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_partial_update.py +162 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_retrieve.py +140 -0
- waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_update.py +162 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_list.py +23 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_set_pending_account_linking.py +105 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_set_pending_additional_validation.py +105 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_set_validation_complete.py +105 -0
- waldur_api_client/models/__init__.py +44 -2
- waldur_api_client/models/answer_list.py +8 -19
- waldur_api_client/models/answer_submit.py +7 -13
- waldur_api_client/models/answer_submit_request.py +7 -13
- waldur_api_client/models/booking_resource.py +18 -0
- waldur_api_client/models/booking_resources_list_field_item.py +2 -0
- waldur_api_client/models/booking_resources_retrieve_field_item.py +2 -0
- waldur_api_client/models/call_resource_template.py +23 -1
- waldur_api_client/models/checklist.py +8 -0
- waldur_api_client/models/checklist_admin.py +127 -0
- waldur_api_client/models/checklist_type_enum.py +10 -0
- waldur_api_client/models/create_checklist.py +131 -0
- waldur_api_client/models/create_checklist_request.py +90 -0
- waldur_api_client/models/event_types_enum.py +1 -0
- waldur_api_client/models/group_invitation.py +27 -3
- waldur_api_client/models/group_invitation_request.py +18 -0
- waldur_api_client/models/impact_level_display_enum.py +11 -0
- waldur_api_client/models/invitation.py +10 -4
- waldur_api_client/models/maintenance_announcement.py +8 -0
- waldur_api_client/models/maintenance_announcement_offering.py +17 -0
- waldur_api_client/models/maintenance_announcement_state_enum.py +7 -7
- waldur_api_client/models/marketplace_offering_users_list_field_item.py +2 -0
- waldur_api_client/models/marketplace_offering_users_list_state_item.py +16 -0
- waldur_api_client/models/marketplace_offering_users_retrieve_field_item.py +2 -0
- waldur_api_client/models/marketplace_provider_resources_details_retrieve_field_item.py +2 -0
- waldur_api_client/models/marketplace_provider_resources_list_field_item.py +2 -0
- waldur_api_client/models/marketplace_provider_resources_retrieve_field_item.py +2 -0
- waldur_api_client/models/marketplace_resources_details_retrieve_field_item.py +2 -0
- waldur_api_client/models/marketplace_resources_list_field_item.py +2 -0
- waldur_api_client/models/marketplace_resources_retrieve_field_item.py +2 -0
- waldur_api_client/models/offering_user.py +27 -0
- waldur_api_client/models/offering_user_state_enum.py +16 -0
- waldur_api_client/models/offering_user_state_transition_request.py +59 -0
- waldur_api_client/models/open_stack_port.py +15 -4
- waldur_api_client/models/open_stack_router.py +15 -4
- waldur_api_client/models/operator_enum.py +12 -0
- waldur_api_client/models/patched_create_checklist_request.py +96 -0
- waldur_api_client/models/patched_question_admin_request.py +208 -0
- waldur_api_client/models/patched_question_dependency_request.py +94 -0
- waldur_api_client/models/patched_question_options_admin_request.py +68 -0
- waldur_api_client/models/{checklist_question.py → question.py} +29 -16
- waldur_api_client/models/question_admin.py +260 -0
- waldur_api_client/models/question_admin_request.py +210 -0
- waldur_api_client/models/question_dependency.py +127 -0
- waldur_api_client/models/question_dependency_request.py +94 -0
- waldur_api_client/models/question_options.py +79 -0
- waldur_api_client/models/question_options_admin.py +103 -0
- waldur_api_client/models/question_options_admin_request.py +78 -0
- waldur_api_client/models/question_type_enum.py +15 -0
- waldur_api_client/models/resource.py +18 -0
- waldur_api_client/models/visible_invitation_details.py +10 -4
- {waldur_api_client-7.7.1.dist-info → waldur_api_client-7.7.3.dist-info}/METADATA +1 -1
- {waldur_api_client-7.7.1.dist-info → waldur_api_client-7.7.3.dist-info}/RECORD +90 -37
- {waldur_api_client-7.7.1.dist-info → waldur_api_client-7.7.3.dist-info}/LICENSE +0 -0
- {waldur_api_client-7.7.1.dist-info → waldur_api_client-7.7.3.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from ..models.blank_enum import BlankEnum
|
|
9
|
+
from ..models.operator_enum import OperatorEnum
|
|
10
|
+
from ..models.question_type_enum import QuestionTypeEnum
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.question_options_admin import QuestionOptionsAdmin
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="QuestionAdmin")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class QuestionAdmin:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
uuid (UUID):
|
|
25
|
+
category_uuid (UUID):
|
|
26
|
+
question_options (list['QuestionOptionsAdmin']):
|
|
27
|
+
url (str):
|
|
28
|
+
checklist_name (UUID):
|
|
29
|
+
checklist_uuid (UUID):
|
|
30
|
+
checklist (str):
|
|
31
|
+
description (Union[Unset, str]):
|
|
32
|
+
solution (Union[None, Unset, str]): Guidance shown when answer needs clarification
|
|
33
|
+
image (Union[None, Unset, str]):
|
|
34
|
+
order (Union[Unset, int]):
|
|
35
|
+
required (Union[Unset, bool]):
|
|
36
|
+
question_type (Union[Unset, QuestionTypeEnum]):
|
|
37
|
+
operator (Union[BlankEnum, OperatorEnum, Unset]):
|
|
38
|
+
review_answer_value (Union[Unset, Any]): Answer value that trigger review.
|
|
39
|
+
always_requires_review (Union[Unset, bool]): This question always requires review regardless of answer
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
uuid: UUID
|
|
43
|
+
category_uuid: UUID
|
|
44
|
+
question_options: list["QuestionOptionsAdmin"]
|
|
45
|
+
url: str
|
|
46
|
+
checklist_name: UUID
|
|
47
|
+
checklist_uuid: UUID
|
|
48
|
+
checklist: str
|
|
49
|
+
description: Union[Unset, str] = UNSET
|
|
50
|
+
solution: Union[None, Unset, str] = UNSET
|
|
51
|
+
image: Union[None, Unset, str] = UNSET
|
|
52
|
+
order: Union[Unset, int] = UNSET
|
|
53
|
+
required: Union[Unset, bool] = UNSET
|
|
54
|
+
question_type: Union[Unset, QuestionTypeEnum] = UNSET
|
|
55
|
+
operator: Union[BlankEnum, OperatorEnum, Unset] = UNSET
|
|
56
|
+
review_answer_value: Union[Unset, Any] = UNSET
|
|
57
|
+
always_requires_review: Union[Unset, bool] = UNSET
|
|
58
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> dict[str, Any]:
|
|
61
|
+
uuid = str(self.uuid)
|
|
62
|
+
|
|
63
|
+
category_uuid = str(self.category_uuid)
|
|
64
|
+
|
|
65
|
+
question_options = []
|
|
66
|
+
for question_options_item_data in self.question_options:
|
|
67
|
+
question_options_item = question_options_item_data.to_dict()
|
|
68
|
+
question_options.append(question_options_item)
|
|
69
|
+
|
|
70
|
+
url = self.url
|
|
71
|
+
|
|
72
|
+
checklist_name = str(self.checklist_name)
|
|
73
|
+
|
|
74
|
+
checklist_uuid = str(self.checklist_uuid)
|
|
75
|
+
|
|
76
|
+
checklist = self.checklist
|
|
77
|
+
|
|
78
|
+
description = self.description
|
|
79
|
+
|
|
80
|
+
solution: Union[None, Unset, str]
|
|
81
|
+
if isinstance(self.solution, Unset):
|
|
82
|
+
solution = UNSET
|
|
83
|
+
else:
|
|
84
|
+
solution = self.solution
|
|
85
|
+
|
|
86
|
+
image: Union[None, Unset, str]
|
|
87
|
+
if isinstance(self.image, Unset):
|
|
88
|
+
image = UNSET
|
|
89
|
+
else:
|
|
90
|
+
image = self.image
|
|
91
|
+
|
|
92
|
+
order = self.order
|
|
93
|
+
|
|
94
|
+
required = self.required
|
|
95
|
+
|
|
96
|
+
question_type: Union[Unset, str] = UNSET
|
|
97
|
+
if not isinstance(self.question_type, Unset):
|
|
98
|
+
question_type = self.question_type.value
|
|
99
|
+
|
|
100
|
+
operator: Union[Unset, str]
|
|
101
|
+
if isinstance(self.operator, Unset):
|
|
102
|
+
operator = UNSET
|
|
103
|
+
elif isinstance(self.operator, OperatorEnum):
|
|
104
|
+
operator = self.operator.value
|
|
105
|
+
else:
|
|
106
|
+
operator = self.operator.value
|
|
107
|
+
|
|
108
|
+
review_answer_value = self.review_answer_value
|
|
109
|
+
|
|
110
|
+
always_requires_review = self.always_requires_review
|
|
111
|
+
|
|
112
|
+
field_dict: dict[str, Any] = {}
|
|
113
|
+
field_dict.update(self.additional_properties)
|
|
114
|
+
field_dict.update(
|
|
115
|
+
{
|
|
116
|
+
"uuid": uuid,
|
|
117
|
+
"category_uuid": category_uuid,
|
|
118
|
+
"question_options": question_options,
|
|
119
|
+
"url": url,
|
|
120
|
+
"checklist_name": checklist_name,
|
|
121
|
+
"checklist_uuid": checklist_uuid,
|
|
122
|
+
"checklist": checklist,
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
if description is not UNSET:
|
|
126
|
+
field_dict["description"] = description
|
|
127
|
+
if solution is not UNSET:
|
|
128
|
+
field_dict["solution"] = solution
|
|
129
|
+
if image is not UNSET:
|
|
130
|
+
field_dict["image"] = image
|
|
131
|
+
if order is not UNSET:
|
|
132
|
+
field_dict["order"] = order
|
|
133
|
+
if required is not UNSET:
|
|
134
|
+
field_dict["required"] = required
|
|
135
|
+
if question_type is not UNSET:
|
|
136
|
+
field_dict["question_type"] = question_type
|
|
137
|
+
if operator is not UNSET:
|
|
138
|
+
field_dict["operator"] = operator
|
|
139
|
+
if review_answer_value is not UNSET:
|
|
140
|
+
field_dict["review_answer_value"] = review_answer_value
|
|
141
|
+
if always_requires_review is not UNSET:
|
|
142
|
+
field_dict["always_requires_review"] = always_requires_review
|
|
143
|
+
|
|
144
|
+
return field_dict
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
148
|
+
from ..models.question_options_admin import QuestionOptionsAdmin
|
|
149
|
+
|
|
150
|
+
d = dict(src_dict)
|
|
151
|
+
uuid = UUID(d.pop("uuid"))
|
|
152
|
+
|
|
153
|
+
category_uuid = UUID(d.pop("category_uuid"))
|
|
154
|
+
|
|
155
|
+
question_options = []
|
|
156
|
+
_question_options = d.pop("question_options")
|
|
157
|
+
for question_options_item_data in _question_options:
|
|
158
|
+
question_options_item = QuestionOptionsAdmin.from_dict(question_options_item_data)
|
|
159
|
+
|
|
160
|
+
question_options.append(question_options_item)
|
|
161
|
+
|
|
162
|
+
url = d.pop("url")
|
|
163
|
+
|
|
164
|
+
checklist_name = UUID(d.pop("checklist_name"))
|
|
165
|
+
|
|
166
|
+
checklist_uuid = UUID(d.pop("checklist_uuid"))
|
|
167
|
+
|
|
168
|
+
checklist = d.pop("checklist")
|
|
169
|
+
|
|
170
|
+
description = d.pop("description", UNSET)
|
|
171
|
+
|
|
172
|
+
def _parse_solution(data: object) -> Union[None, Unset, str]:
|
|
173
|
+
if data is None:
|
|
174
|
+
return data
|
|
175
|
+
if isinstance(data, Unset):
|
|
176
|
+
return data
|
|
177
|
+
return cast(Union[None, Unset, str], data)
|
|
178
|
+
|
|
179
|
+
solution = _parse_solution(d.pop("solution", UNSET))
|
|
180
|
+
|
|
181
|
+
def _parse_image(data: object) -> Union[None, Unset, str]:
|
|
182
|
+
if data is None:
|
|
183
|
+
return data
|
|
184
|
+
if isinstance(data, Unset):
|
|
185
|
+
return data
|
|
186
|
+
return cast(Union[None, Unset, str], data)
|
|
187
|
+
|
|
188
|
+
image = _parse_image(d.pop("image", UNSET))
|
|
189
|
+
|
|
190
|
+
order = d.pop("order", UNSET)
|
|
191
|
+
|
|
192
|
+
required = d.pop("required", UNSET)
|
|
193
|
+
|
|
194
|
+
_question_type = d.pop("question_type", UNSET)
|
|
195
|
+
question_type: Union[Unset, QuestionTypeEnum]
|
|
196
|
+
if isinstance(_question_type, Unset):
|
|
197
|
+
question_type = UNSET
|
|
198
|
+
else:
|
|
199
|
+
question_type = QuestionTypeEnum(_question_type)
|
|
200
|
+
|
|
201
|
+
def _parse_operator(data: object) -> Union[BlankEnum, OperatorEnum, Unset]:
|
|
202
|
+
if isinstance(data, Unset):
|
|
203
|
+
return data
|
|
204
|
+
try:
|
|
205
|
+
if not isinstance(data, str):
|
|
206
|
+
raise TypeError()
|
|
207
|
+
operator_type_0 = OperatorEnum(data)
|
|
208
|
+
|
|
209
|
+
return operator_type_0
|
|
210
|
+
except: # noqa: E722
|
|
211
|
+
pass
|
|
212
|
+
if not isinstance(data, str):
|
|
213
|
+
raise TypeError()
|
|
214
|
+
operator_type_1 = BlankEnum(data)
|
|
215
|
+
|
|
216
|
+
return operator_type_1
|
|
217
|
+
|
|
218
|
+
operator = _parse_operator(d.pop("operator", UNSET))
|
|
219
|
+
|
|
220
|
+
review_answer_value = d.pop("review_answer_value", UNSET)
|
|
221
|
+
|
|
222
|
+
always_requires_review = d.pop("always_requires_review", UNSET)
|
|
223
|
+
|
|
224
|
+
question_admin = cls(
|
|
225
|
+
uuid=uuid,
|
|
226
|
+
category_uuid=category_uuid,
|
|
227
|
+
question_options=question_options,
|
|
228
|
+
url=url,
|
|
229
|
+
checklist_name=checklist_name,
|
|
230
|
+
checklist_uuid=checklist_uuid,
|
|
231
|
+
checklist=checklist,
|
|
232
|
+
description=description,
|
|
233
|
+
solution=solution,
|
|
234
|
+
image=image,
|
|
235
|
+
order=order,
|
|
236
|
+
required=required,
|
|
237
|
+
question_type=question_type,
|
|
238
|
+
operator=operator,
|
|
239
|
+
review_answer_value=review_answer_value,
|
|
240
|
+
always_requires_review=always_requires_review,
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
question_admin.additional_properties = d
|
|
244
|
+
return question_admin
|
|
245
|
+
|
|
246
|
+
@property
|
|
247
|
+
def additional_keys(self) -> list[str]:
|
|
248
|
+
return list(self.additional_properties.keys())
|
|
249
|
+
|
|
250
|
+
def __getitem__(self, key: str) -> Any:
|
|
251
|
+
return self.additional_properties[key]
|
|
252
|
+
|
|
253
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
254
|
+
self.additional_properties[key] = value
|
|
255
|
+
|
|
256
|
+
def __delitem__(self, key: str) -> None:
|
|
257
|
+
del self.additional_properties[key]
|
|
258
|
+
|
|
259
|
+
def __contains__(self, key: str) -> bool:
|
|
260
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from .. import types
|
|
9
|
+
from ..models.blank_enum import BlankEnum
|
|
10
|
+
from ..models.operator_enum import OperatorEnum
|
|
11
|
+
from ..models.question_type_enum import QuestionTypeEnum
|
|
12
|
+
from ..types import UNSET, File, Unset
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="QuestionAdminRequest")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class QuestionAdminRequest:
|
|
19
|
+
"""
|
|
20
|
+
Attributes:
|
|
21
|
+
checklist (str):
|
|
22
|
+
description (Union[Unset, str]):
|
|
23
|
+
solution (Union[None, Unset, str]): Guidance shown when answer needs clarification
|
|
24
|
+
image (Union[File, None, Unset]):
|
|
25
|
+
order (Union[Unset, int]):
|
|
26
|
+
required (Union[Unset, bool]):
|
|
27
|
+
question_type (Union[Unset, QuestionTypeEnum]):
|
|
28
|
+
operator (Union[BlankEnum, OperatorEnum, Unset]):
|
|
29
|
+
review_answer_value (Union[Unset, Any]): Answer value that trigger review.
|
|
30
|
+
always_requires_review (Union[Unset, bool]): This question always requires review regardless of answer
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
checklist: str
|
|
34
|
+
description: Union[Unset, str] = UNSET
|
|
35
|
+
solution: Union[None, Unset, str] = UNSET
|
|
36
|
+
image: Union[File, None, Unset] = UNSET
|
|
37
|
+
order: Union[Unset, int] = UNSET
|
|
38
|
+
required: Union[Unset, bool] = UNSET
|
|
39
|
+
question_type: Union[Unset, QuestionTypeEnum] = UNSET
|
|
40
|
+
operator: Union[BlankEnum, OperatorEnum, Unset] = UNSET
|
|
41
|
+
review_answer_value: Union[Unset, Any] = UNSET
|
|
42
|
+
always_requires_review: Union[Unset, bool] = UNSET
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
|
46
|
+
checklist = self.checklist
|
|
47
|
+
|
|
48
|
+
description = self.description
|
|
49
|
+
|
|
50
|
+
solution: Union[None, Unset, str]
|
|
51
|
+
if isinstance(self.solution, Unset):
|
|
52
|
+
solution = UNSET
|
|
53
|
+
else:
|
|
54
|
+
solution = self.solution
|
|
55
|
+
|
|
56
|
+
image: Union[None, Unset, types.FileTypes]
|
|
57
|
+
if isinstance(self.image, Unset):
|
|
58
|
+
image = UNSET
|
|
59
|
+
elif isinstance(self.image, File):
|
|
60
|
+
image = self.image.to_tuple()
|
|
61
|
+
|
|
62
|
+
else:
|
|
63
|
+
image = self.image
|
|
64
|
+
|
|
65
|
+
order = self.order
|
|
66
|
+
|
|
67
|
+
required = self.required
|
|
68
|
+
|
|
69
|
+
question_type: Union[Unset, str] = UNSET
|
|
70
|
+
if not isinstance(self.question_type, Unset):
|
|
71
|
+
question_type = self.question_type.value
|
|
72
|
+
|
|
73
|
+
operator: Union[Unset, str]
|
|
74
|
+
if isinstance(self.operator, Unset):
|
|
75
|
+
operator = UNSET
|
|
76
|
+
elif isinstance(self.operator, OperatorEnum):
|
|
77
|
+
operator = self.operator.value
|
|
78
|
+
else:
|
|
79
|
+
operator = self.operator.value
|
|
80
|
+
|
|
81
|
+
review_answer_value = self.review_answer_value
|
|
82
|
+
|
|
83
|
+
always_requires_review = self.always_requires_review
|
|
84
|
+
|
|
85
|
+
field_dict: dict[str, Any] = {}
|
|
86
|
+
field_dict.update(self.additional_properties)
|
|
87
|
+
field_dict.update(
|
|
88
|
+
{
|
|
89
|
+
"checklist": checklist,
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
if description is not UNSET:
|
|
93
|
+
field_dict["description"] = description
|
|
94
|
+
if solution is not UNSET:
|
|
95
|
+
field_dict["solution"] = solution
|
|
96
|
+
if image is not UNSET:
|
|
97
|
+
field_dict["image"] = image
|
|
98
|
+
if order is not UNSET:
|
|
99
|
+
field_dict["order"] = order
|
|
100
|
+
if required is not UNSET:
|
|
101
|
+
field_dict["required"] = required
|
|
102
|
+
if question_type is not UNSET:
|
|
103
|
+
field_dict["question_type"] = question_type
|
|
104
|
+
if operator is not UNSET:
|
|
105
|
+
field_dict["operator"] = operator
|
|
106
|
+
if review_answer_value is not UNSET:
|
|
107
|
+
field_dict["review_answer_value"] = review_answer_value
|
|
108
|
+
if always_requires_review is not UNSET:
|
|
109
|
+
field_dict["always_requires_review"] = always_requires_review
|
|
110
|
+
|
|
111
|
+
return field_dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
115
|
+
d = dict(src_dict)
|
|
116
|
+
checklist = d.pop("checklist")
|
|
117
|
+
|
|
118
|
+
description = d.pop("description", UNSET)
|
|
119
|
+
|
|
120
|
+
def _parse_solution(data: object) -> Union[None, Unset, str]:
|
|
121
|
+
if data is None:
|
|
122
|
+
return data
|
|
123
|
+
if isinstance(data, Unset):
|
|
124
|
+
return data
|
|
125
|
+
return cast(Union[None, Unset, str], data)
|
|
126
|
+
|
|
127
|
+
solution = _parse_solution(d.pop("solution", UNSET))
|
|
128
|
+
|
|
129
|
+
def _parse_image(data: object) -> Union[File, None, Unset]:
|
|
130
|
+
if data is None:
|
|
131
|
+
return data
|
|
132
|
+
if isinstance(data, Unset):
|
|
133
|
+
return data
|
|
134
|
+
try:
|
|
135
|
+
if not isinstance(data, bytes):
|
|
136
|
+
raise TypeError()
|
|
137
|
+
image_type_0 = File(payload=BytesIO(data))
|
|
138
|
+
|
|
139
|
+
return image_type_0
|
|
140
|
+
except: # noqa: E722
|
|
141
|
+
pass
|
|
142
|
+
return cast(Union[File, None, Unset], data)
|
|
143
|
+
|
|
144
|
+
image = _parse_image(d.pop("image", UNSET))
|
|
145
|
+
|
|
146
|
+
order = d.pop("order", UNSET)
|
|
147
|
+
|
|
148
|
+
required = d.pop("required", UNSET)
|
|
149
|
+
|
|
150
|
+
_question_type = d.pop("question_type", UNSET)
|
|
151
|
+
question_type: Union[Unset, QuestionTypeEnum]
|
|
152
|
+
if isinstance(_question_type, Unset):
|
|
153
|
+
question_type = UNSET
|
|
154
|
+
else:
|
|
155
|
+
question_type = QuestionTypeEnum(_question_type)
|
|
156
|
+
|
|
157
|
+
def _parse_operator(data: object) -> Union[BlankEnum, OperatorEnum, Unset]:
|
|
158
|
+
if isinstance(data, Unset):
|
|
159
|
+
return data
|
|
160
|
+
try:
|
|
161
|
+
if not isinstance(data, str):
|
|
162
|
+
raise TypeError()
|
|
163
|
+
operator_type_0 = OperatorEnum(data)
|
|
164
|
+
|
|
165
|
+
return operator_type_0
|
|
166
|
+
except: # noqa: E722
|
|
167
|
+
pass
|
|
168
|
+
if not isinstance(data, str):
|
|
169
|
+
raise TypeError()
|
|
170
|
+
operator_type_1 = BlankEnum(data)
|
|
171
|
+
|
|
172
|
+
return operator_type_1
|
|
173
|
+
|
|
174
|
+
operator = _parse_operator(d.pop("operator", UNSET))
|
|
175
|
+
|
|
176
|
+
review_answer_value = d.pop("review_answer_value", UNSET)
|
|
177
|
+
|
|
178
|
+
always_requires_review = d.pop("always_requires_review", UNSET)
|
|
179
|
+
|
|
180
|
+
question_admin_request = cls(
|
|
181
|
+
checklist=checklist,
|
|
182
|
+
description=description,
|
|
183
|
+
solution=solution,
|
|
184
|
+
image=image,
|
|
185
|
+
order=order,
|
|
186
|
+
required=required,
|
|
187
|
+
question_type=question_type,
|
|
188
|
+
operator=operator,
|
|
189
|
+
review_answer_value=review_answer_value,
|
|
190
|
+
always_requires_review=always_requires_review,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
question_admin_request.additional_properties = d
|
|
194
|
+
return question_admin_request
|
|
195
|
+
|
|
196
|
+
@property
|
|
197
|
+
def additional_keys(self) -> list[str]:
|
|
198
|
+
return list(self.additional_properties.keys())
|
|
199
|
+
|
|
200
|
+
def __getitem__(self, key: str) -> Any:
|
|
201
|
+
return self.additional_properties[key]
|
|
202
|
+
|
|
203
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
204
|
+
self.additional_properties[key] = value
|
|
205
|
+
|
|
206
|
+
def __delitem__(self, key: str) -> None:
|
|
207
|
+
del self.additional_properties[key]
|
|
208
|
+
|
|
209
|
+
def __contains__(self, key: str) -> bool:
|
|
210
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from ..models.operator_enum import OperatorEnum
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="QuestionDependency")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class QuestionDependency:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
uuid (UUID):
|
|
19
|
+
url (str):
|
|
20
|
+
question (str):
|
|
21
|
+
question_name (str):
|
|
22
|
+
depends_on_question (str):
|
|
23
|
+
depends_on_question_name (str):
|
|
24
|
+
required_answer_value (Any): The answer value(s) that make this question visible
|
|
25
|
+
operator (Union[Unset, OperatorEnum]):
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
uuid: UUID
|
|
29
|
+
url: str
|
|
30
|
+
question: str
|
|
31
|
+
question_name: str
|
|
32
|
+
depends_on_question: str
|
|
33
|
+
depends_on_question_name: str
|
|
34
|
+
required_answer_value: Any
|
|
35
|
+
operator: Union[Unset, OperatorEnum] = UNSET
|
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
37
|
+
|
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
|
39
|
+
uuid = str(self.uuid)
|
|
40
|
+
|
|
41
|
+
url = self.url
|
|
42
|
+
|
|
43
|
+
question = self.question
|
|
44
|
+
|
|
45
|
+
question_name = self.question_name
|
|
46
|
+
|
|
47
|
+
depends_on_question = self.depends_on_question
|
|
48
|
+
|
|
49
|
+
depends_on_question_name = self.depends_on_question_name
|
|
50
|
+
|
|
51
|
+
required_answer_value = self.required_answer_value
|
|
52
|
+
|
|
53
|
+
operator: Union[Unset, str] = UNSET
|
|
54
|
+
if not isinstance(self.operator, Unset):
|
|
55
|
+
operator = self.operator.value
|
|
56
|
+
|
|
57
|
+
field_dict: dict[str, Any] = {}
|
|
58
|
+
field_dict.update(self.additional_properties)
|
|
59
|
+
field_dict.update(
|
|
60
|
+
{
|
|
61
|
+
"uuid": uuid,
|
|
62
|
+
"url": url,
|
|
63
|
+
"question": question,
|
|
64
|
+
"question_name": question_name,
|
|
65
|
+
"depends_on_question": depends_on_question,
|
|
66
|
+
"depends_on_question_name": depends_on_question_name,
|
|
67
|
+
"required_answer_value": required_answer_value,
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
if operator is not UNSET:
|
|
71
|
+
field_dict["operator"] = operator
|
|
72
|
+
|
|
73
|
+
return field_dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
77
|
+
d = dict(src_dict)
|
|
78
|
+
uuid = UUID(d.pop("uuid"))
|
|
79
|
+
|
|
80
|
+
url = d.pop("url")
|
|
81
|
+
|
|
82
|
+
question = d.pop("question")
|
|
83
|
+
|
|
84
|
+
question_name = d.pop("question_name")
|
|
85
|
+
|
|
86
|
+
depends_on_question = d.pop("depends_on_question")
|
|
87
|
+
|
|
88
|
+
depends_on_question_name = d.pop("depends_on_question_name")
|
|
89
|
+
|
|
90
|
+
required_answer_value = d.pop("required_answer_value")
|
|
91
|
+
|
|
92
|
+
_operator = d.pop("operator", UNSET)
|
|
93
|
+
operator: Union[Unset, OperatorEnum]
|
|
94
|
+
if isinstance(_operator, Unset):
|
|
95
|
+
operator = UNSET
|
|
96
|
+
else:
|
|
97
|
+
operator = OperatorEnum(_operator)
|
|
98
|
+
|
|
99
|
+
question_dependency = cls(
|
|
100
|
+
uuid=uuid,
|
|
101
|
+
url=url,
|
|
102
|
+
question=question,
|
|
103
|
+
question_name=question_name,
|
|
104
|
+
depends_on_question=depends_on_question,
|
|
105
|
+
depends_on_question_name=depends_on_question_name,
|
|
106
|
+
required_answer_value=required_answer_value,
|
|
107
|
+
operator=operator,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
question_dependency.additional_properties = d
|
|
111
|
+
return question_dependency
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def additional_keys(self) -> list[str]:
|
|
115
|
+
return list(self.additional_properties.keys())
|
|
116
|
+
|
|
117
|
+
def __getitem__(self, key: str) -> Any:
|
|
118
|
+
return self.additional_properties[key]
|
|
119
|
+
|
|
120
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
121
|
+
self.additional_properties[key] = value
|
|
122
|
+
|
|
123
|
+
def __delitem__(self, key: str) -> None:
|
|
124
|
+
del self.additional_properties[key]
|
|
125
|
+
|
|
126
|
+
def __contains__(self, key: str) -> bool:
|
|
127
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..models.operator_enum import OperatorEnum
|
|
8
|
+
from ..types import UNSET, Unset
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T", bound="QuestionDependencyRequest")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@_attrs_define
|
|
14
|
+
class QuestionDependencyRequest:
|
|
15
|
+
"""
|
|
16
|
+
Attributes:
|
|
17
|
+
question (str):
|
|
18
|
+
depends_on_question (str):
|
|
19
|
+
required_answer_value (Any): The answer value(s) that make this question visible
|
|
20
|
+
operator (Union[Unset, OperatorEnum]):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
question: str
|
|
24
|
+
depends_on_question: str
|
|
25
|
+
required_answer_value: Any
|
|
26
|
+
operator: Union[Unset, OperatorEnum] = UNSET
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
question = self.question
|
|
31
|
+
|
|
32
|
+
depends_on_question = self.depends_on_question
|
|
33
|
+
|
|
34
|
+
required_answer_value = self.required_answer_value
|
|
35
|
+
|
|
36
|
+
operator: Union[Unset, str] = UNSET
|
|
37
|
+
if not isinstance(self.operator, Unset):
|
|
38
|
+
operator = self.operator.value
|
|
39
|
+
|
|
40
|
+
field_dict: dict[str, Any] = {}
|
|
41
|
+
field_dict.update(self.additional_properties)
|
|
42
|
+
field_dict.update(
|
|
43
|
+
{
|
|
44
|
+
"question": question,
|
|
45
|
+
"depends_on_question": depends_on_question,
|
|
46
|
+
"required_answer_value": required_answer_value,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
if operator is not UNSET:
|
|
50
|
+
field_dict["operator"] = operator
|
|
51
|
+
|
|
52
|
+
return field_dict
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
question = d.pop("question")
|
|
58
|
+
|
|
59
|
+
depends_on_question = d.pop("depends_on_question")
|
|
60
|
+
|
|
61
|
+
required_answer_value = d.pop("required_answer_value")
|
|
62
|
+
|
|
63
|
+
_operator = d.pop("operator", UNSET)
|
|
64
|
+
operator: Union[Unset, OperatorEnum]
|
|
65
|
+
if isinstance(_operator, Unset):
|
|
66
|
+
operator = UNSET
|
|
67
|
+
else:
|
|
68
|
+
operator = OperatorEnum(_operator)
|
|
69
|
+
|
|
70
|
+
question_dependency_request = cls(
|
|
71
|
+
question=question,
|
|
72
|
+
depends_on_question=depends_on_question,
|
|
73
|
+
required_answer_value=required_answer_value,
|
|
74
|
+
operator=operator,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
question_dependency_request.additional_properties = d
|
|
78
|
+
return question_dependency_request
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def additional_keys(self) -> list[str]:
|
|
82
|
+
return list(self.additional_properties.keys())
|
|
83
|
+
|
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
|
85
|
+
return self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
88
|
+
self.additional_properties[key] = value
|
|
89
|
+
|
|
90
|
+
def __delitem__(self, key: str) -> None:
|
|
91
|
+
del self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __contains__(self, key: str) -> bool:
|
|
94
|
+
return key in self.additional_properties
|