waldur-api-client 7.8.3__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.
- waldur_api_client/api/booking_resources/booking_resources_count.py +18 -0
- waldur_api_client/api/booking_resources/booking_resources_list.py +18 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_count.py +125 -0
- waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_retrieve.py +126 -0
- waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_tos_stats_retrieve.py +146 -0
- waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +18 -0
- waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +18 -0
- waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_update_options.py +168 -0
- waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +18 -0
- waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +18 -0
- waldur_api_client/api/marketplace_resources/marketplace_resources_renew.py +166 -0
- waldur_api_client/api/marketplace_service_providers/service_provider_checklists_summary.py +189 -0
- waldur_api_client/api/onboarding/__init__.py +1 -0
- waldur_api_client/api/onboarding/onboarding_supported_countries_retrieve.py +74 -0
- waldur_api_client/api/onboarding_justifications/__init__.py +1 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_attach_document.py +211 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_count.py +172 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_create.py +150 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_create_justification.py +154 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_destroy.py +89 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_list.py +175 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_partial_update.py +164 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_retrieve.py +142 -0
- waldur_api_client/api/onboarding_justifications/onboarding_justifications_update.py +164 -0
- waldur_api_client/api/onboarding_verifications/__init__.py +1 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_count.py +172 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_create.py +150 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_create_customer.py +144 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_destroy.py +89 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_list.py +175 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_partial_update.py +164 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_retrieve.py +142 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_update.py +164 -0
- waldur_api_client/api/onboarding_verifications/onboarding_verifications_validate_company.py +154 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_count.py +33 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_create.py +154 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_destroy.py +91 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_list.py +33 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_partial_update.py +164 -0
- waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_update.py +164 -0
- waldur_api_client/api/openstack_networks/openstack_networks_rbac_policy_create.py +24 -22
- waldur_api_client/api/projects/projects_checklist_template_count.py +125 -0
- waldur_api_client/api/projects/projects_checklist_template_retrieve.py +126 -0
- waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_count.py +125 -0
- waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_retrieve.py +126 -0
- waldur_api_client/api/proposal_protected_calls/proposal_protected_calls_offerings_list.py +15 -0
- waldur_api_client/models/__init__.py +62 -4
- waldur_api_client/models/booking_resource.py +4 -11
- waldur_api_client/models/call_round.py +4 -4
- waldur_api_client/models/checklist_template.py +99 -0
- waldur_api_client/models/checklist_template_checklist.py +44 -0
- waldur_api_client/models/constance_settings.py +45 -0
- waldur_api_client/models/constance_settings_request.py +45 -0
- waldur_api_client/models/constance_settings_request_form.py +45 -0
- waldur_api_client/models/constance_settings_request_multipart.py +85 -0
- waldur_api_client/models/customer.py +9 -0
- waldur_api_client/models/customers_list_field_item.py +1 -0
- waldur_api_client/models/customers_retrieve_field_item.py +1 -0
- waldur_api_client/models/deprecated_network_rbac_policy.py +137 -0
- waldur_api_client/models/deprecated_network_rbac_policy_request.py +78 -0
- waldur_api_client/models/event_types_enum.py +1 -0
- waldur_api_client/models/marketplace_service_providers_projects_list_field_item.py +1 -0
- waldur_api_client/models/merged_plugin_options.py +18 -0
- waldur_api_client/models/merged_plugin_options_request.py +18 -0
- waldur_api_client/models/nested_round.py +5 -5
- waldur_api_client/models/network_rbac_policy_request.py +8 -0
- waldur_api_client/models/notification.py +9 -9
- waldur_api_client/models/{notification_context_fields.py → notification_context_schema.py} +6 -6
- waldur_api_client/models/notification_template_detail_serializers.py +9 -3
- waldur_api_client/models/offering_component.py +79 -0
- waldur_api_client/models/offering_component_request.py +80 -0
- waldur_api_client/models/onboarding_company_validation_request_request.py +88 -0
- waldur_api_client/models/onboarding_justification.py +183 -0
- waldur_api_client/models/onboarding_justification_create_request.py +68 -0
- waldur_api_client/models/onboarding_justification_documentation.py +108 -0
- waldur_api_client/models/onboarding_justification_documentation_request.py +84 -0
- waldur_api_client/models/onboarding_justification_documentation_request_form.py +84 -0
- waldur_api_client/models/onboarding_justification_documentation_request_multipart.py +98 -0
- waldur_api_client/models/onboarding_justification_request.py +75 -0
- waldur_api_client/models/onboarding_verification.py +250 -0
- waldur_api_client/models/onboarding_verification_request.py +128 -0
- waldur_api_client/models/onboarding_verification_status_enum.py +12 -0
- waldur_api_client/models/open_stack_create_floating_ip_request.py +20 -1
- waldur_api_client/models/order_create.py +4 -4
- waldur_api_client/models/order_details.py +4 -11
- waldur_api_client/models/patched_network_rbac_policy_request.py +85 -0
- waldur_api_client/models/patched_onboarding_justification_request.py +77 -0
- waldur_api_client/models/patched_onboarding_verification_request.py +128 -0
- waldur_api_client/models/patched_project_credit_request.py +13 -0
- waldur_api_client/models/patched_project_request.py +1 -2
- waldur_api_client/models/patched_project_request_form.py +1 -2
- waldur_api_client/models/patched_project_request_multipart.py +1 -2
- waldur_api_client/models/project.py +10 -2
- waldur_api_client/models/project_credit.py +13 -0
- waldur_api_client/models/project_credit_request.py +13 -0
- waldur_api_client/models/project_request.py +1 -2
- waldur_api_client/models/project_request_form.py +1 -2
- waldur_api_client/models/project_request_multipart.py +1 -2
- waldur_api_client/models/projects_list_field_item.py +1 -0
- waldur_api_client/models/projects_retrieve_field_item.py +1 -0
- waldur_api_client/models/protected_round.py +4 -4
- waldur_api_client/models/question.py +102 -0
- waldur_api_client/models/question_options.py +79 -0
- waldur_api_client/models/resource.py +4 -11
- waldur_api_client/models/resource_renew_request.py +83 -0
- waldur_api_client/models/resource_renew_request_limits.py +44 -0
- waldur_api_client/models/{status_enum.py → round_status.py} +1 -1
- waldur_api_client/models/service_provider_checklist_summary.py +98 -0
- waldur_api_client/models/time_series_to_s_data.py +69 -0
- waldur_api_client/models/to_s_consent_dashboard.py +155 -0
- waldur_api_client/models/update_offering_component_request.py +79 -0
- waldur_api_client/models/validation_decision_enum.py +10 -0
- waldur_api_client/models/validation_method_enum.py +8 -0
- waldur_api_client/models/version_adoption.py +67 -0
- {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/METADATA +1 -1
- {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/RECORD +118 -54
- {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/WHEEL +0 -0
- {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -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-verifications/",
|
|
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
|
|
@@ -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.onboarding_verification import OnboardingVerification
|
|
9
|
+
from ...models.onboarding_verification_request import OnboardingVerificationRequest
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: OnboardingVerificationRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/api/onboarding-verifications/",
|
|
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) -> OnboardingVerification:
|
|
33
|
+
if response.status_code == 201:
|
|
34
|
+
response_201 = OnboardingVerification.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[OnboardingVerification]:
|
|
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: OnboardingVerificationRequest,
|
|
55
|
+
) -> Response[OnboardingVerification]:
|
|
56
|
+
"""
|
|
57
|
+
Args:
|
|
58
|
+
body (OnboardingVerificationRequest):
|
|
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[OnboardingVerification]
|
|
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: OnboardingVerificationRequest,
|
|
83
|
+
) -> OnboardingVerification:
|
|
84
|
+
"""
|
|
85
|
+
Args:
|
|
86
|
+
body (OnboardingVerificationRequest):
|
|
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
|
+
OnboardingVerification
|
|
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: OnboardingVerificationRequest,
|
|
106
|
+
) -> Response[OnboardingVerification]:
|
|
107
|
+
"""
|
|
108
|
+
Args:
|
|
109
|
+
body (OnboardingVerificationRequest):
|
|
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[OnboardingVerification]
|
|
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: OnboardingVerificationRequest,
|
|
132
|
+
) -> OnboardingVerification:
|
|
133
|
+
"""
|
|
134
|
+
Args:
|
|
135
|
+
body (OnboardingVerificationRequest):
|
|
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
|
+
OnboardingVerification
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
await asyncio_detailed(
|
|
147
|
+
client=client,
|
|
148
|
+
body=body,
|
|
149
|
+
)
|
|
150
|
+
).parsed
|
|
@@ -0,0 +1,144 @@
|
|
|
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.customer import Customer
|
|
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": "post",
|
|
18
|
+
"url": f"/api/onboarding-verifications/{uuid}/create_customer/",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Customer:
|
|
25
|
+
if response.status_code == 201:
|
|
26
|
+
response_201 = Customer.from_dict(response.json())
|
|
27
|
+
|
|
28
|
+
return response_201
|
|
29
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Customer]:
|
|
33
|
+
return Response(
|
|
34
|
+
status_code=HTTPStatus(response.status_code),
|
|
35
|
+
content=response.content,
|
|
36
|
+
headers=response.headers,
|
|
37
|
+
parsed=_parse_response(client=client, response=response),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def sync_detailed(
|
|
42
|
+
uuid: UUID,
|
|
43
|
+
*,
|
|
44
|
+
client: AuthenticatedClient,
|
|
45
|
+
) -> Response[Customer]:
|
|
46
|
+
"""Create customer from successful verification.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
uuid (UUID):
|
|
50
|
+
|
|
51
|
+
Raises:
|
|
52
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
53
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
Response[Customer]
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
kwargs = _get_kwargs(
|
|
60
|
+
uuid=uuid,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
response = client.get_httpx_client().request(
|
|
64
|
+
**kwargs,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return _build_response(client=client, response=response)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def sync(
|
|
71
|
+
uuid: UUID,
|
|
72
|
+
*,
|
|
73
|
+
client: AuthenticatedClient,
|
|
74
|
+
) -> Customer:
|
|
75
|
+
"""Create customer from successful verification.
|
|
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
|
+
Customer
|
|
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[Customer]:
|
|
99
|
+
"""Create customer from successful verification.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
uuid (UUID):
|
|
103
|
+
|
|
104
|
+
Raises:
|
|
105
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
106
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
Response[Customer]
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
kwargs = _get_kwargs(
|
|
113
|
+
uuid=uuid,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
117
|
+
|
|
118
|
+
return _build_response(client=client, response=response)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
async def asyncio(
|
|
122
|
+
uuid: UUID,
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient,
|
|
125
|
+
) -> Customer:
|
|
126
|
+
"""Create customer from successful verification.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
uuid (UUID):
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Customer
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
await asyncio_detailed(
|
|
141
|
+
uuid=uuid,
|
|
142
|
+
client=client,
|
|
143
|
+
)
|
|
144
|
+
).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/onboarding-verifications/{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)
|