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.

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