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 @@
|
|
|
1
|
+
"""A client library for accessing Rigetti QCS API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.activate_user_request import ActivateUserRequest
|
|
7
|
+
from ...models.error import Error
|
|
8
|
+
from ...models.user import User
|
|
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
|
+
*,
|
|
16
|
+
body: ActivateUserRequest | Unset = UNSET,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/v1/users:activate",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if not isinstance(body, Unset):
|
|
26
|
+
_kwargs["json"] = body.to_dict()
|
|
27
|
+
|
|
28
|
+
headers["Content-Type"] = "application/json"
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(*, response: httpx.Response) -> Error | User | None:
|
|
35
|
+
if response.status_code == 204:
|
|
36
|
+
response_204 = User.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_204
|
|
39
|
+
|
|
40
|
+
raise QCSHTTPStatusError(
|
|
41
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
42
|
+
response=response,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _build_response(*, response: httpx.Response) -> Response[Error | User]:
|
|
47
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
48
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
52
|
+
def sync(
|
|
53
|
+
*,
|
|
54
|
+
client: httpx.Client,
|
|
55
|
+
body: ActivateUserRequest | Unset = UNSET,
|
|
56
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
57
|
+
) -> Response[Error | User]:
|
|
58
|
+
"""Activate User
|
|
59
|
+
|
|
60
|
+
Activate a user, completing an invitation request.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
body (ActivateUserRequest | Unset):
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
67
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
Response[Error | User]
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
74
|
+
|
|
75
|
+
kwargs = _get_kwargs(
|
|
76
|
+
body=body,
|
|
77
|
+
)
|
|
78
|
+
kwargs.update(httpx_request_kwargs)
|
|
79
|
+
response = client.request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return _build_response(response=response)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
87
|
+
def sync_from_dict(
|
|
88
|
+
*,
|
|
89
|
+
client: httpx.Client,
|
|
90
|
+
body: dict,
|
|
91
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
92
|
+
) -> Response[Error | User]:
|
|
93
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
94
|
+
|
|
95
|
+
kwargs = _get_kwargs(
|
|
96
|
+
client=client,
|
|
97
|
+
body=body,
|
|
98
|
+
)
|
|
99
|
+
kwargs.update(httpx_request_kwargs)
|
|
100
|
+
response = client.request(
|
|
101
|
+
**kwargs,
|
|
102
|
+
)
|
|
103
|
+
return _build_response(response=response)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
107
|
+
async def asyncio(
|
|
108
|
+
*,
|
|
109
|
+
client: httpx.AsyncClient,
|
|
110
|
+
body: ActivateUserRequest | Unset = UNSET,
|
|
111
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
112
|
+
) -> Response[Error | User]:
|
|
113
|
+
"""Activate User
|
|
114
|
+
|
|
115
|
+
Activate a user, completing an invitation request.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
body (ActivateUserRequest | Unset):
|
|
119
|
+
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Response[Error | User]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
129
|
+
kwargs = _get_kwargs(
|
|
130
|
+
body=body,
|
|
131
|
+
)
|
|
132
|
+
kwargs.update(httpx_request_kwargs)
|
|
133
|
+
response = await client.request(**kwargs)
|
|
134
|
+
return _build_response(response=response)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
138
|
+
async def asyncio_from_dict(
|
|
139
|
+
*,
|
|
140
|
+
client: httpx.AsyncClient,
|
|
141
|
+
body: dict,
|
|
142
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
143
|
+
) -> Response[Error | User]:
|
|
144
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
client=client,
|
|
148
|
+
body=body,
|
|
149
|
+
)
|
|
150
|
+
kwargs.update(httpx_request_kwargs)
|
|
151
|
+
response = await client.request(
|
|
152
|
+
**kwargs,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
from typing import Any, cast
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from tenacity import retry
|
|
5
|
+
|
|
6
|
+
from ...models.add_group_user_request import AddGroupUserRequest
|
|
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: AddGroupUserRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/v1/groups:addUser",
|
|
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: AddGroupUserRequest,
|
|
53
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
54
|
+
) -> Response[Any | Error]:
|
|
55
|
+
"""Add user to a group
|
|
56
|
+
|
|
57
|
+
Add a user to a group. Note, group membership may take several minutes to update within our identity
|
|
58
|
+
provider. After adding a user to a group, please allow up to 60 minutes for changes to be reflected.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
body (AddGroupUserRequest): Must provide either `userId` or `userEmail` and `groupId` or
|
|
62
|
+
`groupName`.
|
|
63
|
+
|
|
64
|
+
Raises:
|
|
65
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
66
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
Response[Any | Error]
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
73
|
+
|
|
74
|
+
kwargs = _get_kwargs(
|
|
75
|
+
body=body,
|
|
76
|
+
)
|
|
77
|
+
kwargs.update(httpx_request_kwargs)
|
|
78
|
+
response = client.request(
|
|
79
|
+
**kwargs,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return _build_response(response=response)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
86
|
+
def sync_from_dict(
|
|
87
|
+
*,
|
|
88
|
+
client: httpx.Client,
|
|
89
|
+
body: dict,
|
|
90
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
91
|
+
) -> Response[Any | Error]:
|
|
92
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
93
|
+
|
|
94
|
+
kwargs = _get_kwargs(
|
|
95
|
+
client=client,
|
|
96
|
+
body=body,
|
|
97
|
+
)
|
|
98
|
+
kwargs.update(httpx_request_kwargs)
|
|
99
|
+
response = client.request(
|
|
100
|
+
**kwargs,
|
|
101
|
+
)
|
|
102
|
+
return _build_response(response=response)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
106
|
+
async def asyncio(
|
|
107
|
+
*,
|
|
108
|
+
client: httpx.AsyncClient,
|
|
109
|
+
body: AddGroupUserRequest,
|
|
110
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
111
|
+
) -> Response[Any | Error]:
|
|
112
|
+
"""Add user to a group
|
|
113
|
+
|
|
114
|
+
Add a user to a group. Note, group membership may take several minutes to update within our identity
|
|
115
|
+
provider. After adding a user to a group, please allow up to 60 minutes for changes to be reflected.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
body (AddGroupUserRequest): Must provide either `userId` or `userEmail` and `groupId` or
|
|
119
|
+
`groupName`.
|
|
120
|
+
|
|
121
|
+
Raises:
|
|
122
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
123
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
Response[Any | Error]
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
130
|
+
kwargs = _get_kwargs(
|
|
131
|
+
body=body,
|
|
132
|
+
)
|
|
133
|
+
kwargs.update(httpx_request_kwargs)
|
|
134
|
+
response = await client.request(**kwargs)
|
|
135
|
+
return _build_response(response=response)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
139
|
+
async def asyncio_from_dict(
|
|
140
|
+
*,
|
|
141
|
+
client: httpx.AsyncClient,
|
|
142
|
+
body: dict,
|
|
143
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
144
|
+
) -> Response[Any | Error]:
|
|
145
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
146
|
+
|
|
147
|
+
kwargs = _get_kwargs(
|
|
148
|
+
client=client,
|
|
149
|
+
body=body,
|
|
150
|
+
)
|
|
151
|
+
kwargs.update(httpx_request_kwargs)
|
|
152
|
+
response = await client.request(
|
|
153
|
+
**kwargs,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
return _build_response(response=response)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
from typing import Any, cast
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from tenacity import retry
|
|
6
|
+
|
|
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
|
+
announcement_id: int,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "delete",
|
|
19
|
+
"url": "/v1/viewer/announcements/{announcement_id}".format(
|
|
20
|
+
announcement_id=quote(str(announcement_id), safe=""),
|
|
21
|
+
),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(*, response: httpx.Response) -> Any | Error | None:
|
|
28
|
+
if response.status_code == 200:
|
|
29
|
+
response_200 = cast(Any, None)
|
|
30
|
+
return response_200
|
|
31
|
+
|
|
32
|
+
raise QCSHTTPStatusError(
|
|
33
|
+
message=f"Unexpected response: status code {response.status_code}",
|
|
34
|
+
response=response,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _build_response(*, response: httpx.Response) -> Response[Any | Error]:
|
|
39
|
+
"""Construct the Response class from the raw ``httpx.Response``."""
|
|
40
|
+
return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
44
|
+
def sync(
|
|
45
|
+
announcement_id: int,
|
|
46
|
+
*,
|
|
47
|
+
client: httpx.Client,
|
|
48
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
49
|
+
) -> Response[Any | Error]:
|
|
50
|
+
"""Dismiss an announcement for an authenticating user, indicating that they do not want to see it
|
|
51
|
+
again.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
announcement_id (int):
|
|
55
|
+
|
|
56
|
+
Raises:
|
|
57
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
58
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Response[Any | Error]
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
65
|
+
|
|
66
|
+
kwargs = _get_kwargs(
|
|
67
|
+
announcement_id=announcement_id,
|
|
68
|
+
)
|
|
69
|
+
kwargs.update(httpx_request_kwargs)
|
|
70
|
+
response = client.request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _build_response(response=response)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
78
|
+
def sync_from_dict(
|
|
79
|
+
announcement_id: int,
|
|
80
|
+
*,
|
|
81
|
+
client: httpx.Client,
|
|
82
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
83
|
+
) -> Response[Any | Error]:
|
|
84
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
85
|
+
|
|
86
|
+
kwargs = _get_kwargs(
|
|
87
|
+
announcement_id=announcement_id,
|
|
88
|
+
client=client,
|
|
89
|
+
)
|
|
90
|
+
kwargs.update(httpx_request_kwargs)
|
|
91
|
+
response = client.request(
|
|
92
|
+
**kwargs,
|
|
93
|
+
)
|
|
94
|
+
return _build_response(response=response)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
98
|
+
async def asyncio(
|
|
99
|
+
announcement_id: int,
|
|
100
|
+
*,
|
|
101
|
+
client: httpx.AsyncClient,
|
|
102
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
103
|
+
) -> Response[Any | Error]:
|
|
104
|
+
"""Dismiss an announcement for an authenticating user, indicating that they do not want to see it
|
|
105
|
+
again.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
announcement_id (int):
|
|
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[Any | Error]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
119
|
+
kwargs = _get_kwargs(
|
|
120
|
+
announcement_id=announcement_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
|
+
announcement_id: int,
|
|
130
|
+
*,
|
|
131
|
+
client: httpx.AsyncClient,
|
|
132
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
133
|
+
) -> Response[Any | Error]:
|
|
134
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
135
|
+
|
|
136
|
+
kwargs = _get_kwargs(
|
|
137
|
+
announcement_id=announcement_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,149 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from tenacity import retry
|
|
6
|
+
|
|
7
|
+
from ...models.account_balance import AccountBalance
|
|
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
|
+
group_name: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/v1/groups/{group_name}/balance".format(
|
|
21
|
+
group_name=quote(str(group_name), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(*, response: httpx.Response) -> AccountBalance | Error | None:
|
|
29
|
+
if response.status_code == 200:
|
|
30
|
+
response_200 = AccountBalance.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[AccountBalance | 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
|
+
group_name: str,
|
|
48
|
+
*,
|
|
49
|
+
client: httpx.Client,
|
|
50
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
51
|
+
) -> Response[AccountBalance | Error]:
|
|
52
|
+
"""Get Group Balance
|
|
53
|
+
|
|
54
|
+
Retrieve the balance of the requested QCS group account.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
group_name (str):
|
|
58
|
+
|
|
59
|
+
Raises:
|
|
60
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
61
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
Response[AccountBalance | Error]
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
68
|
+
|
|
69
|
+
kwargs = _get_kwargs(
|
|
70
|
+
group_name=group_name,
|
|
71
|
+
)
|
|
72
|
+
kwargs.update(httpx_request_kwargs)
|
|
73
|
+
response = client.request(
|
|
74
|
+
**kwargs,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return _build_response(response=response)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
81
|
+
def sync_from_dict(
|
|
82
|
+
group_name: str,
|
|
83
|
+
*,
|
|
84
|
+
client: httpx.Client,
|
|
85
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
86
|
+
) -> Response[AccountBalance | Error]:
|
|
87
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
group_name=group_name,
|
|
91
|
+
client=client,
|
|
92
|
+
)
|
|
93
|
+
kwargs.update(httpx_request_kwargs)
|
|
94
|
+
response = client.request(
|
|
95
|
+
**kwargs,
|
|
96
|
+
)
|
|
97
|
+
return _build_response(response=response)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
101
|
+
async def asyncio(
|
|
102
|
+
group_name: str,
|
|
103
|
+
*,
|
|
104
|
+
client: httpx.AsyncClient,
|
|
105
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
106
|
+
) -> Response[AccountBalance | Error]:
|
|
107
|
+
"""Get Group Balance
|
|
108
|
+
|
|
109
|
+
Retrieve the balance of the requested QCS group account.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
group_name (str):
|
|
113
|
+
|
|
114
|
+
Raises:
|
|
115
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Response[AccountBalance | Error]
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
123
|
+
kwargs = _get_kwargs(
|
|
124
|
+
group_name=group_name,
|
|
125
|
+
)
|
|
126
|
+
kwargs.update(httpx_request_kwargs)
|
|
127
|
+
response = await client.request(**kwargs)
|
|
128
|
+
return _build_response(response=response)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@retry(**DEFAULT_RETRY_ARGUMENTS)
|
|
132
|
+
async def asyncio_from_dict(
|
|
133
|
+
group_name: str,
|
|
134
|
+
*,
|
|
135
|
+
client: httpx.AsyncClient,
|
|
136
|
+
httpx_request_kwargs: dict[str, Any] | None = None,
|
|
137
|
+
) -> Response[AccountBalance | Error]:
|
|
138
|
+
httpx_request_kwargs = httpx_request_kwargs or {}
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
group_name=group_name,
|
|
142
|
+
client=client,
|
|
143
|
+
)
|
|
144
|
+
kwargs.update(httpx_request_kwargs)
|
|
145
|
+
response = await client.request(
|
|
146
|
+
**kwargs,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return _build_response(response=response)
|