waldur-api-client 7.7.0__py3-none-any.whl → 7.7.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.

Potentially problematic release.


This version of waldur-api-client might be problematic. Click here for more details.

Files changed (83) hide show
  1. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_create.py +8 -4
  2. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_destroy.py +4 -2
  3. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_list.py +4 -4
  4. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_partial_update.py +8 -4
  5. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_retrieve.py +8 -4
  6. waldur_api_client/api/autoprovisioning_rules/autoprovisioning_rules_update.py +8 -4
  7. waldur_api_client/api/marketplace_checklists/marketplace_checklists_questions_list.py +31 -32
  8. waldur_api_client/api/marketplace_checklists/marketplace_checklists_retrieve.py +15 -14
  9. waldur_api_client/api/marketplace_checklists_admin/__init__.py +1 -0
  10. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_checklist_questions.py +187 -0
  11. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_create.py +150 -0
  12. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_destroy.py +89 -0
  13. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_list.py +173 -0
  14. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_partial_update.py +164 -0
  15. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_retrieve.py +142 -0
  16. waldur_api_client/api/marketplace_checklists_admin/marketplace_checklists_admin_update.py +164 -0
  17. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/__init__.py +1 -0
  18. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_create.py +150 -0
  19. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_destroy.py +89 -0
  20. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_list.py +212 -0
  21. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_partial_update.py +164 -0
  22. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_retrieve.py +142 -0
  23. waldur_api_client/api/marketplace_checklists_admin_question_dependencies/marketplace_checklists_admin_question_dependencies_update.py +164 -0
  24. waldur_api_client/api/marketplace_checklists_admin_question_options/__init__.py +1 -0
  25. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_create.py +150 -0
  26. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_destroy.py +89 -0
  27. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_list.py +194 -0
  28. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_partial_update.py +164 -0
  29. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_retrieve.py +142 -0
  30. waldur_api_client/api/marketplace_checklists_admin_question_options/marketplace_checklists_admin_question_options_update.py +164 -0
  31. waldur_api_client/api/marketplace_checklists_admin_questions/__init__.py +1 -0
  32. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_create.py +148 -0
  33. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_destroy.py +89 -0
  34. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_list.py +192 -0
  35. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_partial_update.py +162 -0
  36. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_retrieve.py +140 -0
  37. waldur_api_client/api/marketplace_checklists_admin_questions/marketplace_checklists_admin_questions_update.py +162 -0
  38. waldur_api_client/models/__init__.py +36 -2
  39. waldur_api_client/models/answer_list.py +8 -19
  40. waldur_api_client/models/answer_submit.py +7 -13
  41. waldur_api_client/models/answer_submit_request.py +7 -13
  42. waldur_api_client/models/booking_resource.py +18 -0
  43. waldur_api_client/models/booking_resources_list_field_item.py +2 -0
  44. waldur_api_client/models/booking_resources_retrieve_field_item.py +2 -0
  45. waldur_api_client/models/call_resource_template.py +23 -1
  46. waldur_api_client/models/checklist.py +8 -0
  47. waldur_api_client/models/checklist_admin.py +127 -0
  48. waldur_api_client/models/checklist_type_enum.py +10 -0
  49. waldur_api_client/models/create_checklist.py +131 -0
  50. waldur_api_client/models/create_checklist_request.py +90 -0
  51. waldur_api_client/models/group_invitation.py +16 -5
  52. waldur_api_client/models/group_invitation_request.py +16 -5
  53. waldur_api_client/models/marketplace_provider_resources_details_retrieve_field_item.py +2 -0
  54. waldur_api_client/models/marketplace_provider_resources_list_field_item.py +2 -0
  55. waldur_api_client/models/marketplace_provider_resources_retrieve_field_item.py +2 -0
  56. waldur_api_client/models/marketplace_resources_details_retrieve_field_item.py +2 -0
  57. waldur_api_client/models/marketplace_resources_list_field_item.py +2 -0
  58. waldur_api_client/models/marketplace_resources_retrieve_field_item.py +2 -0
  59. waldur_api_client/models/open_stack_floating_ip.py +21 -0
  60. waldur_api_client/models/open_stack_port.py +15 -4
  61. waldur_api_client/models/open_stack_router.py +15 -4
  62. waldur_api_client/models/openstack_floating_ips_list_field_item.py +1 -0
  63. waldur_api_client/models/openstack_floating_ips_retrieve_field_item.py +1 -0
  64. waldur_api_client/models/operator_enum.py +12 -0
  65. waldur_api_client/models/patched_create_checklist_request.py +96 -0
  66. waldur_api_client/models/patched_question_admin_request.py +208 -0
  67. waldur_api_client/models/patched_question_dependency_request.py +94 -0
  68. waldur_api_client/models/patched_question_options_admin_request.py +68 -0
  69. waldur_api_client/models/{checklist_question.py → question.py} +29 -16
  70. waldur_api_client/models/question_admin.py +260 -0
  71. waldur_api_client/models/question_admin_request.py +210 -0
  72. waldur_api_client/models/question_dependency.py +127 -0
  73. waldur_api_client/models/question_dependency_request.py +94 -0
  74. waldur_api_client/models/question_options.py +79 -0
  75. waldur_api_client/models/question_options_admin.py +103 -0
  76. waldur_api_client/models/question_options_admin_request.py +78 -0
  77. waldur_api_client/models/question_type_enum.py +15 -0
  78. waldur_api_client/models/resource.py +18 -0
  79. waldur_api_client/models/rule.py +46 -6
  80. {waldur_api_client-7.7.0.dist-info → waldur_api_client-7.7.2.dist-info}/METADATA +1 -1
  81. {waldur_api_client-7.7.0.dist-info → waldur_api_client-7.7.2.dist-info}/RECORD +83 -37
  82. {waldur_api_client-7.7.0.dist-info → waldur_api_client-7.7.2.dist-info}/LICENSE +0 -0
  83. {waldur_api_client-7.7.0.dist-info → waldur_api_client-7.7.2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,212 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.question_dependency import QuestionDependency
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ depends_on_question_uuid: Union[Unset, UUID] = UNSET,
16
+ page: Union[Unset, int] = UNSET,
17
+ page_size: Union[Unset, int] = UNSET,
18
+ question_uuid: Union[Unset, UUID] = UNSET,
19
+ ) -> dict[str, Any]:
20
+ params: dict[str, Any] = {}
21
+
22
+ json_depends_on_question_uuid: Union[Unset, str] = UNSET
23
+ if not isinstance(depends_on_question_uuid, Unset):
24
+ json_depends_on_question_uuid = str(depends_on_question_uuid)
25
+ params["depends_on_question_uuid"] = json_depends_on_question_uuid
26
+
27
+ params["page"] = page
28
+
29
+ params["page_size"] = page_size
30
+
31
+ json_question_uuid: Union[Unset, str] = UNSET
32
+ if not isinstance(question_uuid, Unset):
33
+ json_question_uuid = str(question_uuid)
34
+ params["question_uuid"] = json_question_uuid
35
+
36
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
37
+
38
+ _kwargs: dict[str, Any] = {
39
+ "method": "get",
40
+ "url": "/api/marketplace-checklists-admin-question-dependencies/",
41
+ "params": params,
42
+ }
43
+
44
+ return _kwargs
45
+
46
+
47
+ def _parse_response(
48
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
+ ) -> list["QuestionDependency"]:
50
+ if response.status_code == 200:
51
+ response_200 = []
52
+ _response_200 = response.json()
53
+ for response_200_item_data in _response_200:
54
+ response_200_item = QuestionDependency.from_dict(response_200_item_data)
55
+
56
+ response_200.append(response_200_item)
57
+
58
+ return response_200
59
+ raise errors.UnexpectedStatus(response.status_code, response.content)
60
+
61
+
62
+ def _build_response(
63
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
64
+ ) -> Response[list["QuestionDependency"]]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ *,
75
+ client: AuthenticatedClient,
76
+ depends_on_question_uuid: Union[Unset, UUID] = UNSET,
77
+ page: Union[Unset, int] = UNSET,
78
+ page_size: Union[Unset, int] = UNSET,
79
+ question_uuid: Union[Unset, UUID] = UNSET,
80
+ ) -> Response[list["QuestionDependency"]]:
81
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
82
+
83
+ Args:
84
+ depends_on_question_uuid (Union[Unset, UUID]):
85
+ page (Union[Unset, int]):
86
+ page_size (Union[Unset, int]):
87
+ question_uuid (Union[Unset, UUID]):
88
+
89
+ Raises:
90
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
91
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
92
+
93
+ Returns:
94
+ Response[list['QuestionDependency']]
95
+ """
96
+
97
+ kwargs = _get_kwargs(
98
+ depends_on_question_uuid=depends_on_question_uuid,
99
+ page=page,
100
+ page_size=page_size,
101
+ question_uuid=question_uuid,
102
+ )
103
+
104
+ response = client.get_httpx_client().request(
105
+ **kwargs,
106
+ )
107
+
108
+ return _build_response(client=client, response=response)
109
+
110
+
111
+ def sync(
112
+ *,
113
+ client: AuthenticatedClient,
114
+ depends_on_question_uuid: Union[Unset, UUID] = UNSET,
115
+ page: Union[Unset, int] = UNSET,
116
+ page_size: Union[Unset, int] = UNSET,
117
+ question_uuid: Union[Unset, UUID] = UNSET,
118
+ ) -> list["QuestionDependency"]:
119
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
120
+
121
+ Args:
122
+ depends_on_question_uuid (Union[Unset, UUID]):
123
+ page (Union[Unset, int]):
124
+ page_size (Union[Unset, int]):
125
+ question_uuid (Union[Unset, UUID]):
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ list['QuestionDependency']
133
+ """
134
+
135
+ return sync_detailed(
136
+ client=client,
137
+ depends_on_question_uuid=depends_on_question_uuid,
138
+ page=page,
139
+ page_size=page_size,
140
+ question_uuid=question_uuid,
141
+ ).parsed
142
+
143
+
144
+ async def asyncio_detailed(
145
+ *,
146
+ client: AuthenticatedClient,
147
+ depends_on_question_uuid: Union[Unset, UUID] = UNSET,
148
+ page: Union[Unset, int] = UNSET,
149
+ page_size: Union[Unset, int] = UNSET,
150
+ question_uuid: Union[Unset, UUID] = UNSET,
151
+ ) -> Response[list["QuestionDependency"]]:
152
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
153
+
154
+ Args:
155
+ depends_on_question_uuid (Union[Unset, UUID]):
156
+ page (Union[Unset, int]):
157
+ page_size (Union[Unset, int]):
158
+ question_uuid (Union[Unset, UUID]):
159
+
160
+ Raises:
161
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
162
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
163
+
164
+ Returns:
165
+ Response[list['QuestionDependency']]
166
+ """
167
+
168
+ kwargs = _get_kwargs(
169
+ depends_on_question_uuid=depends_on_question_uuid,
170
+ page=page,
171
+ page_size=page_size,
172
+ question_uuid=question_uuid,
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
+ depends_on_question_uuid: Union[Unset, UUID] = UNSET,
184
+ page: Union[Unset, int] = UNSET,
185
+ page_size: Union[Unset, int] = UNSET,
186
+ question_uuid: Union[Unset, UUID] = UNSET,
187
+ ) -> list["QuestionDependency"]:
188
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
189
+
190
+ Args:
191
+ depends_on_question_uuid (Union[Unset, UUID]):
192
+ page (Union[Unset, int]):
193
+ page_size (Union[Unset, int]):
194
+ question_uuid (Union[Unset, UUID]):
195
+
196
+ Raises:
197
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
198
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
199
+
200
+ Returns:
201
+ list['QuestionDependency']
202
+ """
203
+
204
+ return (
205
+ await asyncio_detailed(
206
+ client=client,
207
+ depends_on_question_uuid=depends_on_question_uuid,
208
+ page=page,
209
+ page_size=page_size,
210
+ question_uuid=question_uuid,
211
+ )
212
+ ).parsed
@@ -0,0 +1,164 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.patched_question_dependency_request import PatchedQuestionDependencyRequest
10
+ from ...models.question_dependency import QuestionDependency
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: PatchedQuestionDependencyRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "patch",
23
+ "url": f"/api/marketplace-checklists-admin-question-dependencies/{uuid}/",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> QuestionDependency:
35
+ if response.status_code == 200:
36
+ response_200 = QuestionDependency.from_dict(response.json())
37
+
38
+ return response_200
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+
41
+
42
+ def _build_response(
43
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
+ ) -> Response[QuestionDependency]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ uuid: UUID,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ body: PatchedQuestionDependencyRequest,
58
+ ) -> Response[QuestionDependency]:
59
+ """
60
+ Args:
61
+ uuid (UUID):
62
+ body (PatchedQuestionDependencyRequest):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[QuestionDependency]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ uuid=uuid,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ uuid: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ body: PatchedQuestionDependencyRequest,
89
+ ) -> QuestionDependency:
90
+ """
91
+ Args:
92
+ uuid (UUID):
93
+ body (PatchedQuestionDependencyRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ QuestionDependency
101
+ """
102
+
103
+ return sync_detailed(
104
+ uuid=uuid,
105
+ client=client,
106
+ body=body,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ uuid: UUID,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ body: PatchedQuestionDependencyRequest,
115
+ ) -> Response[QuestionDependency]:
116
+ """
117
+ Args:
118
+ uuid (UUID):
119
+ body (PatchedQuestionDependencyRequest):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[QuestionDependency]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ uuid=uuid,
131
+ body=body,
132
+ )
133
+
134
+ response = await client.get_async_httpx_client().request(**kwargs)
135
+
136
+ return _build_response(client=client, response=response)
137
+
138
+
139
+ async def asyncio(
140
+ uuid: UUID,
141
+ *,
142
+ client: AuthenticatedClient,
143
+ body: PatchedQuestionDependencyRequest,
144
+ ) -> QuestionDependency:
145
+ """
146
+ Args:
147
+ uuid (UUID):
148
+ body (PatchedQuestionDependencyRequest):
149
+
150
+ Raises:
151
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
152
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
153
+
154
+ Returns:
155
+ QuestionDependency
156
+ """
157
+
158
+ return (
159
+ await asyncio_detailed(
160
+ uuid=uuid,
161
+ client=client,
162
+ body=body,
163
+ )
164
+ ).parsed
@@ -0,0 +1,142 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.question_dependency import QuestionDependency
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ uuid: UUID,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": f"/api/marketplace-checklists-admin-question-dependencies/{uuid}/",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> QuestionDependency:
25
+ if response.status_code == 200:
26
+ response_200 = QuestionDependency.from_dict(response.json())
27
+
28
+ return response_200
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+
31
+
32
+ def _build_response(
33
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
+ ) -> Response[QuestionDependency]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ uuid: UUID,
45
+ *,
46
+ client: AuthenticatedClient,
47
+ ) -> Response[QuestionDependency]:
48
+ """
49
+ Args:
50
+ uuid (UUID):
51
+
52
+ Raises:
53
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
54
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
55
+
56
+ Returns:
57
+ Response[QuestionDependency]
58
+ """
59
+
60
+ kwargs = _get_kwargs(
61
+ uuid=uuid,
62
+ )
63
+
64
+ response = client.get_httpx_client().request(
65
+ **kwargs,
66
+ )
67
+
68
+ return _build_response(client=client, response=response)
69
+
70
+
71
+ def sync(
72
+ uuid: UUID,
73
+ *,
74
+ client: AuthenticatedClient,
75
+ ) -> QuestionDependency:
76
+ """
77
+ Args:
78
+ uuid (UUID):
79
+
80
+ Raises:
81
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
82
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
83
+
84
+ Returns:
85
+ QuestionDependency
86
+ """
87
+
88
+ return sync_detailed(
89
+ uuid=uuid,
90
+ client=client,
91
+ ).parsed
92
+
93
+
94
+ async def asyncio_detailed(
95
+ uuid: UUID,
96
+ *,
97
+ client: AuthenticatedClient,
98
+ ) -> Response[QuestionDependency]:
99
+ """
100
+ Args:
101
+ uuid (UUID):
102
+
103
+ Raises:
104
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
105
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
106
+
107
+ Returns:
108
+ Response[QuestionDependency]
109
+ """
110
+
111
+ kwargs = _get_kwargs(
112
+ uuid=uuid,
113
+ )
114
+
115
+ response = await client.get_async_httpx_client().request(**kwargs)
116
+
117
+ return _build_response(client=client, response=response)
118
+
119
+
120
+ async def asyncio(
121
+ uuid: UUID,
122
+ *,
123
+ client: AuthenticatedClient,
124
+ ) -> QuestionDependency:
125
+ """
126
+ Args:
127
+ uuid (UUID):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ QuestionDependency
135
+ """
136
+
137
+ return (
138
+ await asyncio_detailed(
139
+ uuid=uuid,
140
+ client=client,
141
+ )
142
+ ).parsed
@@ -0,0 +1,164 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.question_dependency import QuestionDependency
10
+ from ...models.question_dependency_request import QuestionDependencyRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: QuestionDependencyRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "put",
23
+ "url": f"/api/marketplace-checklists-admin-question-dependencies/{uuid}/",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> QuestionDependency:
35
+ if response.status_code == 200:
36
+ response_200 = QuestionDependency.from_dict(response.json())
37
+
38
+ return response_200
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+
41
+
42
+ def _build_response(
43
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
+ ) -> Response[QuestionDependency]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ uuid: UUID,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ body: QuestionDependencyRequest,
58
+ ) -> Response[QuestionDependency]:
59
+ """
60
+ Args:
61
+ uuid (UUID):
62
+ body (QuestionDependencyRequest):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[QuestionDependency]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ uuid=uuid,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ uuid: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ body: QuestionDependencyRequest,
89
+ ) -> QuestionDependency:
90
+ """
91
+ Args:
92
+ uuid (UUID):
93
+ body (QuestionDependencyRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ QuestionDependency
101
+ """
102
+
103
+ return sync_detailed(
104
+ uuid=uuid,
105
+ client=client,
106
+ body=body,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ uuid: UUID,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ body: QuestionDependencyRequest,
115
+ ) -> Response[QuestionDependency]:
116
+ """
117
+ Args:
118
+ uuid (UUID):
119
+ body (QuestionDependencyRequest):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[QuestionDependency]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ uuid=uuid,
131
+ body=body,
132
+ )
133
+
134
+ response = await client.get_async_httpx_client().request(**kwargs)
135
+
136
+ return _build_response(client=client, response=response)
137
+
138
+
139
+ async def asyncio(
140
+ uuid: UUID,
141
+ *,
142
+ client: AuthenticatedClient,
143
+ body: QuestionDependencyRequest,
144
+ ) -> QuestionDependency:
145
+ """
146
+ Args:
147
+ uuid (UUID):
148
+ body (QuestionDependencyRequest):
149
+
150
+ Raises:
151
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
152
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
153
+
154
+ Returns:
155
+ QuestionDependency
156
+ """
157
+
158
+ return (
159
+ await asyncio_detailed(
160
+ uuid=uuid,
161
+ client=client,
162
+ body=body,
163
+ )
164
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""