waldur-api-client 7.7.6__py3-none-any.whl → 7.7.7__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 (143) hide show
  1. waldur_api_client/api/booking_resources/booking_resources_count.py +34 -11
  2. waldur_api_client/api/booking_resources/booking_resources_list.py +34 -11
  3. waldur_api_client/api/customers/customers_project_metadata_compliance_details_list.py +189 -0
  4. waldur_api_client/api/customers/customers_project_metadata_compliance_overview_list.py +189 -0
  5. waldur_api_client/api/customers/customers_project_metadata_compliance_projects_list.py +187 -0
  6. waldur_api_client/api/customers/customers_project_metadata_question_answers_list.py +187 -0
  7. waldur_api_client/api/marketplace_integration_statuses/marketplace_integration_statuses_count.py +34 -11
  8. waldur_api_client/api/marketplace_integration_statuses/marketplace_integration_statuses_list.py +34 -11
  9. waldur_api_client/api/marketplace_offering_files/marketplace_offering_files_count.py +34 -11
  10. waldur_api_client/api/marketplace_offering_files/marketplace_offering_files_list.py +34 -11
  11. waldur_api_client/api/marketplace_offering_terms_of_service/__init__.py +1 -0
  12. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_count.py +274 -0
  13. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_create.py +152 -0
  14. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_destroy.py +89 -0
  15. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_list.py +277 -0
  16. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_partial_update.py +164 -0
  17. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_retrieve.py +142 -0
  18. waldur_api_client/api/marketplace_offering_terms_of_service/marketplace_offering_terms_of_service_update.py +164 -0
  19. waldur_api_client/api/marketplace_offering_user_roles/marketplace_offering_user_roles_count.py +34 -11
  20. waldur_api_client/api/marketplace_offering_user_roles/marketplace_offering_user_roles_list.py +34 -11
  21. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_count.py +34 -11
  22. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_list.py +34 -11
  23. waldur_api_client/api/marketplace_orders/marketplace_orders_count.py +19 -0
  24. waldur_api_client/api/marketplace_orders/marketplace_orders_list.py +19 -0
  25. waldur_api_client/api/marketplace_plans/marketplace_plans_count.py +19 -0
  26. waldur_api_client/api/marketplace_plans/marketplace_plans_list.py +19 -0
  27. waldur_api_client/api/marketplace_plans/marketplace_plans_usage_stats_count.py +19 -0
  28. waldur_api_client/api/marketplace_plans/marketplace_plans_usage_stats_list.py +19 -0
  29. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +34 -11
  30. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +34 -11
  31. waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +34 -11
  32. waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +34 -11
  33. waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_count.py +34 -11
  34. waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_list.py +34 -11
  35. waldur_api_client/api/marketplace_user_offering_consents/__init__.py +1 -0
  36. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_count.py +307 -0
  37. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_create.py +152 -0
  38. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_destroy.py +89 -0
  39. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_list.py +310 -0
  40. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_partial_update.py +164 -0
  41. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_retrieve.py +142 -0
  42. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_revoke.py +146 -0
  43. waldur_api_client/api/marketplace_user_offering_consents/marketplace_user_offering_consents_update.py +164 -0
  44. waldur_api_client/api/remote_waldur_api/remote_waldur_api_remote_resource_order_status_retrieve.py +145 -0
  45. waldur_api_client/api/remote_waldur_api/remote_waldur_api_remote_resource_status_retrieve.py +147 -0
  46. waldur_api_client/api/remote_waldur_api/remote_waldur_api_remote_resource_team_status_list.py +188 -0
  47. waldur_api_client/models/__init__.py +62 -0
  48. waldur_api_client/models/azure_sql_server_create_order_attributes.py +3 -0
  49. waldur_api_client/models/azure_virtual_machine_create_order_attributes.py +3 -0
  50. waldur_api_client/models/booking_offerings_list_field_item.py +0 -2
  51. waldur_api_client/models/booking_offerings_retrieve_field_item.py +0 -2
  52. waldur_api_client/models/booking_resource.py +10 -9
  53. waldur_api_client/models/booking_resources_list_field_item.py +1 -1
  54. waldur_api_client/models/booking_resources_retrieve_field_item.py +1 -1
  55. waldur_api_client/models/checklist_info.py +76 -0
  56. waldur_api_client/models/compliance_overview.py +91 -0
  57. waldur_api_client/models/customer.py +81 -0
  58. waldur_api_client/models/customers_list_field_item.py +4 -0
  59. waldur_api_client/models/customers_retrieve_field_item.py +4 -0
  60. waldur_api_client/models/generic_order_attributes.py +69 -0
  61. waldur_api_client/models/google_auth_authorize_retrieve_field_item.py +1 -0
  62. waldur_api_client/models/google_auth_list_field_item.py +1 -0
  63. waldur_api_client/models/google_auth_retrieve_field_item.py +1 -0
  64. waldur_api_client/models/google_credentials.py +9 -0
  65. waldur_api_client/models/group_invitation.py +24 -0
  66. waldur_api_client/models/group_invitation_request.py +10 -0
  67. waldur_api_client/models/maintenance_announcement.py +8 -0
  68. waldur_api_client/models/marketplace_offering_terms_of_service_count_o_item.py +13 -0
  69. waldur_api_client/models/marketplace_offering_terms_of_service_list_o_item.py +13 -0
  70. waldur_api_client/models/marketplace_orders_list_field_item.py +1 -1
  71. waldur_api_client/models/marketplace_orders_retrieve_field_item.py +1 -1
  72. waldur_api_client/models/marketplace_provider_offerings_list_customer_service_accounts_retrieve_field_item.py +0 -2
  73. waldur_api_client/models/marketplace_provider_offerings_list_field_item.py +0 -2
  74. waldur_api_client/models/marketplace_provider_offerings_list_project_service_accounts_retrieve_field_item.py +0 -2
  75. waldur_api_client/models/marketplace_provider_offerings_retrieve_field_item.py +0 -2
  76. waldur_api_client/models/marketplace_provider_offerings_stats_retrieve_field_item.py +0 -2
  77. waldur_api_client/models/marketplace_provider_offerings_user_has_resource_access_retrieve_field_item.py +0 -2
  78. waldur_api_client/models/marketplace_provider_resources_details_retrieve_field_item.py +1 -1
  79. waldur_api_client/models/marketplace_provider_resources_list_field_item.py +1 -1
  80. waldur_api_client/models/marketplace_provider_resources_retrieve_field_item.py +1 -1
  81. waldur_api_client/models/marketplace_public_offerings_list_field_item.py +0 -2
  82. waldur_api_client/models/marketplace_public_offerings_retrieve_field_item.py +0 -2
  83. waldur_api_client/models/marketplace_rancher_create_order_attributes.py +3 -0
  84. waldur_api_client/models/marketplace_resources_details_retrieve_field_item.py +1 -1
  85. waldur_api_client/models/marketplace_resources_list_field_item.py +1 -1
  86. waldur_api_client/models/marketplace_resources_retrieve_field_item.py +1 -1
  87. waldur_api_client/models/marketplace_service_providers_list_field_item.py +1 -0
  88. waldur_api_client/models/marketplace_service_providers_retrieve_field_item.py +1 -0
  89. waldur_api_client/models/marketplace_user_offering_consents_count_o_item.py +15 -0
  90. waldur_api_client/models/marketplace_user_offering_consents_list_o_item.py +15 -0
  91. waldur_api_client/models/offering.py +0 -18
  92. waldur_api_client/models/offering_create.py +0 -18
  93. waldur_api_client/models/offering_create_request.py +0 -18
  94. waldur_api_client/models/offering_overview_update_request.py +0 -18
  95. waldur_api_client/models/offering_terms_of_service.py +142 -0
  96. waldur_api_client/models/offering_terms_of_service_create.py +107 -0
  97. waldur_api_client/models/offering_terms_of_service_create_request.py +107 -0
  98. waldur_api_client/models/offering_terms_of_service_request.py +96 -0
  99. waldur_api_client/models/open_stack_instance_create_order_attributes.py +3 -0
  100. waldur_api_client/models/open_stack_nested_security_group.py +53 -1
  101. waldur_api_client/models/open_stack_nested_security_group_rules_item.py +197 -0
  102. waldur_api_client/models/open_stack_network.py +20 -0
  103. waldur_api_client/models/open_stack_security_group_rule_update_request.py +4 -4
  104. waldur_api_client/models/open_stack_tenant.py +38 -0
  105. waldur_api_client/models/open_stack_tenant_create_order_attributes.py +21 -0
  106. waldur_api_client/models/open_stack_volume_create_order_attributes.py +3 -0
  107. waldur_api_client/models/openstack_networks_list_field_item.py +1 -0
  108. waldur_api_client/models/openstack_networks_retrieve_field_item.py +1 -0
  109. waldur_api_client/models/openstack_tenants_list_field_item.py +3 -0
  110. waldur_api_client/models/openstack_tenants_retrieve_field_item.py +3 -0
  111. waldur_api_client/models/order_create.py +0 -8
  112. waldur_api_client/models/order_create_request.py +23 -7
  113. waldur_api_client/models/order_details.py +0 -9
  114. waldur_api_client/models/patched_offering_terms_of_service_request.py +96 -0
  115. waldur_api_client/models/patched_user_offering_consent_request.py +59 -0
  116. waldur_api_client/models/permission_project.py +147 -0
  117. waldur_api_client/models/project_answer.py +122 -0
  118. waldur_api_client/models/project_detail.py +133 -0
  119. waldur_api_client/models/project_details_response.py +115 -0
  120. waldur_api_client/models/provider_offering_details.py +0 -18
  121. waldur_api_client/models/provider_offering_details_request.py +0 -18
  122. waldur_api_client/models/public_offering_details.py +0 -18
  123. waldur_api_client/models/question_answer.py +176 -0
  124. waldur_api_client/models/question_answer_project_answers_item.py +44 -0
  125. waldur_api_client/models/question_answer_question_options_item.py +44 -0
  126. waldur_api_client/models/remote_resource_order.py +88 -0
  127. waldur_api_client/models/remote_resource_order_remote_state_enum.py +15 -0
  128. waldur_api_client/models/remote_resource_sync_status.py +123 -0
  129. waldur_api_client/models/remote_resource_sync_status_remote_state_enum.py +13 -0
  130. waldur_api_client/models/remote_resource_team_member.py +85 -0
  131. waldur_api_client/models/resource.py +10 -9
  132. waldur_api_client/models/service_provider.py +9 -0
  133. waldur_api_client/models/slurm_invoices_slurm_package_create_order_attributes.py +3 -0
  134. waldur_api_client/models/sync_status_enum.py +10 -0
  135. waldur_api_client/models/user_offering_consent.py +202 -0
  136. waldur_api_client/models/user_offering_consent_create.py +60 -0
  137. waldur_api_client/models/user_offering_consent_create_request.py +60 -0
  138. waldur_api_client/models/user_offering_consent_request.py +59 -0
  139. waldur_api_client/models/v_mware_virtual_machine_create_order_attributes.py +3 -0
  140. {waldur_api_client-7.7.6.dist-info → waldur_api_client-7.7.7.dist-info}/METADATA +1 -1
  141. {waldur_api_client-7.7.6.dist-info → waldur_api_client-7.7.7.dist-info}/RECORD +143 -88
  142. {waldur_api_client-7.7.6.dist-info → waldur_api_client-7.7.7.dist-info}/LICENSE +0 -0
  143. {waldur_api_client-7.7.6.dist-info → waldur_api_client-7.7.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,307 @@
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.marketplace_user_offering_consents_count_o_item import MarketplaceUserOfferingConsentsCountOItem
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ has_consent: Union[Unset, bool] = UNSET,
16
+ o: Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]] = UNSET,
17
+ offering: Union[Unset, str] = UNSET,
18
+ offering_uuid: Union[Unset, UUID] = UNSET,
19
+ page: Union[Unset, int] = UNSET,
20
+ page_size: Union[Unset, int] = UNSET,
21
+ requires_reconsent: Union[Unset, bool] = UNSET,
22
+ user: Union[Unset, str] = UNSET,
23
+ user_uuid: Union[Unset, UUID] = UNSET,
24
+ version: Union[Unset, str] = UNSET,
25
+ ) -> dict[str, Any]:
26
+ params: dict[str, Any] = {}
27
+
28
+ params["has_consent"] = has_consent
29
+
30
+ json_o: Union[Unset, list[str]] = UNSET
31
+ if not isinstance(o, Unset):
32
+ json_o = []
33
+ for o_item_data in o:
34
+ o_item = o_item_data.value
35
+ json_o.append(o_item)
36
+
37
+ params["o"] = json_o
38
+
39
+ params["offering"] = offering
40
+
41
+ json_offering_uuid: Union[Unset, str] = UNSET
42
+ if not isinstance(offering_uuid, Unset):
43
+ json_offering_uuid = str(offering_uuid)
44
+ params["offering_uuid"] = json_offering_uuid
45
+
46
+ params["page"] = page
47
+
48
+ params["page_size"] = page_size
49
+
50
+ params["requires_reconsent"] = requires_reconsent
51
+
52
+ params["user"] = user
53
+
54
+ json_user_uuid: Union[Unset, str] = UNSET
55
+ if not isinstance(user_uuid, Unset):
56
+ json_user_uuid = str(user_uuid)
57
+ params["user_uuid"] = json_user_uuid
58
+
59
+ params["version"] = version
60
+
61
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
62
+
63
+ _kwargs: dict[str, Any] = {
64
+ "method": "head",
65
+ "url": "/api/marketplace-user-offering-consents/",
66
+ "params": params,
67
+ }
68
+
69
+ return _kwargs
70
+
71
+
72
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> int:
73
+ if response.status_code == HTTPStatus.OK:
74
+ try:
75
+ return int(response.headers["x-result-count"])
76
+ except KeyError:
77
+ raise errors.UnexpectedStatus(
78
+ response.status_code, b"Expected 'X-Result-Count' header for HEAD request, but it was not found."
79
+ )
80
+ except ValueError:
81
+ count_val = response.headers.get("x-result-count")
82
+ msg = f"Expected 'X-Result-Count' header to be an integer, but got '{count_val}'."
83
+ raise errors.UnexpectedStatus(response.status_code, msg.encode())
84
+ raise errors.UnexpectedStatus(response.status_code, response.content)
85
+
86
+
87
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
88
+ return Response(
89
+ status_code=HTTPStatus(response.status_code),
90
+ content=response.content,
91
+ headers=response.headers,
92
+ parsed=_parse_response(client=client, response=response),
93
+ )
94
+
95
+
96
+ def sync_detailed(
97
+ *,
98
+ client: AuthenticatedClient,
99
+ has_consent: Union[Unset, bool] = UNSET,
100
+ o: Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]] = UNSET,
101
+ offering: Union[Unset, str] = UNSET,
102
+ offering_uuid: Union[Unset, UUID] = UNSET,
103
+ page: Union[Unset, int] = UNSET,
104
+ page_size: Union[Unset, int] = UNSET,
105
+ requires_reconsent: Union[Unset, bool] = UNSET,
106
+ user: Union[Unset, str] = UNSET,
107
+ user_uuid: Union[Unset, UUID] = UNSET,
108
+ version: Union[Unset, str] = UNSET,
109
+ ) -> Response[int]:
110
+ """Get number of items in the collection matching the request parameters.
111
+
112
+ Args:
113
+ has_consent (Union[Unset, bool]):
114
+ o (Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]]):
115
+ offering (Union[Unset, str]):
116
+ offering_uuid (Union[Unset, UUID]):
117
+ page (Union[Unset, int]):
118
+ page_size (Union[Unset, int]):
119
+ requires_reconsent (Union[Unset, bool]):
120
+ user (Union[Unset, str]):
121
+ user_uuid (Union[Unset, UUID]):
122
+ version (Union[Unset, str]):
123
+
124
+ Raises:
125
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
126
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
127
+
128
+ Returns:
129
+ Response[int]
130
+ """
131
+
132
+ kwargs = _get_kwargs(
133
+ has_consent=has_consent,
134
+ o=o,
135
+ offering=offering,
136
+ offering_uuid=offering_uuid,
137
+ page=page,
138
+ page_size=page_size,
139
+ requires_reconsent=requires_reconsent,
140
+ user=user,
141
+ user_uuid=user_uuid,
142
+ version=version,
143
+ )
144
+
145
+ response = client.get_httpx_client().request(
146
+ **kwargs,
147
+ )
148
+
149
+ return _build_response(client=client, response=response)
150
+
151
+
152
+ def sync(
153
+ *,
154
+ client: AuthenticatedClient,
155
+ has_consent: Union[Unset, bool] = UNSET,
156
+ o: Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]] = UNSET,
157
+ offering: Union[Unset, str] = UNSET,
158
+ offering_uuid: Union[Unset, UUID] = UNSET,
159
+ page: Union[Unset, int] = UNSET,
160
+ page_size: Union[Unset, int] = UNSET,
161
+ requires_reconsent: Union[Unset, bool] = UNSET,
162
+ user: Union[Unset, str] = UNSET,
163
+ user_uuid: Union[Unset, UUID] = UNSET,
164
+ version: Union[Unset, str] = UNSET,
165
+ ) -> int:
166
+ """Get number of items in the collection matching the request parameters.
167
+
168
+ Args:
169
+ has_consent (Union[Unset, bool]):
170
+ o (Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]]):
171
+ offering (Union[Unset, str]):
172
+ offering_uuid (Union[Unset, UUID]):
173
+ page (Union[Unset, int]):
174
+ page_size (Union[Unset, int]):
175
+ requires_reconsent (Union[Unset, bool]):
176
+ user (Union[Unset, str]):
177
+ user_uuid (Union[Unset, UUID]):
178
+ version (Union[Unset, str]):
179
+
180
+ Raises:
181
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
182
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
183
+
184
+ Returns:
185
+ int
186
+ """
187
+
188
+ return sync_detailed(
189
+ client=client,
190
+ has_consent=has_consent,
191
+ o=o,
192
+ offering=offering,
193
+ offering_uuid=offering_uuid,
194
+ page=page,
195
+ page_size=page_size,
196
+ requires_reconsent=requires_reconsent,
197
+ user=user,
198
+ user_uuid=user_uuid,
199
+ version=version,
200
+ ).parsed
201
+
202
+
203
+ async def asyncio_detailed(
204
+ *,
205
+ client: AuthenticatedClient,
206
+ has_consent: Union[Unset, bool] = UNSET,
207
+ o: Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]] = UNSET,
208
+ offering: Union[Unset, str] = UNSET,
209
+ offering_uuid: Union[Unset, UUID] = UNSET,
210
+ page: Union[Unset, int] = UNSET,
211
+ page_size: Union[Unset, int] = UNSET,
212
+ requires_reconsent: Union[Unset, bool] = UNSET,
213
+ user: Union[Unset, str] = UNSET,
214
+ user_uuid: Union[Unset, UUID] = UNSET,
215
+ version: Union[Unset, str] = UNSET,
216
+ ) -> Response[int]:
217
+ """Get number of items in the collection matching the request parameters.
218
+
219
+ Args:
220
+ has_consent (Union[Unset, bool]):
221
+ o (Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]]):
222
+ offering (Union[Unset, str]):
223
+ offering_uuid (Union[Unset, UUID]):
224
+ page (Union[Unset, int]):
225
+ page_size (Union[Unset, int]):
226
+ requires_reconsent (Union[Unset, bool]):
227
+ user (Union[Unset, str]):
228
+ user_uuid (Union[Unset, UUID]):
229
+ version (Union[Unset, str]):
230
+
231
+ Raises:
232
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
233
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
234
+
235
+ Returns:
236
+ Response[int]
237
+ """
238
+
239
+ kwargs = _get_kwargs(
240
+ has_consent=has_consent,
241
+ o=o,
242
+ offering=offering,
243
+ offering_uuid=offering_uuid,
244
+ page=page,
245
+ page_size=page_size,
246
+ requires_reconsent=requires_reconsent,
247
+ user=user,
248
+ user_uuid=user_uuid,
249
+ version=version,
250
+ )
251
+
252
+ response = await client.get_async_httpx_client().request(**kwargs)
253
+
254
+ return _build_response(client=client, response=response)
255
+
256
+
257
+ async def asyncio(
258
+ *,
259
+ client: AuthenticatedClient,
260
+ has_consent: Union[Unset, bool] = UNSET,
261
+ o: Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]] = UNSET,
262
+ offering: Union[Unset, str] = UNSET,
263
+ offering_uuid: Union[Unset, UUID] = UNSET,
264
+ page: Union[Unset, int] = UNSET,
265
+ page_size: Union[Unset, int] = UNSET,
266
+ requires_reconsent: Union[Unset, bool] = UNSET,
267
+ user: Union[Unset, str] = UNSET,
268
+ user_uuid: Union[Unset, UUID] = UNSET,
269
+ version: Union[Unset, str] = UNSET,
270
+ ) -> int:
271
+ """Get number of items in the collection matching the request parameters.
272
+
273
+ Args:
274
+ has_consent (Union[Unset, bool]):
275
+ o (Union[Unset, list[MarketplaceUserOfferingConsentsCountOItem]]):
276
+ offering (Union[Unset, str]):
277
+ offering_uuid (Union[Unset, UUID]):
278
+ page (Union[Unset, int]):
279
+ page_size (Union[Unset, int]):
280
+ requires_reconsent (Union[Unset, bool]):
281
+ user (Union[Unset, str]):
282
+ user_uuid (Union[Unset, UUID]):
283
+ version (Union[Unset, str]):
284
+
285
+ Raises:
286
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
287
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
288
+
289
+ Returns:
290
+ int
291
+ """
292
+
293
+ return (
294
+ await asyncio_detailed(
295
+ client=client,
296
+ has_consent=has_consent,
297
+ o=o,
298
+ offering=offering,
299
+ offering_uuid=offering_uuid,
300
+ page=page,
301
+ page_size=page_size,
302
+ requires_reconsent=requires_reconsent,
303
+ user=user,
304
+ user_uuid=user_uuid,
305
+ version=version,
306
+ )
307
+ ).parsed
@@ -0,0 +1,152 @@
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.user_offering_consent_create import UserOfferingConsentCreate
9
+ from ...models.user_offering_consent_create_request import UserOfferingConsentCreateRequest
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ body: UserOfferingConsentCreateRequest,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "post",
21
+ "url": "/api/marketplace-user-offering-consents/",
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(
33
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
+ ) -> UserOfferingConsentCreate:
35
+ if response.status_code == 201:
36
+ response_201 = UserOfferingConsentCreate.from_dict(response.json())
37
+
38
+ return response_201
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[UserOfferingConsentCreate]:
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
+ *,
55
+ client: AuthenticatedClient,
56
+ body: UserOfferingConsentCreateRequest,
57
+ ) -> Response[UserOfferingConsentCreate]:
58
+ """
59
+ Args:
60
+ body (UserOfferingConsentCreateRequest):
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[UserOfferingConsentCreate]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ body=body,
72
+ )
73
+
74
+ response = client.get_httpx_client().request(
75
+ **kwargs,
76
+ )
77
+
78
+ return _build_response(client=client, response=response)
79
+
80
+
81
+ def sync(
82
+ *,
83
+ client: AuthenticatedClient,
84
+ body: UserOfferingConsentCreateRequest,
85
+ ) -> UserOfferingConsentCreate:
86
+ """
87
+ Args:
88
+ body (UserOfferingConsentCreateRequest):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ UserOfferingConsentCreate
96
+ """
97
+
98
+ return sync_detailed(
99
+ client=client,
100
+ body=body,
101
+ ).parsed
102
+
103
+
104
+ async def asyncio_detailed(
105
+ *,
106
+ client: AuthenticatedClient,
107
+ body: UserOfferingConsentCreateRequest,
108
+ ) -> Response[UserOfferingConsentCreate]:
109
+ """
110
+ Args:
111
+ body (UserOfferingConsentCreateRequest):
112
+
113
+ Raises:
114
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
115
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
116
+
117
+ Returns:
118
+ Response[UserOfferingConsentCreate]
119
+ """
120
+
121
+ kwargs = _get_kwargs(
122
+ body=body,
123
+ )
124
+
125
+ response = await client.get_async_httpx_client().request(**kwargs)
126
+
127
+ return _build_response(client=client, response=response)
128
+
129
+
130
+ async def asyncio(
131
+ *,
132
+ client: AuthenticatedClient,
133
+ body: UserOfferingConsentCreateRequest,
134
+ ) -> UserOfferingConsentCreate:
135
+ """
136
+ Args:
137
+ body (UserOfferingConsentCreateRequest):
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
+ UserOfferingConsentCreate
145
+ """
146
+
147
+ return (
148
+ await asyncio_detailed(
149
+ client=client,
150
+ body=body,
151
+ )
152
+ ).parsed
@@ -0,0 +1,89 @@
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 ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ uuid: UUID,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/api/marketplace-user-offering-consents/{uuid}/",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Any:
24
+ if response.status_code == 204:
25
+ return None
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+
28
+
29
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
30
+ return Response(
31
+ status_code=HTTPStatus(response.status_code),
32
+ content=response.content,
33
+ headers=response.headers,
34
+ parsed=_parse_response(client=client, response=response),
35
+ )
36
+
37
+
38
+ def sync_detailed(
39
+ uuid: UUID,
40
+ *,
41
+ client: AuthenticatedClient,
42
+ ) -> Response[Any]:
43
+ """
44
+ Args:
45
+ uuid (UUID):
46
+
47
+ Raises:
48
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
49
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
50
+
51
+ Returns:
52
+ Response[Any]
53
+ """
54
+
55
+ kwargs = _get_kwargs(
56
+ uuid=uuid,
57
+ )
58
+
59
+ response = client.get_httpx_client().request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(client=client, response=response)
64
+
65
+
66
+ async def asyncio_detailed(
67
+ uuid: UUID,
68
+ *,
69
+ client: AuthenticatedClient,
70
+ ) -> Response[Any]:
71
+ """
72
+ Args:
73
+ uuid (UUID):
74
+
75
+ Raises:
76
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
77
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
78
+
79
+ Returns:
80
+ Response[Any]
81
+ """
82
+
83
+ kwargs = _get_kwargs(
84
+ uuid=uuid,
85
+ )
86
+
87
+ response = await client.get_async_httpx_client().request(**kwargs)
88
+
89
+ return _build_response(client=client, response=response)