qcs_api_client 0.27.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.
- qcs_api_client/__init__.py +1 -0
- qcs_api_client/api/__init__.py +1 -0
- qcs_api_client/api/account/__init__.py +1 -0
- qcs_api_client/api/account/activate_user.py +155 -0
- qcs_api_client/api/account/add_group_user.py +156 -0
- qcs_api_client/api/account/dismiss_viewer_announcement.py +145 -0
- qcs_api_client/api/account/get_group_balance.py +149 -0
- qcs_api_client/api/account/get_group_billing_customer.py +145 -0
- qcs_api_client/api/account/get_group_upcoming_billing_invoice.py +145 -0
- qcs_api_client/api/account/get_user_balance.py +149 -0
- qcs_api_client/api/account/get_user_billing_customer.py +145 -0
- qcs_api_client/api/account/get_user_event_billing_price.py +170 -0
- qcs_api_client/api/account/get_user_upcoming_billing_invoice.py +145 -0
- qcs_api_client/api/account/get_viewer_user_onboarding_completed.py +124 -0
- qcs_api_client/api/account/list_group_billing_invoice_lines.py +189 -0
- qcs_api_client/api/account/list_group_billing_invoices.py +177 -0
- qcs_api_client/api/account/list_group_upcoming_billing_invoice_lines.py +177 -0
- qcs_api_client/api/account/list_group_users.py +185 -0
- qcs_api_client/api/account/list_user_billing_invoice_lines.py +189 -0
- qcs_api_client/api/account/list_user_billing_invoices.py +177 -0
- qcs_api_client/api/account/list_user_groups.py +181 -0
- qcs_api_client/api/account/list_user_upcoming_billing_invoice_lines.py +177 -0
- qcs_api_client/api/account/list_viewer_announcements.py +178 -0
- qcs_api_client/api/account/put_viewer_user_onboarding_completed.py +150 -0
- qcs_api_client/api/account/remove_group_user.py +158 -0
- qcs_api_client/api/account/update_viewer_user_profile.py +150 -0
- qcs_api_client/api/authentication/__init__.py +1 -0
- qcs_api_client/api/authentication/auth_email_password_reset_token.py +153 -0
- qcs_api_client/api/authentication/auth_get_user.py +128 -0
- qcs_api_client/api/authentication/auth_reset_password.py +152 -0
- qcs_api_client/api/authentication/auth_reset_password_with_token.py +154 -0
- qcs_api_client/api/client_applications/__init__.py +1 -0
- qcs_api_client/api/client_applications/check_client_application.py +154 -0
- qcs_api_client/api/client_applications/get_client_application.py +151 -0
- qcs_api_client/api/client_applications/list_client_applications.py +129 -0
- qcs_api_client/api/default/__init__.py +1 -0
- qcs_api_client/api/default/get_health.py +123 -0
- qcs_api_client/api/default/health_check.py +124 -0
- qcs_api_client/api/default/health_check_deprecated.py +126 -0
- qcs_api_client/api/endpoints/__init__.py +1 -0
- qcs_api_client/api/endpoints/create_endpoint.py +157 -0
- qcs_api_client/api/endpoints/delete_endpoint.py +148 -0
- qcs_api_client/api/endpoints/get_default_endpoint.py +154 -0
- qcs_api_client/api/endpoints/get_endpoint.py +150 -0
- qcs_api_client/api/endpoints/list_endpoints.py +182 -0
- qcs_api_client/api/endpoints/restart_endpoint.py +168 -0
- qcs_api_client/api/engagements/__init__.py +1 -0
- qcs_api_client/api/engagements/create_engagement.py +196 -0
- qcs_api_client/api/quantum_processors/__init__.py +1 -0
- qcs_api_client/api/quantum_processors/get_instruction_set_architecture.py +144 -0
- qcs_api_client/api/quantum_processors/get_quantum_processor.py +148 -0
- qcs_api_client/api/quantum_processors/get_quantum_processor_accessors.py +150 -0
- qcs_api_client/api/quantum_processors/list_instruction_set_architectures.py +164 -0
- qcs_api_client/api/quantum_processors/list_quantum_processors.py +170 -0
- qcs_api_client/api/reservations/__init__.py +1 -0
- qcs_api_client/api/reservations/create_reservation.py +200 -0
- qcs_api_client/api/reservations/delete_reservation.py +149 -0
- qcs_api_client/api/reservations/find_available_reservations.py +211 -0
- qcs_api_client/api/reservations/get_quantum_processor_calendar.py +149 -0
- qcs_api_client/api/reservations/get_reservation.py +149 -0
- qcs_api_client/api/reservations/list_group_reservations.py +309 -0
- qcs_api_client/api/reservations/list_reservations.py +335 -0
- qcs_api_client/client/__init__.py +12 -0
- qcs_api_client/client/auth.py +78 -0
- qcs_api_client/client/client.py +48 -0
- qcs_api_client/errors.py +16 -0
- qcs_api_client/models/__init__.py +185 -0
- qcs_api_client/models/account_balance.py +72 -0
- qcs_api_client/models/account_type.py +9 -0
- qcs_api_client/models/activate_user_request.py +93 -0
- qcs_api_client/models/add_group_user_request.py +95 -0
- qcs_api_client/models/announcement.py +97 -0
- qcs_api_client/models/announcements_response.py +93 -0
- qcs_api_client/models/architecture.py +134 -0
- qcs_api_client/models/auth_email_password_reset_token_request.py +69 -0
- qcs_api_client/models/auth_reset_password_request.py +77 -0
- qcs_api_client/models/auth_reset_password_with_token_request.py +78 -0
- qcs_api_client/models/available_reservation.py +104 -0
- qcs_api_client/models/billing_customer.py +78 -0
- qcs_api_client/models/billing_invoice.py +130 -0
- qcs_api_client/models/billing_invoice_line.py +165 -0
- qcs_api_client/models/billing_invoice_line_line_item_type.py +9 -0
- qcs_api_client/models/billing_invoice_line_metadata.py +55 -0
- qcs_api_client/models/billing_invoice_status.py +12 -0
- qcs_api_client/models/billing_price.py +234 -0
- qcs_api_client/models/billing_price_object.py +8 -0
- qcs_api_client/models/billing_price_price_type.py +9 -0
- qcs_api_client/models/billing_price_recurrence.py +124 -0
- qcs_api_client/models/billing_price_recurrence_aggregate_usage.py +11 -0
- qcs_api_client/models/billing_price_recurrence_interval.py +11 -0
- qcs_api_client/models/billing_price_recurrence_usage_type.py +9 -0
- qcs_api_client/models/billing_price_scheme.py +9 -0
- qcs_api_client/models/billing_price_tiers_mode.py +9 -0
- qcs_api_client/models/billing_product.py +109 -0
- qcs_api_client/models/billing_product_object.py +8 -0
- qcs_api_client/models/billing_upcoming_invoice.py +122 -0
- qcs_api_client/models/characteristic.py +125 -0
- qcs_api_client/models/check_client_application_request.py +77 -0
- qcs_api_client/models/check_client_application_response.py +85 -0
- qcs_api_client/models/checksum_description.py +78 -0
- qcs_api_client/models/checksum_description_type.py +8 -0
- qcs_api_client/models/client_application.py +130 -0
- qcs_api_client/models/client_applications_download_link.py +100 -0
- qcs_api_client/models/code.py +17 -0
- qcs_api_client/models/create_endpoint_parameters.py +93 -0
- qcs_api_client/models/create_engagement_request.py +116 -0
- qcs_api_client/models/create_reservation_request.py +124 -0
- qcs_api_client/models/dictionary.py +55 -0
- qcs_api_client/models/edge.py +78 -0
- qcs_api_client/models/endpoint.py +140 -0
- qcs_api_client/models/endpoint_addresses.py +77 -0
- qcs_api_client/models/engagement_credentials.py +87 -0
- qcs_api_client/models/engagement_with_credentials.py +169 -0
- qcs_api_client/models/error.py +112 -0
- qcs_api_client/models/event_billing_price_rate.py +107 -0
- qcs_api_client/models/family.py +11 -0
- qcs_api_client/models/find_available_reservations_response.py +92 -0
- qcs_api_client/models/get_account_event_billing_price_request.py +81 -0
- qcs_api_client/models/group.py +112 -0
- qcs_api_client/models/health.py +69 -0
- qcs_api_client/models/instruction_set_architecture.py +142 -0
- qcs_api_client/models/invite_user_request.py +87 -0
- qcs_api_client/models/list_account_billing_invoice_lines_response.py +92 -0
- qcs_api_client/models/list_account_billing_invoices_response.py +92 -0
- qcs_api_client/models/list_client_applications_response.py +83 -0
- qcs_api_client/models/list_endpoints_response.py +93 -0
- qcs_api_client/models/list_group_reservations_show_deleted.py +9 -0
- qcs_api_client/models/list_group_users_response.py +92 -0
- qcs_api_client/models/list_groups_response.py +92 -0
- qcs_api_client/models/list_instruction_set_architecture_response.py +94 -0
- qcs_api_client/models/list_quantum_processor_accessors_response.py +92 -0
- qcs_api_client/models/list_quantum_processors_response.py +92 -0
- qcs_api_client/models/list_reservations_response.py +91 -0
- qcs_api_client/models/list_reservations_show_deleted.py +9 -0
- qcs_api_client/models/node.py +76 -0
- qcs_api_client/models/nomad_job_datacenters.py +10 -0
- qcs_api_client/models/operation.py +138 -0
- qcs_api_client/models/operation_site.py +93 -0
- qcs_api_client/models/parameter.py +70 -0
- qcs_api_client/models/product.py +10 -0
- qcs_api_client/models/quantum_processor.py +70 -0
- qcs_api_client/models/quantum_processor_accessor.py +112 -0
- qcs_api_client/models/quantum_processor_accessor_type.py +9 -0
- qcs_api_client/models/quantum_processor_calendar.py +69 -0
- qcs_api_client/models/remove_group_user_request.py +95 -0
- qcs_api_client/models/reservation.py +218 -0
- qcs_api_client/models/restart_endpoint_request.py +67 -0
- qcs_api_client/models/tier.py +113 -0
- qcs_api_client/models/update_viewer_user_profile_request.py +85 -0
- qcs_api_client/models/user.py +110 -0
- qcs_api_client/models/user_credentials.py +75 -0
- qcs_api_client/models/user_credentials_password.py +69 -0
- qcs_api_client/models/user_profile.py +93 -0
- qcs_api_client/models/validation_error.py +89 -0
- qcs_api_client/models/validation_error_in.py +11 -0
- qcs_api_client/models/validation_location.py +11 -0
- qcs_api_client/models/viewer_user_onboarding_completed.py +69 -0
- qcs_api_client/operations/__init__.py +8 -0
- qcs_api_client/operations/asyncio/__init__.py +121 -0
- qcs_api_client/operations/asyncio_from_dict/__init__.py +139 -0
- qcs_api_client/operations/sync/__init__.py +117 -0
- qcs_api_client/operations/sync_from_dict/__init__.py +133 -0
- qcs_api_client/py.typed +1 -0
- qcs_api_client/types.py +74 -0
- qcs_api_client/util/__init__.py +0 -0
- qcs_api_client/util/errors.py +32 -0
- qcs_api_client/util/retry.py +26 -0
- qcs_api_client/util/serialization.py +5 -0
- qcs_api_client-0.27.3.dist-info/METADATA +101 -0
- qcs_api_client-0.27.3.dist-info/RECORD +172 -0
- qcs_api_client-0.27.3.dist-info/WHEEL +4 -0
- qcs_api_client-0.27.3.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.error import Error
|
|
7
|
+
from ...models.update_viewer_user_profile_request import UpdateViewerUserProfileRequest
|
|
8
|
+
from ...models.user import User
|
|
9
|
+
from ...types import Response
|
|
10
|
+
from ...util.errors import QCSHTTPStatusError
|
|
11
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: UpdateViewerUserProfileRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "put",
|
|
22
|
+
"url": "/v1/viewer/userProfile",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, response: httpx.Response) -> Error | User | None:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = User.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
|
|
39
|
+
raise QCSHTTPStatusError(
|
|
40
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
41
|
+
response=response,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _build_response(*, response: httpx.Response) -> Response[Error | User]:
|
|
46
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
47
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
51
|
+
def sync(
|
|
52
|
+
*,
|
|
53
|
+
client: httpx.Client,
|
|
54
|
+
body: UpdateViewerUserProfileRequest,
|
|
55
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
56
|
+
) -> Response[Error | User]:
|
|
57
|
+
"""Update the profile of the authenticated user.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
body (UpdateViewerUserProfileRequest):
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Response[Error | User]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
71
|
+
|
|
72
|
+
kwargs = _get_kwargs(
|
|
73
|
+
body=body,
|
|
74
|
+
)
|
|
75
|
+
kwargs.update(httpx_request_kwargs)
|
|
76
|
+
response = client.request(
|
|
77
|
+
**kwargs,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return _build_response(response=response)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
84
|
+
def sync_from_dict(
|
|
85
|
+
*,
|
|
86
|
+
client: httpx.Client,
|
|
87
|
+
body: dict,
|
|
88
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
89
|
+
) -> Response[Error | User]:
|
|
90
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
91
|
+
|
|
92
|
+
kwargs = _get_kwargs(
|
|
93
|
+
client=client,
|
|
94
|
+
body=body,
|
|
95
|
+
)
|
|
96
|
+
kwargs.update(httpx_request_kwargs)
|
|
97
|
+
response = client.request(
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
return _build_response(response=response)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
104
|
+
async def asyncio(
|
|
105
|
+
*,
|
|
106
|
+
client: httpx.AsyncClient,
|
|
107
|
+
body: UpdateViewerUserProfileRequest,
|
|
108
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
109
|
+
) -> Response[Error | User]:
|
|
110
|
+
"""Update the profile of the authenticated user.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
body (UpdateViewerUserProfileRequest):
|
|
114
|
+
|
|
115
|
+
Raises:
|
|
116
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
117
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
Response[Error | User]
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
124
|
+
kwargs = _get_kwargs(
|
|
125
|
+
body=body,
|
|
126
|
+
)
|
|
127
|
+
kwargs.update(httpx_request_kwargs)
|
|
128
|
+
response = await client.request(**kwargs)
|
|
129
|
+
return _build_response(response=response)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
133
|
+
async def asyncio_from_dict(
|
|
134
|
+
*,
|
|
135
|
+
client: httpx.AsyncClient,
|
|
136
|
+
body: dict,
|
|
137
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
138
|
+
) -> Response[Error | User]:
|
|
139
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
140
|
+
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
client=client,
|
|
143
|
+
body=body,
|
|
144
|
+
)
|
|
145
|
+
kwargs.update(httpx_request_kwargs)
|
|
146
|
+
response = await client.request(
|
|
147
|
+
**kwargs,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
from typing import Any, cast
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.auth_email_password_reset_token_request import AuthEmailPasswordResetTokenRequest
|
|
7
|
+
from ...models.error import Error
|
|
8
|
+
from ...types import UNSET, Response, Unset
|
|
9
|
+
from ...util.errors import QCSHTTPStatusError
|
|
10
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: AuthEmailPasswordResetTokenRequest | Unset = UNSET,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/v1/auth:emailPasswordResetToken",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if not isinstance(body, Unset):
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, response: httpx.Response) -> Any | Error | None:
|
|
34
|
+
if response.status_code == 204:
|
|
35
|
+
response_204 = cast(Any, None)
|
|
36
|
+
return response_204
|
|
37
|
+
|
|
38
|
+
raise QCSHTTPStatusError(
|
|
39
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
40
|
+
response=response,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(*, response: httpx.Response) -> Response[Any | Error]:
|
|
45
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
46
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
50
|
+
def sync(
|
|
51
|
+
*,
|
|
52
|
+
client: httpx.Client,
|
|
53
|
+
body: AuthEmailPasswordResetTokenRequest | Unset = UNSET,
|
|
54
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
55
|
+
) -> Response[Any | Error]:
|
|
56
|
+
"""Email Password Reset Token
|
|
57
|
+
|
|
58
|
+
Send a password reset link to the provided email address, if that email matches a registered user.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
body (AuthEmailPasswordResetTokenRequest | Unset):
|
|
62
|
+
|
|
63
|
+
Raises:
|
|
64
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
65
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
Response[Any | Error]
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
72
|
+
|
|
73
|
+
kwargs = _get_kwargs(
|
|
74
|
+
body=body,
|
|
75
|
+
)
|
|
76
|
+
kwargs.update(httpx_request_kwargs)
|
|
77
|
+
response = client.request(
|
|
78
|
+
**kwargs,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
return _build_response(response=response)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
85
|
+
def sync_from_dict(
|
|
86
|
+
*,
|
|
87
|
+
client: httpx.Client,
|
|
88
|
+
body: dict,
|
|
89
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
90
|
+
) -> Response[Any | Error]:
|
|
91
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
92
|
+
|
|
93
|
+
kwargs = _get_kwargs(
|
|
94
|
+
client=client,
|
|
95
|
+
body=body,
|
|
96
|
+
)
|
|
97
|
+
kwargs.update(httpx_request_kwargs)
|
|
98
|
+
response = client.request(
|
|
99
|
+
**kwargs,
|
|
100
|
+
)
|
|
101
|
+
return _build_response(response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
105
|
+
async def asyncio(
|
|
106
|
+
*,
|
|
107
|
+
client: httpx.AsyncClient,
|
|
108
|
+
body: AuthEmailPasswordResetTokenRequest | Unset = UNSET,
|
|
109
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
110
|
+
) -> Response[Any | Error]:
|
|
111
|
+
"""Email Password Reset Token
|
|
112
|
+
|
|
113
|
+
Send a password reset link to the provided email address, if that email matches a registered user.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
body (AuthEmailPasswordResetTokenRequest | Unset):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Response[Any | Error]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
127
|
+
kwargs = _get_kwargs(
|
|
128
|
+
body=body,
|
|
129
|
+
)
|
|
130
|
+
kwargs.update(httpx_request_kwargs)
|
|
131
|
+
response = await client.request(**kwargs)
|
|
132
|
+
return _build_response(response=response)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
136
|
+
async def asyncio_from_dict(
|
|
137
|
+
*,
|
|
138
|
+
client: httpx.AsyncClient,
|
|
139
|
+
body: dict,
|
|
140
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
141
|
+
) -> Response[Any | Error]:
|
|
142
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
143
|
+
|
|
144
|
+
kwargs = _get_kwargs(
|
|
145
|
+
client=client,
|
|
146
|
+
body=body,
|
|
147
|
+
)
|
|
148
|
+
kwargs.update(httpx_request_kwargs)
|
|
149
|
+
response = await client.request(
|
|
150
|
+
**kwargs,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.error import Error
|
|
7
|
+
from ...models.user import User
|
|
8
|
+
from ...types import Response
|
|
9
|
+
from ...util.errors import QCSHTTPStatusError
|
|
10
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
14
|
+
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/v1/auth:getUser",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(*, response: httpx.Response) -> Error | User | None:
|
|
24
|
+
if response.status_code == 200:
|
|
25
|
+
response_200 = User.from_dict(response.json())
|
|
26
|
+
|
|
27
|
+
return response_200
|
|
28
|
+
|
|
29
|
+
raise QCSHTTPStatusError(
|
|
30
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
31
|
+
response=response,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _build_response(*, response: httpx.Response) -> Response[Error | User]:
|
|
36
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
37
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
41
|
+
def sync(
|
|
42
|
+
*,
|
|
43
|
+
client: httpx.Client,
|
|
44
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
45
|
+
) -> Response[Error | User]:
|
|
46
|
+
"""Get User
|
|
47
|
+
|
|
48
|
+
Retrieve the profile of the authenticated user.
|
|
49
|
+
|
|
50
|
+
Raises:
|
|
51
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
52
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Response[Error | User]
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
59
|
+
|
|
60
|
+
kwargs = _get_kwargs()
|
|
61
|
+
kwargs.update(httpx_request_kwargs)
|
|
62
|
+
response = client.request(
|
|
63
|
+
**kwargs,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
return _build_response(response=response)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
70
|
+
def sync_from_dict(
|
|
71
|
+
*,
|
|
72
|
+
client: httpx.Client,
|
|
73
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
74
|
+
) -> Response[Error | User]:
|
|
75
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
76
|
+
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
client=client,
|
|
79
|
+
)
|
|
80
|
+
kwargs.update(httpx_request_kwargs)
|
|
81
|
+
response = client.request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
return _build_response(response=response)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
88
|
+
async def asyncio(
|
|
89
|
+
*,
|
|
90
|
+
client: httpx.AsyncClient,
|
|
91
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
92
|
+
) -> Response[Error | User]:
|
|
93
|
+
"""Get User
|
|
94
|
+
|
|
95
|
+
Retrieve the profile of the authenticated user.
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[Error | User]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
106
|
+
kwargs = _get_kwargs()
|
|
107
|
+
kwargs.update(httpx_request_kwargs)
|
|
108
|
+
response = await client.request(**kwargs)
|
|
109
|
+
return _build_response(response=response)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
113
|
+
async def asyncio_from_dict(
|
|
114
|
+
*,
|
|
115
|
+
client: httpx.AsyncClient,
|
|
116
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
117
|
+
) -> Response[Error | User]:
|
|
118
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
119
|
+
|
|
120
|
+
kwargs = _get_kwargs(
|
|
121
|
+
client=client,
|
|
122
|
+
)
|
|
123
|
+
kwargs.update(httpx_request_kwargs)
|
|
124
|
+
response = await client.request(
|
|
125
|
+
**kwargs,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from typing import Any, cast
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.auth_reset_password_request import AuthResetPasswordRequest
|
|
7
|
+
from ...models.error import Error
|
|
8
|
+
from ...types import Response
|
|
9
|
+
from ...util.errors import QCSHTTPStatusError
|
|
10
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: AuthResetPasswordRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/v1/auth:resetPassword",
|
|
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(*, response: httpx.Response) -> Any | Error | None:
|
|
33
|
+
if response.status_code == 204:
|
|
34
|
+
response_204 = cast(Any, None)
|
|
35
|
+
return response_204
|
|
36
|
+
|
|
37
|
+
raise QCSHTTPStatusError(
|
|
38
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
39
|
+
response=response,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _build_response(*, response: httpx.Response) -> Response[Any | Error]:
|
|
44
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
45
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
49
|
+
def sync(
|
|
50
|
+
*,
|
|
51
|
+
client: httpx.Client,
|
|
52
|
+
body: AuthResetPasswordRequest,
|
|
53
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
54
|
+
) -> Response[Any | Error]:
|
|
55
|
+
"""Reset Password
|
|
56
|
+
|
|
57
|
+
Reset the password using the user's existing password. Note, this is an authenticated route.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
body (AuthResetPasswordRequest):
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Response[Any | Error]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
71
|
+
|
|
72
|
+
kwargs = _get_kwargs(
|
|
73
|
+
body=body,
|
|
74
|
+
)
|
|
75
|
+
kwargs.update(httpx_request_kwargs)
|
|
76
|
+
response = client.request(
|
|
77
|
+
**kwargs,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return _build_response(response=response)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
84
|
+
def sync_from_dict(
|
|
85
|
+
*,
|
|
86
|
+
client: httpx.Client,
|
|
87
|
+
body: dict,
|
|
88
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
89
|
+
) -> Response[Any | Error]:
|
|
90
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
91
|
+
|
|
92
|
+
kwargs = _get_kwargs(
|
|
93
|
+
client=client,
|
|
94
|
+
body=body,
|
|
95
|
+
)
|
|
96
|
+
kwargs.update(httpx_request_kwargs)
|
|
97
|
+
response = client.request(
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
return _build_response(response=response)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
104
|
+
async def asyncio(
|
|
105
|
+
*,
|
|
106
|
+
client: httpx.AsyncClient,
|
|
107
|
+
body: AuthResetPasswordRequest,
|
|
108
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
109
|
+
) -> Response[Any | Error]:
|
|
110
|
+
"""Reset Password
|
|
111
|
+
|
|
112
|
+
Reset the password using the user's existing password. Note, this is an authenticated route.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
body (AuthResetPasswordRequest):
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Response[Any | Error]
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
126
|
+
kwargs = _get_kwargs(
|
|
127
|
+
body=body,
|
|
128
|
+
)
|
|
129
|
+
kwargs.update(httpx_request_kwargs)
|
|
130
|
+
response = await client.request(**kwargs)
|
|
131
|
+
return _build_response(response=response)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
135
|
+
async def asyncio_from_dict(
|
|
136
|
+
*,
|
|
137
|
+
client: httpx.AsyncClient,
|
|
138
|
+
body: dict,
|
|
139
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
140
|
+
) -> Response[Any | Error]:
|
|
141
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
142
|
+
|
|
143
|
+
kwargs = _get_kwargs(
|
|
144
|
+
client=client,
|
|
145
|
+
body=body,
|
|
146
|
+
)
|
|
147
|
+
kwargs.update(httpx_request_kwargs)
|
|
148
|
+
response = await client.request(
|
|
149
|
+
**kwargs,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
return _build_response(response=response)
|