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,170 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from tenacity import retry
|
|
6
|
+
|
|
7
|
+
from ...models.error import Error
|
|
8
|
+
from ...models.event_billing_price_rate import EventBillingPriceRate
|
|
9
|
+
from ...models.get_account_event_billing_price_request import GetAccountEventBillingPriceRequest
|
|
10
|
+
from ...types import Response
|
|
11
|
+
from ...util.errors import QCSHTTPStatusError
|
|
12
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
user_id: str,
|
|
17
|
+
*,
|
|
18
|
+
body: GetAccountEventBillingPriceRequest,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
headers: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "post",
|
|
24
|
+
"url": "/v1/users/{user_id}/eventBillingPrices:get".format(
|
|
25
|
+
user_id=quote(str(user_id), safe=""),
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_kwargs["json"] = body.to_dict()
|
|
30
|
+
|
|
31
|
+
headers["Content-Type"] = "application/json"
|
|
32
|
+
|
|
33
|
+
_kwargs["headers"] = headers
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(*, response: httpx.Response) -> Error | EventBillingPriceRate | None:
|
|
38
|
+
if response.status_code == 200:
|
|
39
|
+
response_200 = EventBillingPriceRate.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_200
|
|
42
|
+
|
|
43
|
+
raise QCSHTTPStatusError(
|
|
44
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
45
|
+
response=response,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _build_response(*, response: httpx.Response) -> Response[Error | EventBillingPriceRate]:
|
|
50
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
51
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
55
|
+
def sync(
|
|
56
|
+
user_id: str,
|
|
57
|
+
*,
|
|
58
|
+
client: httpx.Client,
|
|
59
|
+
body: GetAccountEventBillingPriceRequest,
|
|
60
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
61
|
+
) -> Response[Error | EventBillingPriceRate]:
|
|
62
|
+
"""Retrieve `EventBillingPrice` for a user for a specific event. If no price is configured this
|
|
63
|
+
operation will return a default `EventBillingPrice` for the specified `product`.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
user_id (str):
|
|
67
|
+
body (GetAccountEventBillingPriceRequest): Property `quantumProcessorId` is currently
|
|
68
|
+
required for all `product`s, however in the future there may be `product`s that do not
|
|
69
|
+
require a `quantumProcessorId`.
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[Error | EventBillingPriceRate]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
80
|
+
|
|
81
|
+
kwargs = _get_kwargs(
|
|
82
|
+
user_id=user_id,
|
|
83
|
+
body=body,
|
|
84
|
+
)
|
|
85
|
+
kwargs.update(httpx_request_kwargs)
|
|
86
|
+
response = client.request(
|
|
87
|
+
**kwargs,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
return _build_response(response=response)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
94
|
+
def sync_from_dict(
|
|
95
|
+
user_id: str,
|
|
96
|
+
*,
|
|
97
|
+
client: httpx.Client,
|
|
98
|
+
body: dict,
|
|
99
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
100
|
+
) -> Response[Error | EventBillingPriceRate]:
|
|
101
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
102
|
+
|
|
103
|
+
kwargs = _get_kwargs(
|
|
104
|
+
user_id=user_id,
|
|
105
|
+
client=client,
|
|
106
|
+
body=body,
|
|
107
|
+
)
|
|
108
|
+
kwargs.update(httpx_request_kwargs)
|
|
109
|
+
response = client.request(
|
|
110
|
+
**kwargs,
|
|
111
|
+
)
|
|
112
|
+
return _build_response(response=response)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
116
|
+
async def asyncio(
|
|
117
|
+
user_id: str,
|
|
118
|
+
*,
|
|
119
|
+
client: httpx.AsyncClient,
|
|
120
|
+
body: GetAccountEventBillingPriceRequest,
|
|
121
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
122
|
+
) -> Response[Error | EventBillingPriceRate]:
|
|
123
|
+
"""Retrieve `EventBillingPrice` for a user for a specific event. If no price is configured this
|
|
124
|
+
operation will return a default `EventBillingPrice` for the specified `product`.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
user_id (str):
|
|
128
|
+
body (GetAccountEventBillingPriceRequest): Property `quantumProcessorId` is currently
|
|
129
|
+
required for all `product`s, however in the future there may be `product`s that do not
|
|
130
|
+
require a `quantumProcessorId`.
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[Error | EventBillingPriceRate]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
141
|
+
kwargs = _get_kwargs(
|
|
142
|
+
user_id=user_id,
|
|
143
|
+
body=body,
|
|
144
|
+
)
|
|
145
|
+
kwargs.update(httpx_request_kwargs)
|
|
146
|
+
response = await client.request(**kwargs)
|
|
147
|
+
return _build_response(response=response)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
151
|
+
async def asyncio_from_dict(
|
|
152
|
+
user_id: str,
|
|
153
|
+
*,
|
|
154
|
+
client: httpx.AsyncClient,
|
|
155
|
+
body: dict,
|
|
156
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
157
|
+
) -> Response[Error | EventBillingPriceRate]:
|
|
158
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
159
|
+
|
|
160
|
+
kwargs = _get_kwargs(
|
|
161
|
+
user_id=user_id,
|
|
162
|
+
client=client,
|
|
163
|
+
body=body,
|
|
164
|
+
)
|
|
165
|
+
kwargs.update(httpx_request_kwargs)
|
|
166
|
+
response = await client.request(
|
|
167
|
+
**kwargs,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from tenacity import retry
|
|
6
|
+
|
|
7
|
+
from ...models.billing_upcoming_invoice import BillingUpcomingInvoice
|
|
8
|
+
from ...models.error import Error
|
|
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
|
+
user_id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/v1/users/{user_id}/billingInvoices:getUpcoming".format(
|
|
21
|
+
user_id=quote(str(user_id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(*, response: httpx.Response) -> BillingUpcomingInvoice | Error | None:
|
|
29
|
+
if response.status_code == 200:
|
|
30
|
+
response_200 = BillingUpcomingInvoice.from_dict(response.json())
|
|
31
|
+
|
|
32
|
+
return response_200
|
|
33
|
+
|
|
34
|
+
raise QCSHTTPStatusError(
|
|
35
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
36
|
+
response=response,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _build_response(*, response: httpx.Response) -> Response[BillingUpcomingInvoice | Error]:
|
|
41
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
42
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
46
|
+
def sync(
|
|
47
|
+
user_id: str,
|
|
48
|
+
*,
|
|
49
|
+
client: httpx.Client,
|
|
50
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
51
|
+
) -> Response[BillingUpcomingInvoice | Error]:
|
|
52
|
+
"""Retrieve upcoming invoice for QCS user billing customer.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
user_id (str):
|
|
56
|
+
|
|
57
|
+
Raises:
|
|
58
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
59
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Response[BillingUpcomingInvoice | Error]
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
66
|
+
|
|
67
|
+
kwargs = _get_kwargs(
|
|
68
|
+
user_id=user_id,
|
|
69
|
+
)
|
|
70
|
+
kwargs.update(httpx_request_kwargs)
|
|
71
|
+
response = client.request(
|
|
72
|
+
**kwargs,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return _build_response(response=response)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
79
|
+
def sync_from_dict(
|
|
80
|
+
user_id: str,
|
|
81
|
+
*,
|
|
82
|
+
client: httpx.Client,
|
|
83
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
84
|
+
) -> Response[BillingUpcomingInvoice | Error]:
|
|
85
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
user_id=user_id,
|
|
89
|
+
client=client,
|
|
90
|
+
)
|
|
91
|
+
kwargs.update(httpx_request_kwargs)
|
|
92
|
+
response = client.request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
return _build_response(response=response)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
99
|
+
async def asyncio(
|
|
100
|
+
user_id: str,
|
|
101
|
+
*,
|
|
102
|
+
client: httpx.AsyncClient,
|
|
103
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
104
|
+
) -> Response[BillingUpcomingInvoice | Error]:
|
|
105
|
+
"""Retrieve upcoming invoice for QCS user billing customer.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
user_id (str):
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
Response[BillingUpcomingInvoice | Error]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
119
|
+
kwargs = _get_kwargs(
|
|
120
|
+
user_id=user_id,
|
|
121
|
+
)
|
|
122
|
+
kwargs.update(httpx_request_kwargs)
|
|
123
|
+
response = await client.request(**kwargs)
|
|
124
|
+
return _build_response(response=response)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
128
|
+
async def asyncio_from_dict(
|
|
129
|
+
user_id: str,
|
|
130
|
+
*,
|
|
131
|
+
client: httpx.AsyncClient,
|
|
132
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
133
|
+
) -> Response[BillingUpcomingInvoice | Error]:
|
|
134
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
135
|
+
|
|
136
|
+
kwargs = _get_kwargs(
|
|
137
|
+
user_id=user_id,
|
|
138
|
+
client=client,
|
|
139
|
+
)
|
|
140
|
+
kwargs.update(httpx_request_kwargs)
|
|
141
|
+
response = await client.request(
|
|
142
|
+
**kwargs,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.error import Error
|
|
7
|
+
from ...models.viewer_user_onboarding_completed import ViewerUserOnboardingCompleted
|
|
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/viewer/onboardingCompleted",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(*, response: httpx.Response) -> Error | ViewerUserOnboardingCompleted | None:
|
|
24
|
+
if response.status_code == 200:
|
|
25
|
+
response_200 = ViewerUserOnboardingCompleted.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 | ViewerUserOnboardingCompleted]:
|
|
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 | ViewerUserOnboardingCompleted]:
|
|
46
|
+
"""Get the onboarding status of the authenticated user.
|
|
47
|
+
|
|
48
|
+
Raises:
|
|
49
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
50
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
Response[Error | ViewerUserOnboardingCompleted]
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
57
|
+
|
|
58
|
+
kwargs = _get_kwargs()
|
|
59
|
+
kwargs.update(httpx_request_kwargs)
|
|
60
|
+
response = client.request(
|
|
61
|
+
**kwargs,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return _build_response(response=response)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
68
|
+
def sync_from_dict(
|
|
69
|
+
*,
|
|
70
|
+
client: httpx.Client,
|
|
71
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
72
|
+
) -> Response[Error | ViewerUserOnboardingCompleted]:
|
|
73
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
74
|
+
|
|
75
|
+
kwargs = _get_kwargs(
|
|
76
|
+
client=client,
|
|
77
|
+
)
|
|
78
|
+
kwargs.update(httpx_request_kwargs)
|
|
79
|
+
response = client.request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
return _build_response(response=response)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
86
|
+
async def asyncio(
|
|
87
|
+
*,
|
|
88
|
+
client: httpx.AsyncClient,
|
|
89
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
90
|
+
) -> Response[Error | ViewerUserOnboardingCompleted]:
|
|
91
|
+
"""Get the onboarding status of the authenticated user.
|
|
92
|
+
|
|
93
|
+
Raises:
|
|
94
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
95
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Response[Error | ViewerUserOnboardingCompleted]
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
102
|
+
kwargs = _get_kwargs()
|
|
103
|
+
kwargs.update(httpx_request_kwargs)
|
|
104
|
+
response = await client.request(**kwargs)
|
|
105
|
+
return _build_response(response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
109
|
+
async def asyncio_from_dict(
|
|
110
|
+
*,
|
|
111
|
+
client: httpx.AsyncClient,
|
|
112
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
113
|
+
) -> Response[Error | ViewerUserOnboardingCompleted]:
|
|
114
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
115
|
+
|
|
116
|
+
kwargs = _get_kwargs(
|
|
117
|
+
client=client,
|
|
118
|
+
)
|
|
119
|
+
kwargs.update(httpx_request_kwargs)
|
|
120
|
+
response = await client.request(
|
|
121
|
+
**kwargs,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from tenacity import retry
|
|
6
|
+
|
|
7
|
+
from ...models.error import Error
|
|
8
|
+
from ...models.list_account_billing_invoice_lines_response import ListAccountBillingInvoiceLinesResponse
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
from ...util.errors import QCSHTTPStatusError
|
|
11
|
+
from ...util.retry import DEFAULT_RETRY_ARGUMENTS
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
group_name: str,
|
|
16
|
+
billing_invoice_id: str,
|
|
17
|
+
*,
|
|
18
|
+
page_token: str | Unset = UNSET,
|
|
19
|
+
page_size: int | Unset = UNSET,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
|
|
22
|
+
params: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
params["pageToken"] = page_token
|
|
25
|
+
|
|
26
|
+
params["pageSize"] = page_size
|
|
27
|
+
|
|
28
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
29
|
+
|
|
30
|
+
_kwargs: dict[str, Any] = {
|
|
31
|
+
"method": "get",
|
|
32
|
+
"url": "/v1/groups/{group_name}/billingInvoices/{billing_invoice_id}/lines".format(
|
|
33
|
+
group_name=quote(str(group_name), safe=""),
|
|
34
|
+
billing_invoice_id=quote(str(billing_invoice_id), safe=""),
|
|
35
|
+
),
|
|
36
|
+
"params": params,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return _kwargs
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _parse_response(*, response: httpx.Response) -> Error | ListAccountBillingInvoiceLinesResponse | None:
|
|
43
|
+
if response.status_code == 200:
|
|
44
|
+
response_200 = ListAccountBillingInvoiceLinesResponse.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_200
|
|
47
|
+
|
|
48
|
+
raise QCSHTTPStatusError(
|
|
49
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
50
|
+
response=response,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _build_response(*, response: httpx.Response) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
|
|
55
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
56
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
60
|
+
def sync(
|
|
61
|
+
group_name: str,
|
|
62
|
+
billing_invoice_id: str,
|
|
63
|
+
*,
|
|
64
|
+
client: httpx.Client,
|
|
65
|
+
page_token: str | Unset = UNSET,
|
|
66
|
+
page_size: int | Unset = UNSET,
|
|
67
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
68
|
+
) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
|
|
69
|
+
"""Retrieve billing invoice lines for a QCS group account's invoice.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
group_name (str):
|
|
73
|
+
billing_invoice_id (str):
|
|
74
|
+
page_token (str | Unset):
|
|
75
|
+
page_size (int | Unset):
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
79
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Response[Error | ListAccountBillingInvoiceLinesResponse]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs(
|
|
88
|
+
group_name=group_name,
|
|
89
|
+
billing_invoice_id=billing_invoice_id,
|
|
90
|
+
page_token=page_token,
|
|
91
|
+
page_size=page_size,
|
|
92
|
+
)
|
|
93
|
+
kwargs.update(httpx_request_kwargs)
|
|
94
|
+
response = client.request(
|
|
95
|
+
**kwargs,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return _build_response(response=response)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
102
|
+
def sync_from_dict(
|
|
103
|
+
group_name: str,
|
|
104
|
+
billing_invoice_id: str,
|
|
105
|
+
*,
|
|
106
|
+
client: httpx.Client,
|
|
107
|
+
page_token: str | Unset = UNSET,
|
|
108
|
+
page_size: int | Unset = UNSET,
|
|
109
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
110
|
+
) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
|
|
111
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
112
|
+
|
|
113
|
+
kwargs = _get_kwargs(
|
|
114
|
+
group_name=group_name,
|
|
115
|
+
billing_invoice_id=billing_invoice_id,
|
|
116
|
+
client=client,
|
|
117
|
+
page_token=page_token,
|
|
118
|
+
page_size=page_size,
|
|
119
|
+
)
|
|
120
|
+
kwargs.update(httpx_request_kwargs)
|
|
121
|
+
response = client.request(
|
|
122
|
+
**kwargs,
|
|
123
|
+
)
|
|
124
|
+
return _build_response(response=response)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
128
|
+
async def asyncio(
|
|
129
|
+
group_name: str,
|
|
130
|
+
billing_invoice_id: str,
|
|
131
|
+
*,
|
|
132
|
+
client: httpx.AsyncClient,
|
|
133
|
+
page_token: str | Unset = UNSET,
|
|
134
|
+
page_size: int | Unset = UNSET,
|
|
135
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
136
|
+
) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
|
|
137
|
+
"""Retrieve billing invoice lines for a QCS group account's invoice.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
group_name (str):
|
|
141
|
+
billing_invoice_id (str):
|
|
142
|
+
page_token (str | Unset):
|
|
143
|
+
page_size (int | Unset):
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
147
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Response[Error | ListAccountBillingInvoiceLinesResponse]
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
group_name=group_name,
|
|
156
|
+
billing_invoice_id=billing_invoice_id,
|
|
157
|
+
page_token=page_token,
|
|
158
|
+
page_size=page_size,
|
|
159
|
+
)
|
|
160
|
+
kwargs.update(httpx_request_kwargs)
|
|
161
|
+
response = await client.request(**kwargs)
|
|
162
|
+
return _build_response(response=response)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
166
|
+
async def asyncio_from_dict(
|
|
167
|
+
group_name: str,
|
|
168
|
+
billing_invoice_id: str,
|
|
169
|
+
*,
|
|
170
|
+
client: httpx.AsyncClient,
|
|
171
|
+
page_token: str | Unset = UNSET,
|
|
172
|
+
page_size: int | Unset = UNSET,
|
|
173
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
174
|
+
) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
|
|
175
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
176
|
+
|
|
177
|
+
kwargs = _get_kwargs(
|
|
178
|
+
group_name=group_name,
|
|
179
|
+
billing_invoice_id=billing_invoice_id,
|
|
180
|
+
client=client,
|
|
181
|
+
page_token=page_token,
|
|
182
|
+
page_size=page_size,
|
|
183
|
+
)
|
|
184
|
+
kwargs.update(httpx_request_kwargs)
|
|
185
|
+
response = await client.request(
|
|
186
|
+
**kwargs,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
return _build_response(response=response)
|