waldur-api-client 7.8.2__py3-none-any.whl → 7.8.4__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 (174) hide show
  1. waldur_api_client/api/booking_resources/booking_resources_count.py +18 -0
  2. waldur_api_client/api/booking_resources/booking_resources_list.py +18 -0
  3. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_count.py +125 -0
  4. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_retrieve.py +126 -0
  5. waldur_api_client/api/marketplace_project_update_requests/marketplace_project_update_requests_count.py +18 -18
  6. waldur_api_client/api/marketplace_project_update_requests/marketplace_project_update_requests_list.py +18 -18
  7. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_tos_stats_retrieve.py +146 -0
  8. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +18 -0
  9. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +18 -0
  10. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_move_resource.py +22 -0
  11. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_update_options.py +168 -0
  12. waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +18 -0
  13. waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +18 -0
  14. waldur_api_client/api/marketplace_resources/marketplace_resources_move_resource.py +22 -0
  15. waldur_api_client/api/marketplace_resources/marketplace_resources_renew.py +166 -0
  16. waldur_api_client/api/marketplace_service_providers/service_provider_checklists_summary.py +189 -0
  17. waldur_api_client/api/onboarding/__init__.py +1 -0
  18. waldur_api_client/api/onboarding/onboarding_supported_countries_retrieve.py +74 -0
  19. waldur_api_client/api/onboarding_justifications/__init__.py +1 -0
  20. waldur_api_client/api/onboarding_justifications/onboarding_justifications_attach_document.py +211 -0
  21. waldur_api_client/api/onboarding_justifications/onboarding_justifications_count.py +172 -0
  22. waldur_api_client/api/onboarding_justifications/onboarding_justifications_create.py +150 -0
  23. waldur_api_client/api/onboarding_justifications/onboarding_justifications_create_justification.py +154 -0
  24. waldur_api_client/api/onboarding_justifications/onboarding_justifications_destroy.py +89 -0
  25. waldur_api_client/api/onboarding_justifications/onboarding_justifications_list.py +175 -0
  26. waldur_api_client/api/onboarding_justifications/onboarding_justifications_partial_update.py +164 -0
  27. waldur_api_client/api/onboarding_justifications/onboarding_justifications_retrieve.py +142 -0
  28. waldur_api_client/api/onboarding_justifications/onboarding_justifications_update.py +164 -0
  29. waldur_api_client/api/onboarding_verifications/__init__.py +1 -0
  30. waldur_api_client/api/onboarding_verifications/onboarding_verifications_count.py +172 -0
  31. waldur_api_client/api/onboarding_verifications/onboarding_verifications_create.py +150 -0
  32. waldur_api_client/api/onboarding_verifications/onboarding_verifications_create_customer.py +144 -0
  33. waldur_api_client/api/onboarding_verifications/onboarding_verifications_destroy.py +89 -0
  34. waldur_api_client/api/onboarding_verifications/onboarding_verifications_list.py +175 -0
  35. waldur_api_client/api/onboarding_verifications/onboarding_verifications_partial_update.py +164 -0
  36. waldur_api_client/api/onboarding_verifications/onboarding_verifications_retrieve.py +142 -0
  37. waldur_api_client/api/onboarding_verifications/onboarding_verifications_update.py +164 -0
  38. waldur_api_client/api/onboarding_verifications/onboarding_verifications_validate_company.py +154 -0
  39. waldur_api_client/api/openstack_backups/openstack_backups_restore.py +10 -10
  40. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_count.py +33 -0
  41. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_create.py +154 -0
  42. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_destroy.py +91 -0
  43. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_list.py +33 -0
  44. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_partial_update.py +164 -0
  45. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_update.py +164 -0
  46. waldur_api_client/api/openstack_networks/openstack_networks_rbac_policy_create.py +24 -22
  47. waldur_api_client/api/projects/projects_checklist_template_count.py +125 -0
  48. waldur_api_client/api/projects/projects_checklist_template_retrieve.py +126 -0
  49. waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_count.py +125 -0
  50. waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_retrieve.py +126 -0
  51. waldur_api_client/api/proposal_protected_calls/proposal_protected_calls_offerings_list.py +15 -0
  52. waldur_api_client/api/rancher_services/rancher_services_create.py +22 -22
  53. waldur_api_client/models/__init__.py +88 -10
  54. waldur_api_client/models/azure_sql_server_create_order_attributes.py +5 -10
  55. waldur_api_client/models/azure_virtual_machine_create_order_attributes.py +7 -12
  56. waldur_api_client/models/booking_resource.py +9 -34
  57. waldur_api_client/models/booking_resources_list_field_item.py +1 -3
  58. waldur_api_client/models/booking_resources_retrieve_field_item.py +1 -3
  59. waldur_api_client/models/call_round.py +4 -4
  60. waldur_api_client/models/checklist_template.py +99 -0
  61. waldur_api_client/models/checklist_template_checklist.py +44 -0
  62. waldur_api_client/models/constance_settings.py +54 -0
  63. waldur_api_client/models/constance_settings_request.py +54 -0
  64. waldur_api_client/models/constance_settings_request_form.py +54 -0
  65. waldur_api_client/models/constance_settings_request_multipart.py +99 -0
  66. waldur_api_client/models/customer.py +9 -0
  67. waldur_api_client/models/customers_list_field_item.py +1 -0
  68. waldur_api_client/models/customers_retrieve_field_item.py +1 -0
  69. waldur_api_client/models/deprecated_network_rbac_policy.py +137 -0
  70. waldur_api_client/models/deprecated_network_rbac_policy_request.py +78 -0
  71. waldur_api_client/models/event_groups_enum.py +1 -0
  72. waldur_api_client/models/event_types_enum.py +3 -0
  73. waldur_api_client/models/generic_order_attributes.py +1 -2
  74. waldur_api_client/models/managed_rancher_cluster_resources_list_field_item.py +1 -3
  75. waldur_api_client/models/managed_rancher_cluster_resources_retrieve_field_item.py +1 -3
  76. waldur_api_client/models/marketplace_orders_list_field_item.py +1 -3
  77. waldur_api_client/models/marketplace_orders_retrieve_field_item.py +1 -3
  78. waldur_api_client/models/marketplace_provider_resources_details_retrieve_field_item.py +1 -3
  79. waldur_api_client/models/marketplace_provider_resources_list_field_item.py +1 -3
  80. waldur_api_client/models/marketplace_provider_resources_retrieve_field_item.py +1 -3
  81. waldur_api_client/models/marketplace_resources_details_retrieve_field_item.py +1 -3
  82. waldur_api_client/models/marketplace_resources_list_field_item.py +1 -3
  83. waldur_api_client/models/marketplace_resources_retrieve_field_item.py +1 -3
  84. waldur_api_client/models/marketplace_robot_accounts_list_field_item.py +2 -1
  85. waldur_api_client/models/marketplace_robot_accounts_retrieve_field_item.py +2 -1
  86. waldur_api_client/models/marketplace_service_providers_projects_list_field_item.py +1 -0
  87. waldur_api_client/models/merged_plugin_options.py +27 -0
  88. waldur_api_client/models/merged_plugin_options_request.py +27 -0
  89. waldur_api_client/models/move_resource_request.py +65 -0
  90. waldur_api_client/models/nested_round.py +5 -5
  91. waldur_api_client/models/network_rbac_policy_request.py +8 -0
  92. waldur_api_client/models/notification.py +9 -9
  93. waldur_api_client/models/{notification_context_fields.py → notification_context_schema.py} +6 -6
  94. waldur_api_client/models/notification_template_detail_serializers.py +9 -3
  95. waldur_api_client/models/offering_component.py +79 -0
  96. waldur_api_client/models/offering_component_request.py +80 -0
  97. waldur_api_client/models/onboarding_company_validation_request_request.py +88 -0
  98. waldur_api_client/models/onboarding_justification.py +183 -0
  99. waldur_api_client/models/onboarding_justification_create_request.py +68 -0
  100. waldur_api_client/models/onboarding_justification_documentation.py +108 -0
  101. waldur_api_client/models/onboarding_justification_documentation_request.py +84 -0
  102. waldur_api_client/models/onboarding_justification_documentation_request_form.py +84 -0
  103. waldur_api_client/models/onboarding_justification_documentation_request_multipart.py +98 -0
  104. waldur_api_client/models/onboarding_justification_request.py +75 -0
  105. waldur_api_client/models/onboarding_verification.py +250 -0
  106. waldur_api_client/models/onboarding_verification_request.py +128 -0
  107. waldur_api_client/models/onboarding_verification_status_enum.py +12 -0
  108. waldur_api_client/models/open_stack_backup_restoration.py +3 -5
  109. waldur_api_client/models/open_stack_backup_restoration_create_request.py +141 -0
  110. waldur_api_client/models/open_stack_backup_restoration_request.py +22 -30
  111. waldur_api_client/models/open_stack_create_floating_ip_request.py +89 -0
  112. waldur_api_client/models/open_stack_create_port_request.py +104 -0
  113. waldur_api_client/models/open_stack_instance.py +13 -29
  114. waldur_api_client/models/open_stack_instance_create_order_attributes.py +67 -54
  115. waldur_api_client/models/open_stack_instance_floating_i_ps_update_request.py +5 -5
  116. waldur_api_client/models/open_stack_instance_ports_update_request.py +5 -5
  117. waldur_api_client/models/open_stack_instance_request.py +1 -67
  118. waldur_api_client/models/open_stack_nested_port_request.py +0 -9
  119. waldur_api_client/models/{open_stack_nested_security_group_request.py → open_stack_security_group_hyperlink_request.py} +14 -14
  120. waldur_api_client/models/open_stack_server_group_hyperlink_request.py +59 -0
  121. waldur_api_client/models/open_stack_tenant_create_order_attributes.py +9 -14
  122. waldur_api_client/models/open_stack_volume_create_order_attributes.py +8 -13
  123. waldur_api_client/models/openstack_instances_list_field_item.py +0 -7
  124. waldur_api_client/models/openstack_instances_retrieve_field_item.py +0 -7
  125. waldur_api_client/models/order_create.py +8 -0
  126. waldur_api_client/models/order_details.py +9 -34
  127. waldur_api_client/models/patched_network_rbac_policy_request.py +85 -0
  128. waldur_api_client/models/patched_onboarding_justification_request.py +77 -0
  129. waldur_api_client/models/patched_onboarding_verification_request.py +128 -0
  130. waldur_api_client/models/patched_open_stack_instance_request.py +1 -67
  131. waldur_api_client/models/patched_project_credit_request.py +13 -0
  132. waldur_api_client/models/patched_project_request.py +1 -2
  133. waldur_api_client/models/patched_project_request_form.py +1 -2
  134. waldur_api_client/models/patched_project_request_multipart.py +1 -2
  135. waldur_api_client/models/project.py +10 -2
  136. waldur_api_client/models/project_credit.py +13 -0
  137. waldur_api_client/models/project_credit_request.py +13 -0
  138. waldur_api_client/models/{rancher_nested_security_group.py → project_hyperlink_request.py} +5 -5
  139. waldur_api_client/models/project_request.py +1 -2
  140. waldur_api_client/models/project_request_form.py +1 -2
  141. waldur_api_client/models/project_request_multipart.py +1 -2
  142. waldur_api_client/models/projects_list_field_item.py +1 -0
  143. waldur_api_client/models/projects_retrieve_field_item.py +1 -0
  144. waldur_api_client/models/protected_round.py +4 -4
  145. waldur_api_client/models/question.py +102 -0
  146. waldur_api_client/models/{open_stack_data_volume.py → question_options.py} +27 -29
  147. waldur_api_client/models/rancher_clusters_list_field_item.py +0 -1
  148. waldur_api_client/models/rancher_clusters_retrieve_field_item.py +0 -1
  149. waldur_api_client/models/rancher_service_create.py +508 -0
  150. waldur_api_client/models/rancher_service_create_marketplace_offering_plugin_options_type_0.py +44 -0
  151. waldur_api_client/models/rancher_service_create_request.py +185 -0
  152. waldur_api_client/models/rancher_service_request.py +16 -19
  153. waldur_api_client/models/rancher_workload_create.py +59 -0
  154. waldur_api_client/models/rancher_workload_create_request.py +59 -0
  155. waldur_api_client/models/resource.py +9 -34
  156. waldur_api_client/models/resource_renew_request.py +83 -0
  157. waldur_api_client/models/resource_renew_request_limits.py +44 -0
  158. waldur_api_client/models/robot_account_details.py +22 -13
  159. waldur_api_client/models/{status_enum.py → round_status.py} +1 -1
  160. waldur_api_client/models/service_provider_checklist_summary.py +98 -0
  161. waldur_api_client/models/slurm_invoices_slurm_package_create_order_attributes.py +4 -9
  162. waldur_api_client/models/time_series_to_s_data.py +69 -0
  163. waldur_api_client/models/to_s_consent_dashboard.py +155 -0
  164. waldur_api_client/models/update_offering_component_request.py +79 -0
  165. waldur_api_client/models/v_mware_virtual_machine_create_order_attributes.py +11 -16
  166. waldur_api_client/models/validation_decision_enum.py +10 -0
  167. waldur_api_client/models/validation_method_enum.py +8 -0
  168. waldur_api_client/models/version_adoption.py +67 -0
  169. waldur_api_client/models/vmware_nested_network.py +0 -25
  170. waldur_api_client/models/vmware_nested_network_request.py +6 -14
  171. {waldur_api_client-7.8.2.dist-info → waldur_api_client-7.8.4.dist-info}/METADATA +1 -1
  172. {waldur_api_client-7.8.2.dist-info → waldur_api_client-7.8.4.dist-info}/RECORD +174 -101
  173. {waldur_api_client-7.8.2.dist-info → waldur_api_client-7.8.4.dist-info}/WHEEL +0 -0
  174. {waldur_api_client-7.8.2.dist-info → waldur_api_client-7.8.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,189 @@
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.service_provider_checklist_summary import ServiceProviderChecklistSummary
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ service_provider_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-service-providers/{service_provider_uuid}/compliance/checklists_summary/",
30
+ "params": params,
31
+ }
32
+
33
+ return _kwargs
34
+
35
+
36
+ def _parse_response(
37
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
+ ) -> list["ServiceProviderChecklistSummary"]:
39
+ if response.status_code == 200:
40
+ response_200 = []
41
+ _response_200 = response.json()
42
+ for response_200_item_data in _response_200:
43
+ response_200_item = ServiceProviderChecklistSummary.from_dict(response_200_item_data)
44
+
45
+ response_200.append(response_200_item)
46
+
47
+ return response_200
48
+ raise errors.UnexpectedStatus(response.status_code, response.content)
49
+
50
+
51
+ def _build_response(
52
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
53
+ ) -> Response[list["ServiceProviderChecklistSummary"]]:
54
+ return Response(
55
+ status_code=HTTPStatus(response.status_code),
56
+ content=response.content,
57
+ headers=response.headers,
58
+ parsed=_parse_response(client=client, response=response),
59
+ )
60
+
61
+
62
+ def sync_detailed(
63
+ service_provider_uuid: UUID,
64
+ *,
65
+ client: AuthenticatedClient,
66
+ page: Union[Unset, int] = UNSET,
67
+ page_size: Union[Unset, int] = UNSET,
68
+ ) -> Response[list["ServiceProviderChecklistSummary"]]:
69
+ """Get summary of all compliance checklists used by this service provider with usage counts.
70
+
71
+ Args:
72
+ service_provider_uuid (UUID):
73
+ page (Union[Unset, int]):
74
+ page_size (Union[Unset, int]):
75
+
76
+ Raises:
77
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
78
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
79
+
80
+ Returns:
81
+ Response[list['ServiceProviderChecklistSummary']]
82
+ """
83
+
84
+ kwargs = _get_kwargs(
85
+ service_provider_uuid=service_provider_uuid,
86
+ page=page,
87
+ page_size=page_size,
88
+ )
89
+
90
+ response = client.get_httpx_client().request(
91
+ **kwargs,
92
+ )
93
+
94
+ return _build_response(client=client, response=response)
95
+
96
+
97
+ def sync(
98
+ service_provider_uuid: UUID,
99
+ *,
100
+ client: AuthenticatedClient,
101
+ page: Union[Unset, int] = UNSET,
102
+ page_size: Union[Unset, int] = UNSET,
103
+ ) -> list["ServiceProviderChecklistSummary"]:
104
+ """Get summary of all compliance checklists used by this service provider with usage counts.
105
+
106
+ Args:
107
+ service_provider_uuid (UUID):
108
+ page (Union[Unset, int]):
109
+ page_size (Union[Unset, int]):
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
+ list['ServiceProviderChecklistSummary']
117
+ """
118
+
119
+ return sync_detailed(
120
+ service_provider_uuid=service_provider_uuid,
121
+ client=client,
122
+ page=page,
123
+ page_size=page_size,
124
+ ).parsed
125
+
126
+
127
+ async def asyncio_detailed(
128
+ service_provider_uuid: UUID,
129
+ *,
130
+ client: AuthenticatedClient,
131
+ page: Union[Unset, int] = UNSET,
132
+ page_size: Union[Unset, int] = UNSET,
133
+ ) -> Response[list["ServiceProviderChecklistSummary"]]:
134
+ """Get summary of all compliance checklists used by this service provider with usage counts.
135
+
136
+ Args:
137
+ service_provider_uuid (UUID):
138
+ page (Union[Unset, int]):
139
+ page_size (Union[Unset, int]):
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Response[list['ServiceProviderChecklistSummary']]
147
+ """
148
+
149
+ kwargs = _get_kwargs(
150
+ service_provider_uuid=service_provider_uuid,
151
+ page=page,
152
+ page_size=page_size,
153
+ )
154
+
155
+ response = await client.get_async_httpx_client().request(**kwargs)
156
+
157
+ return _build_response(client=client, response=response)
158
+
159
+
160
+ async def asyncio(
161
+ service_provider_uuid: UUID,
162
+ *,
163
+ client: AuthenticatedClient,
164
+ page: Union[Unset, int] = UNSET,
165
+ page_size: Union[Unset, int] = UNSET,
166
+ ) -> list["ServiceProviderChecklistSummary"]:
167
+ """Get summary of all compliance checklists used by this service provider with usage counts.
168
+
169
+ Args:
170
+ service_provider_uuid (UUID):
171
+ page (Union[Unset, int]):
172
+ page_size (Union[Unset, int]):
173
+
174
+ Raises:
175
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
176
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
177
+
178
+ Returns:
179
+ list['ServiceProviderChecklistSummary']
180
+ """
181
+
182
+ return (
183
+ await asyncio_detailed(
184
+ service_provider_uuid=service_provider_uuid,
185
+ client=client,
186
+ page=page,
187
+ page_size=page_size,
188
+ )
189
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,74 @@
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 ...types import Response
9
+
10
+
11
+ def _get_kwargs() -> dict[str, Any]:
12
+ _kwargs: dict[str, Any] = {
13
+ "method": "get",
14
+ "url": "/api/onboarding/supported-countries/",
15
+ }
16
+
17
+ return _kwargs
18
+
19
+
20
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Any:
21
+ raise errors.UnexpectedStatus(response.status_code, response.content)
22
+
23
+
24
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
25
+ return Response(
26
+ status_code=HTTPStatus(response.status_code),
27
+ content=response.content,
28
+ headers=response.headers,
29
+ parsed=_parse_response(client=client, response=response),
30
+ )
31
+
32
+
33
+ def sync_detailed(
34
+ *,
35
+ client: AuthenticatedClient,
36
+ ) -> Response[Any]:
37
+ """Return list of supported countries for validation.
38
+
39
+ Raises:
40
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
41
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
42
+
43
+ Returns:
44
+ Response[Any]
45
+ """
46
+
47
+ kwargs = _get_kwargs()
48
+
49
+ response = client.get_httpx_client().request(
50
+ **kwargs,
51
+ )
52
+
53
+ return _build_response(client=client, response=response)
54
+
55
+
56
+ async def asyncio_detailed(
57
+ *,
58
+ client: AuthenticatedClient,
59
+ ) -> Response[Any]:
60
+ """Return list of supported countries for validation.
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[Any]
68
+ """
69
+
70
+ kwargs = _get_kwargs()
71
+
72
+ response = await client.get_async_httpx_client().request(**kwargs)
73
+
74
+ return _build_response(client=client, response=response)
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,211 @@
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.onboarding_justification_documentation import OnboardingJustificationDocumentation
10
+ from ...models.onboarding_justification_documentation_request import OnboardingJustificationDocumentationRequest
11
+ from ...models.onboarding_justification_documentation_request_form import (
12
+ OnboardingJustificationDocumentationRequestForm,
13
+ )
14
+ from ...models.onboarding_justification_documentation_request_multipart import (
15
+ OnboardingJustificationDocumentationRequestMultipart,
16
+ )
17
+ from ...types import Response
18
+
19
+
20
+ def _get_kwargs(
21
+ uuid: UUID,
22
+ *,
23
+ body: Union[
24
+ OnboardingJustificationDocumentationRequest,
25
+ OnboardingJustificationDocumentationRequestForm,
26
+ OnboardingJustificationDocumentationRequestMultipart,
27
+ ],
28
+ ) -> dict[str, Any]:
29
+ headers: dict[str, Any] = {}
30
+
31
+ _kwargs: dict[str, Any] = {
32
+ "method": "post",
33
+ "url": f"/api/onboarding-justifications/{uuid}/attach_document/",
34
+ }
35
+
36
+ if isinstance(body, OnboardingJustificationDocumentationRequest):
37
+ _kwargs["json"] = body.to_dict()
38
+
39
+ headers["Content-Type"] = "application/json"
40
+ if isinstance(body, OnboardingJustificationDocumentationRequestForm):
41
+ _kwargs["data"] = body.to_dict()
42
+
43
+ headers["Content-Type"] = "application/x-www-form-urlencoded"
44
+ if isinstance(body, OnboardingJustificationDocumentationRequestMultipart):
45
+ _kwargs["files"] = body.to_multipart()
46
+
47
+ _kwargs["headers"] = headers
48
+ return _kwargs
49
+
50
+
51
+ def _parse_response(
52
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
53
+ ) -> OnboardingJustificationDocumentation:
54
+ if response.status_code == 200:
55
+ response_200 = OnboardingJustificationDocumentation.from_dict(response.json())
56
+
57
+ return response_200
58
+ raise errors.UnexpectedStatus(response.status_code, response.content)
59
+
60
+
61
+ def _build_response(
62
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
63
+ ) -> Response[OnboardingJustificationDocumentation]:
64
+ return Response(
65
+ status_code=HTTPStatus(response.status_code),
66
+ content=response.content,
67
+ headers=response.headers,
68
+ parsed=_parse_response(client=client, response=response),
69
+ )
70
+
71
+
72
+ def sync_detailed(
73
+ uuid: UUID,
74
+ *,
75
+ client: AuthenticatedClient,
76
+ body: Union[
77
+ OnboardingJustificationDocumentationRequest,
78
+ OnboardingJustificationDocumentationRequestForm,
79
+ OnboardingJustificationDocumentationRequestMultipart,
80
+ ],
81
+ ) -> Response[OnboardingJustificationDocumentation]:
82
+ """Attach supporting document to justification.
83
+
84
+ Args:
85
+ uuid (UUID):
86
+ body (OnboardingJustificationDocumentationRequest):
87
+ body (OnboardingJustificationDocumentationRequestForm):
88
+ body (OnboardingJustificationDocumentationRequestMultipart):
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
+ Response[OnboardingJustificationDocumentation]
96
+ """
97
+
98
+ kwargs = _get_kwargs(
99
+ uuid=uuid,
100
+ body=body,
101
+ )
102
+
103
+ response = client.get_httpx_client().request(
104
+ **kwargs,
105
+ )
106
+
107
+ return _build_response(client=client, response=response)
108
+
109
+
110
+ def sync(
111
+ uuid: UUID,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ body: Union[
115
+ OnboardingJustificationDocumentationRequest,
116
+ OnboardingJustificationDocumentationRequestForm,
117
+ OnboardingJustificationDocumentationRequestMultipart,
118
+ ],
119
+ ) -> OnboardingJustificationDocumentation:
120
+ """Attach supporting document to justification.
121
+
122
+ Args:
123
+ uuid (UUID):
124
+ body (OnboardingJustificationDocumentationRequest):
125
+ body (OnboardingJustificationDocumentationRequestForm):
126
+ body (OnboardingJustificationDocumentationRequestMultipart):
127
+
128
+ Raises:
129
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
130
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
131
+
132
+ Returns:
133
+ OnboardingJustificationDocumentation
134
+ """
135
+
136
+ return sync_detailed(
137
+ uuid=uuid,
138
+ client=client,
139
+ body=body,
140
+ ).parsed
141
+
142
+
143
+ async def asyncio_detailed(
144
+ uuid: UUID,
145
+ *,
146
+ client: AuthenticatedClient,
147
+ body: Union[
148
+ OnboardingJustificationDocumentationRequest,
149
+ OnboardingJustificationDocumentationRequestForm,
150
+ OnboardingJustificationDocumentationRequestMultipart,
151
+ ],
152
+ ) -> Response[OnboardingJustificationDocumentation]:
153
+ """Attach supporting document to justification.
154
+
155
+ Args:
156
+ uuid (UUID):
157
+ body (OnboardingJustificationDocumentationRequest):
158
+ body (OnboardingJustificationDocumentationRequestForm):
159
+ body (OnboardingJustificationDocumentationRequestMultipart):
160
+
161
+ Raises:
162
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
163
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
164
+
165
+ Returns:
166
+ Response[OnboardingJustificationDocumentation]
167
+ """
168
+
169
+ kwargs = _get_kwargs(
170
+ uuid=uuid,
171
+ body=body,
172
+ )
173
+
174
+ response = await client.get_async_httpx_client().request(**kwargs)
175
+
176
+ return _build_response(client=client, response=response)
177
+
178
+
179
+ async def asyncio(
180
+ uuid: UUID,
181
+ *,
182
+ client: AuthenticatedClient,
183
+ body: Union[
184
+ OnboardingJustificationDocumentationRequest,
185
+ OnboardingJustificationDocumentationRequestForm,
186
+ OnboardingJustificationDocumentationRequestMultipart,
187
+ ],
188
+ ) -> OnboardingJustificationDocumentation:
189
+ """Attach supporting document to justification.
190
+
191
+ Args:
192
+ uuid (UUID):
193
+ body (OnboardingJustificationDocumentationRequest):
194
+ body (OnboardingJustificationDocumentationRequestForm):
195
+ body (OnboardingJustificationDocumentationRequestMultipart):
196
+
197
+ Raises:
198
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
199
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
200
+
201
+ Returns:
202
+ OnboardingJustificationDocumentation
203
+ """
204
+
205
+ return (
206
+ await asyncio_detailed(
207
+ uuid=uuid,
208
+ client=client,
209
+ body=body,
210
+ )
211
+ ).parsed
@@ -0,0 +1,172 @@
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 ...types import UNSET, Response, Unset
9
+
10
+
11
+ def _get_kwargs(
12
+ *,
13
+ page: Union[Unset, int] = UNSET,
14
+ page_size: Union[Unset, int] = UNSET,
15
+ ) -> dict[str, Any]:
16
+ params: dict[str, Any] = {}
17
+
18
+ params["page"] = page
19
+
20
+ params["page_size"] = page_size
21
+
22
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
23
+
24
+ _kwargs: dict[str, Any] = {
25
+ "method": "head",
26
+ "url": "/api/onboarding-justifications/",
27
+ "params": params,
28
+ }
29
+
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> int:
34
+ if response.status_code == HTTPStatus.OK:
35
+ try:
36
+ return int(response.headers["x-result-count"])
37
+ except KeyError:
38
+ raise errors.UnexpectedStatus(
39
+ response.status_code, b"Expected 'X-Result-Count' header for HEAD request, but it was not found."
40
+ )
41
+ except ValueError:
42
+ count_val = response.headers.get("x-result-count")
43
+ msg = f"Expected 'X-Result-Count' header to be an integer, but got '{count_val}'."
44
+ raise errors.UnexpectedStatus(response.status_code, msg.encode())
45
+ raise errors.UnexpectedStatus(response.status_code, response.content)
46
+
47
+
48
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
49
+ return Response(
50
+ status_code=HTTPStatus(response.status_code),
51
+ content=response.content,
52
+ headers=response.headers,
53
+ parsed=_parse_response(client=client, response=response),
54
+ )
55
+
56
+
57
+ def sync_detailed(
58
+ *,
59
+ client: AuthenticatedClient,
60
+ page: Union[Unset, int] = UNSET,
61
+ page_size: Union[Unset, int] = UNSET,
62
+ ) -> Response[int]:
63
+ """Get number of items in the collection matching the request parameters.
64
+
65
+ Args:
66
+ page (Union[Unset, int]):
67
+ page_size (Union[Unset, int]):
68
+
69
+ Raises:
70
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
71
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
72
+
73
+ Returns:
74
+ Response[int]
75
+ """
76
+
77
+ kwargs = _get_kwargs(
78
+ page=page,
79
+ page_size=page_size,
80
+ )
81
+
82
+ response = client.get_httpx_client().request(
83
+ **kwargs,
84
+ )
85
+
86
+ return _build_response(client=client, response=response)
87
+
88
+
89
+ def sync(
90
+ *,
91
+ client: AuthenticatedClient,
92
+ page: Union[Unset, int] = UNSET,
93
+ page_size: Union[Unset, int] = UNSET,
94
+ ) -> int:
95
+ """Get number of items in the collection matching the request parameters.
96
+
97
+ Args:
98
+ page (Union[Unset, int]):
99
+ page_size (Union[Unset, int]):
100
+
101
+ Raises:
102
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
103
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
104
+
105
+ Returns:
106
+ int
107
+ """
108
+
109
+ return sync_detailed(
110
+ client=client,
111
+ page=page,
112
+ page_size=page_size,
113
+ ).parsed
114
+
115
+
116
+ async def asyncio_detailed(
117
+ *,
118
+ client: AuthenticatedClient,
119
+ page: Union[Unset, int] = UNSET,
120
+ page_size: Union[Unset, int] = UNSET,
121
+ ) -> Response[int]:
122
+ """Get number of items in the collection matching the request parameters.
123
+
124
+ Args:
125
+ page (Union[Unset, int]):
126
+ page_size (Union[Unset, int]):
127
+
128
+ Raises:
129
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
130
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
131
+
132
+ Returns:
133
+ Response[int]
134
+ """
135
+
136
+ kwargs = _get_kwargs(
137
+ page=page,
138
+ page_size=page_size,
139
+ )
140
+
141
+ response = await client.get_async_httpx_client().request(**kwargs)
142
+
143
+ return _build_response(client=client, response=response)
144
+
145
+
146
+ async def asyncio(
147
+ *,
148
+ client: AuthenticatedClient,
149
+ page: Union[Unset, int] = UNSET,
150
+ page_size: Union[Unset, int] = UNSET,
151
+ ) -> int:
152
+ """Get number of items in the collection matching the request parameters.
153
+
154
+ Args:
155
+ page (Union[Unset, int]):
156
+ page_size (Union[Unset, int]):
157
+
158
+ Raises:
159
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
160
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
161
+
162
+ Returns:
163
+ int
164
+ """
165
+
166
+ return (
167
+ await asyncio_detailed(
168
+ client=client,
169
+ page=page,
170
+ page_size=page_size,
171
+ )
172
+ ).parsed