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.
Files changed (172) hide show
  1. qcs_api_client/__init__.py +1 -0
  2. qcs_api_client/api/__init__.py +1 -0
  3. qcs_api_client/api/account/__init__.py +1 -0
  4. qcs_api_client/api/account/activate_user.py +155 -0
  5. qcs_api_client/api/account/add_group_user.py +156 -0
  6. qcs_api_client/api/account/dismiss_viewer_announcement.py +145 -0
  7. qcs_api_client/api/account/get_group_balance.py +149 -0
  8. qcs_api_client/api/account/get_group_billing_customer.py +145 -0
  9. qcs_api_client/api/account/get_group_upcoming_billing_invoice.py +145 -0
  10. qcs_api_client/api/account/get_user_balance.py +149 -0
  11. qcs_api_client/api/account/get_user_billing_customer.py +145 -0
  12. qcs_api_client/api/account/get_user_event_billing_price.py +170 -0
  13. qcs_api_client/api/account/get_user_upcoming_billing_invoice.py +145 -0
  14. qcs_api_client/api/account/get_viewer_user_onboarding_completed.py +124 -0
  15. qcs_api_client/api/account/list_group_billing_invoice_lines.py +189 -0
  16. qcs_api_client/api/account/list_group_billing_invoices.py +177 -0
  17. qcs_api_client/api/account/list_group_upcoming_billing_invoice_lines.py +177 -0
  18. qcs_api_client/api/account/list_group_users.py +185 -0
  19. qcs_api_client/api/account/list_user_billing_invoice_lines.py +189 -0
  20. qcs_api_client/api/account/list_user_billing_invoices.py +177 -0
  21. qcs_api_client/api/account/list_user_groups.py +181 -0
  22. qcs_api_client/api/account/list_user_upcoming_billing_invoice_lines.py +177 -0
  23. qcs_api_client/api/account/list_viewer_announcements.py +178 -0
  24. qcs_api_client/api/account/put_viewer_user_onboarding_completed.py +150 -0
  25. qcs_api_client/api/account/remove_group_user.py +158 -0
  26. qcs_api_client/api/account/update_viewer_user_profile.py +150 -0
  27. qcs_api_client/api/authentication/__init__.py +1 -0
  28. qcs_api_client/api/authentication/auth_email_password_reset_token.py +153 -0
  29. qcs_api_client/api/authentication/auth_get_user.py +128 -0
  30. qcs_api_client/api/authentication/auth_reset_password.py +152 -0
  31. qcs_api_client/api/authentication/auth_reset_password_with_token.py +154 -0
  32. qcs_api_client/api/client_applications/__init__.py +1 -0
  33. qcs_api_client/api/client_applications/check_client_application.py +154 -0
  34. qcs_api_client/api/client_applications/get_client_application.py +151 -0
  35. qcs_api_client/api/client_applications/list_client_applications.py +129 -0
  36. qcs_api_client/api/default/__init__.py +1 -0
  37. qcs_api_client/api/default/get_health.py +123 -0
  38. qcs_api_client/api/default/health_check.py +124 -0
  39. qcs_api_client/api/default/health_check_deprecated.py +126 -0
  40. qcs_api_client/api/endpoints/__init__.py +1 -0
  41. qcs_api_client/api/endpoints/create_endpoint.py +157 -0
  42. qcs_api_client/api/endpoints/delete_endpoint.py +148 -0
  43. qcs_api_client/api/endpoints/get_default_endpoint.py +154 -0
  44. qcs_api_client/api/endpoints/get_endpoint.py +150 -0
  45. qcs_api_client/api/endpoints/list_endpoints.py +182 -0
  46. qcs_api_client/api/endpoints/restart_endpoint.py +168 -0
  47. qcs_api_client/api/engagements/__init__.py +1 -0
  48. qcs_api_client/api/engagements/create_engagement.py +196 -0
  49. qcs_api_client/api/quantum_processors/__init__.py +1 -0
  50. qcs_api_client/api/quantum_processors/get_instruction_set_architecture.py +144 -0
  51. qcs_api_client/api/quantum_processors/get_quantum_processor.py +148 -0
  52. qcs_api_client/api/quantum_processors/get_quantum_processor_accessors.py +150 -0
  53. qcs_api_client/api/quantum_processors/list_instruction_set_architectures.py +164 -0
  54. qcs_api_client/api/quantum_processors/list_quantum_processors.py +170 -0
  55. qcs_api_client/api/reservations/__init__.py +1 -0
  56. qcs_api_client/api/reservations/create_reservation.py +200 -0
  57. qcs_api_client/api/reservations/delete_reservation.py +149 -0
  58. qcs_api_client/api/reservations/find_available_reservations.py +211 -0
  59. qcs_api_client/api/reservations/get_quantum_processor_calendar.py +149 -0
  60. qcs_api_client/api/reservations/get_reservation.py +149 -0
  61. qcs_api_client/api/reservations/list_group_reservations.py +309 -0
  62. qcs_api_client/api/reservations/list_reservations.py +335 -0
  63. qcs_api_client/client/__init__.py +12 -0
  64. qcs_api_client/client/auth.py +78 -0
  65. qcs_api_client/client/client.py +48 -0
  66. qcs_api_client/errors.py +16 -0
  67. qcs_api_client/models/__init__.py +185 -0
  68. qcs_api_client/models/account_balance.py +72 -0
  69. qcs_api_client/models/account_type.py +9 -0
  70. qcs_api_client/models/activate_user_request.py +93 -0
  71. qcs_api_client/models/add_group_user_request.py +95 -0
  72. qcs_api_client/models/announcement.py +97 -0
  73. qcs_api_client/models/announcements_response.py +93 -0
  74. qcs_api_client/models/architecture.py +134 -0
  75. qcs_api_client/models/auth_email_password_reset_token_request.py +69 -0
  76. qcs_api_client/models/auth_reset_password_request.py +77 -0
  77. qcs_api_client/models/auth_reset_password_with_token_request.py +78 -0
  78. qcs_api_client/models/available_reservation.py +104 -0
  79. qcs_api_client/models/billing_customer.py +78 -0
  80. qcs_api_client/models/billing_invoice.py +130 -0
  81. qcs_api_client/models/billing_invoice_line.py +165 -0
  82. qcs_api_client/models/billing_invoice_line_line_item_type.py +9 -0
  83. qcs_api_client/models/billing_invoice_line_metadata.py +55 -0
  84. qcs_api_client/models/billing_invoice_status.py +12 -0
  85. qcs_api_client/models/billing_price.py +234 -0
  86. qcs_api_client/models/billing_price_object.py +8 -0
  87. qcs_api_client/models/billing_price_price_type.py +9 -0
  88. qcs_api_client/models/billing_price_recurrence.py +124 -0
  89. qcs_api_client/models/billing_price_recurrence_aggregate_usage.py +11 -0
  90. qcs_api_client/models/billing_price_recurrence_interval.py +11 -0
  91. qcs_api_client/models/billing_price_recurrence_usage_type.py +9 -0
  92. qcs_api_client/models/billing_price_scheme.py +9 -0
  93. qcs_api_client/models/billing_price_tiers_mode.py +9 -0
  94. qcs_api_client/models/billing_product.py +109 -0
  95. qcs_api_client/models/billing_product_object.py +8 -0
  96. qcs_api_client/models/billing_upcoming_invoice.py +122 -0
  97. qcs_api_client/models/characteristic.py +125 -0
  98. qcs_api_client/models/check_client_application_request.py +77 -0
  99. qcs_api_client/models/check_client_application_response.py +85 -0
  100. qcs_api_client/models/checksum_description.py +78 -0
  101. qcs_api_client/models/checksum_description_type.py +8 -0
  102. qcs_api_client/models/client_application.py +130 -0
  103. qcs_api_client/models/client_applications_download_link.py +100 -0
  104. qcs_api_client/models/code.py +17 -0
  105. qcs_api_client/models/create_endpoint_parameters.py +93 -0
  106. qcs_api_client/models/create_engagement_request.py +116 -0
  107. qcs_api_client/models/create_reservation_request.py +124 -0
  108. qcs_api_client/models/dictionary.py +55 -0
  109. qcs_api_client/models/edge.py +78 -0
  110. qcs_api_client/models/endpoint.py +140 -0
  111. qcs_api_client/models/endpoint_addresses.py +77 -0
  112. qcs_api_client/models/engagement_credentials.py +87 -0
  113. qcs_api_client/models/engagement_with_credentials.py +169 -0
  114. qcs_api_client/models/error.py +112 -0
  115. qcs_api_client/models/event_billing_price_rate.py +107 -0
  116. qcs_api_client/models/family.py +11 -0
  117. qcs_api_client/models/find_available_reservations_response.py +92 -0
  118. qcs_api_client/models/get_account_event_billing_price_request.py +81 -0
  119. qcs_api_client/models/group.py +112 -0
  120. qcs_api_client/models/health.py +69 -0
  121. qcs_api_client/models/instruction_set_architecture.py +142 -0
  122. qcs_api_client/models/invite_user_request.py +87 -0
  123. qcs_api_client/models/list_account_billing_invoice_lines_response.py +92 -0
  124. qcs_api_client/models/list_account_billing_invoices_response.py +92 -0
  125. qcs_api_client/models/list_client_applications_response.py +83 -0
  126. qcs_api_client/models/list_endpoints_response.py +93 -0
  127. qcs_api_client/models/list_group_reservations_show_deleted.py +9 -0
  128. qcs_api_client/models/list_group_users_response.py +92 -0
  129. qcs_api_client/models/list_groups_response.py +92 -0
  130. qcs_api_client/models/list_instruction_set_architecture_response.py +94 -0
  131. qcs_api_client/models/list_quantum_processor_accessors_response.py +92 -0
  132. qcs_api_client/models/list_quantum_processors_response.py +92 -0
  133. qcs_api_client/models/list_reservations_response.py +91 -0
  134. qcs_api_client/models/list_reservations_show_deleted.py +9 -0
  135. qcs_api_client/models/node.py +76 -0
  136. qcs_api_client/models/nomad_job_datacenters.py +10 -0
  137. qcs_api_client/models/operation.py +138 -0
  138. qcs_api_client/models/operation_site.py +93 -0
  139. qcs_api_client/models/parameter.py +70 -0
  140. qcs_api_client/models/product.py +10 -0
  141. qcs_api_client/models/quantum_processor.py +70 -0
  142. qcs_api_client/models/quantum_processor_accessor.py +112 -0
  143. qcs_api_client/models/quantum_processor_accessor_type.py +9 -0
  144. qcs_api_client/models/quantum_processor_calendar.py +69 -0
  145. qcs_api_client/models/remove_group_user_request.py +95 -0
  146. qcs_api_client/models/reservation.py +218 -0
  147. qcs_api_client/models/restart_endpoint_request.py +67 -0
  148. qcs_api_client/models/tier.py +113 -0
  149. qcs_api_client/models/update_viewer_user_profile_request.py +85 -0
  150. qcs_api_client/models/user.py +110 -0
  151. qcs_api_client/models/user_credentials.py +75 -0
  152. qcs_api_client/models/user_credentials_password.py +69 -0
  153. qcs_api_client/models/user_profile.py +93 -0
  154. qcs_api_client/models/validation_error.py +89 -0
  155. qcs_api_client/models/validation_error_in.py +11 -0
  156. qcs_api_client/models/validation_location.py +11 -0
  157. qcs_api_client/models/viewer_user_onboarding_completed.py +69 -0
  158. qcs_api_client/operations/__init__.py +8 -0
  159. qcs_api_client/operations/asyncio/__init__.py +121 -0
  160. qcs_api_client/operations/asyncio_from_dict/__init__.py +139 -0
  161. qcs_api_client/operations/sync/__init__.py +117 -0
  162. qcs_api_client/operations/sync_from_dict/__init__.py +133 -0
  163. qcs_api_client/py.typed +1 -0
  164. qcs_api_client/types.py +74 -0
  165. qcs_api_client/util/__init__.py +0 -0
  166. qcs_api_client/util/errors.py +32 -0
  167. qcs_api_client/util/retry.py +26 -0
  168. qcs_api_client/util/serialization.py +5 -0
  169. qcs_api_client-0.27.3.dist-info/METADATA +101 -0
  170. qcs_api_client-0.27.3.dist-info/RECORD +172 -0
  171. qcs_api_client-0.27.3.dist-info/WHEEL +4 -0
  172. qcs_api_client-0.27.3.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,177 @@
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
+ user_id: str,
16
+ *,
17
+ page_token: str | Unset = UNSET,
18
+ page_size: int | Unset = UNSET,
19
+ ) -> dict[str, Any]:
20
+
21
+ params: dict[str, Any] = {}
22
+
23
+ params["pageToken"] = page_token
24
+
25
+ params["pageSize"] = page_size
26
+
27
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
28
+
29
+ _kwargs: dict[str, Any] = {
30
+ "method": "get",
31
+ "url": "/v1/users/{user_id}/billingInvoices:listUpcomingLines".format(
32
+ user_id=quote(str(user_id), safe=""),
33
+ ),
34
+ "params": params,
35
+ }
36
+
37
+ return _kwargs
38
+
39
+
40
+ def _parse_response(*, response: httpx.Response) -> Error | ListAccountBillingInvoiceLinesResponse | None:
41
+ if response.status_code == 200:
42
+ response_200 = ListAccountBillingInvoiceLinesResponse.from_dict(response.json())
43
+
44
+ return response_200
45
+
46
+ raise QCSHTTPStatusError(
47
+ message=f"Unexpected response: status code {response.status_code}",
48
+ response=response,
49
+ )
50
+
51
+
52
+ def _build_response(*, response: httpx.Response) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
53
+ """Construct the Response class from the raw ``httpx.Response``."""
54
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
55
+
56
+
57
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
58
+ def sync(
59
+ user_id: str,
60
+ *,
61
+ client: httpx.Client,
62
+ page_token: str | Unset = UNSET,
63
+ page_size: int | Unset = UNSET,
64
+ httpx_request_kwargs: dict[str, Any] | None = None,
65
+ ) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
66
+ """List invoice lines for QCS user billing customer upcoming invoice.
67
+
68
+ Args:
69
+ user_id (str):
70
+ page_token (str | Unset):
71
+ page_size (int | Unset):
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ Response[Error | ListAccountBillingInvoiceLinesResponse]
79
+ """
80
+
81
+ httpx_request_kwargs = httpx_request_kwargs or {}
82
+
83
+ kwargs = _get_kwargs(
84
+ user_id=user_id,
85
+ page_token=page_token,
86
+ page_size=page_size,
87
+ )
88
+ kwargs.update(httpx_request_kwargs)
89
+ response = client.request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(response=response)
94
+
95
+
96
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
97
+ def sync_from_dict(
98
+ user_id: str,
99
+ *,
100
+ client: httpx.Client,
101
+ page_token: str | Unset = UNSET,
102
+ page_size: int | Unset = UNSET,
103
+ httpx_request_kwargs: dict[str, Any] | None = None,
104
+ ) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
105
+ httpx_request_kwargs = httpx_request_kwargs or {}
106
+
107
+ kwargs = _get_kwargs(
108
+ user_id=user_id,
109
+ client=client,
110
+ page_token=page_token,
111
+ page_size=page_size,
112
+ )
113
+ kwargs.update(httpx_request_kwargs)
114
+ response = client.request(
115
+ **kwargs,
116
+ )
117
+ return _build_response(response=response)
118
+
119
+
120
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
121
+ async def asyncio(
122
+ user_id: str,
123
+ *,
124
+ client: httpx.AsyncClient,
125
+ page_token: str | Unset = UNSET,
126
+ page_size: int | Unset = UNSET,
127
+ httpx_request_kwargs: dict[str, Any] | None = None,
128
+ ) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
129
+ """List invoice lines for QCS user billing customer upcoming invoice.
130
+
131
+ Args:
132
+ user_id (str):
133
+ page_token (str | Unset):
134
+ page_size (int | Unset):
135
+
136
+ Raises:
137
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
138
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
139
+
140
+ Returns:
141
+ Response[Error | ListAccountBillingInvoiceLinesResponse]
142
+ """
143
+
144
+ httpx_request_kwargs = httpx_request_kwargs or {}
145
+ kwargs = _get_kwargs(
146
+ user_id=user_id,
147
+ page_token=page_token,
148
+ page_size=page_size,
149
+ )
150
+ kwargs.update(httpx_request_kwargs)
151
+ response = await client.request(**kwargs)
152
+ return _build_response(response=response)
153
+
154
+
155
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
156
+ async def asyncio_from_dict(
157
+ user_id: str,
158
+ *,
159
+ client: httpx.AsyncClient,
160
+ page_token: str | Unset = UNSET,
161
+ page_size: int | Unset = UNSET,
162
+ httpx_request_kwargs: dict[str, Any] | None = None,
163
+ ) -> Response[Error | ListAccountBillingInvoiceLinesResponse]:
164
+ httpx_request_kwargs = httpx_request_kwargs or {}
165
+
166
+ kwargs = _get_kwargs(
167
+ user_id=user_id,
168
+ client=client,
169
+ page_token=page_token,
170
+ page_size=page_size,
171
+ )
172
+ kwargs.update(httpx_request_kwargs)
173
+ response = await client.request(
174
+ **kwargs,
175
+ )
176
+
177
+ return _build_response(response=response)
@@ -0,0 +1,178 @@
1
+ from typing import Any
2
+
3
+ import httpx
4
+ from tenacity import retry
5
+
6
+ from ...models.announcements_response import AnnouncementsResponse
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
+ page_size: int | Unset = UNSET,
16
+ page_token: str | Unset = UNSET,
17
+ include_dismissed: bool | Unset = False,
18
+ ) -> dict[str, Any]:
19
+
20
+ params: dict[str, Any] = {}
21
+
22
+ params["pageSize"] = page_size
23
+
24
+ params["pageToken"] = page_token
25
+
26
+ params["includeDismissed"] = include_dismissed
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/viewer/announcements",
33
+ "params": params,
34
+ }
35
+
36
+ return _kwargs
37
+
38
+
39
+ def _parse_response(*, response: httpx.Response) -> AnnouncementsResponse | Error | None:
40
+ if response.status_code == 200:
41
+ response_200 = AnnouncementsResponse.from_dict(response.json())
42
+
43
+ return response_200
44
+
45
+ raise QCSHTTPStatusError(
46
+ message=f"Unexpected response: status code {response.status_code}",
47
+ response=response,
48
+ )
49
+
50
+
51
+ def _build_response(*, response: httpx.Response) -> Response[AnnouncementsResponse | Error]:
52
+ """Construct the Response class from the raw ``httpx.Response``."""
53
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
54
+
55
+
56
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
57
+ def sync(
58
+ *,
59
+ client: httpx.Client,
60
+ page_size: int | Unset = UNSET,
61
+ page_token: str | Unset = UNSET,
62
+ include_dismissed: bool | Unset = False,
63
+ httpx_request_kwargs: dict[str, Any] | None = None,
64
+ ) -> Response[AnnouncementsResponse | Error]:
65
+ """List all announcements relevant to the authenticating user. By default, does not include dismissed
66
+ announcements.
67
+
68
+ Args:
69
+ page_size (int | Unset):
70
+ page_token (str | Unset):
71
+ include_dismissed (bool | Unset): Default: False.
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ Response[AnnouncementsResponse | Error]
79
+ """
80
+
81
+ httpx_request_kwargs = httpx_request_kwargs or {}
82
+
83
+ kwargs = _get_kwargs(
84
+ page_size=page_size,
85
+ page_token=page_token,
86
+ include_dismissed=include_dismissed,
87
+ )
88
+ kwargs.update(httpx_request_kwargs)
89
+ response = client.request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(response=response)
94
+
95
+
96
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
97
+ def sync_from_dict(
98
+ *,
99
+ client: httpx.Client,
100
+ page_size: int | Unset = UNSET,
101
+ page_token: str | Unset = UNSET,
102
+ include_dismissed: bool | Unset = False,
103
+ httpx_request_kwargs: dict[str, Any] | None = None,
104
+ ) -> Response[AnnouncementsResponse | Error]:
105
+ httpx_request_kwargs = httpx_request_kwargs or {}
106
+
107
+ kwargs = _get_kwargs(
108
+ client=client,
109
+ page_size=page_size,
110
+ page_token=page_token,
111
+ include_dismissed=include_dismissed,
112
+ )
113
+ kwargs.update(httpx_request_kwargs)
114
+ response = client.request(
115
+ **kwargs,
116
+ )
117
+ return _build_response(response=response)
118
+
119
+
120
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
121
+ async def asyncio(
122
+ *,
123
+ client: httpx.AsyncClient,
124
+ page_size: int | Unset = UNSET,
125
+ page_token: str | Unset = UNSET,
126
+ include_dismissed: bool | Unset = False,
127
+ httpx_request_kwargs: dict[str, Any] | None = None,
128
+ ) -> Response[AnnouncementsResponse | Error]:
129
+ """List all announcements relevant to the authenticating user. By default, does not include dismissed
130
+ announcements.
131
+
132
+ Args:
133
+ page_size (int | Unset):
134
+ page_token (str | Unset):
135
+ include_dismissed (bool | Unset): Default: False.
136
+
137
+ Raises:
138
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
139
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
140
+
141
+ Returns:
142
+ Response[AnnouncementsResponse | Error]
143
+ """
144
+
145
+ httpx_request_kwargs = httpx_request_kwargs or {}
146
+ kwargs = _get_kwargs(
147
+ page_size=page_size,
148
+ page_token=page_token,
149
+ include_dismissed=include_dismissed,
150
+ )
151
+ kwargs.update(httpx_request_kwargs)
152
+ response = await client.request(**kwargs)
153
+ return _build_response(response=response)
154
+
155
+
156
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
157
+ async def asyncio_from_dict(
158
+ *,
159
+ client: httpx.AsyncClient,
160
+ page_size: int | Unset = UNSET,
161
+ page_token: str | Unset = UNSET,
162
+ include_dismissed: bool | Unset = False,
163
+ httpx_request_kwargs: dict[str, Any] | None = None,
164
+ ) -> Response[AnnouncementsResponse | Error]:
165
+ httpx_request_kwargs = httpx_request_kwargs or {}
166
+
167
+ kwargs = _get_kwargs(
168
+ client=client,
169
+ page_size=page_size,
170
+ page_token=page_token,
171
+ include_dismissed=include_dismissed,
172
+ )
173
+ kwargs.update(httpx_request_kwargs)
174
+ response = await client.request(
175
+ **kwargs,
176
+ )
177
+
178
+ return _build_response(response=response)
@@ -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.viewer_user_onboarding_completed import ViewerUserOnboardingCompleted
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: ViewerUserOnboardingCompleted | Unset = UNSET,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "put",
21
+ "url": "/v1/viewer/onboardingCompleted",
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) -> Error | ViewerUserOnboardingCompleted | None:
34
+ if response.status_code == 200:
35
+ response_200 = ViewerUserOnboardingCompleted.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 | ViewerUserOnboardingCompleted]:
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: ViewerUserOnboardingCompleted | Unset = UNSET,
55
+ httpx_request_kwargs: dict[str, Any] | None = None,
56
+ ) -> Response[Error | ViewerUserOnboardingCompleted]:
57
+ """Update the onboarding status of the authenticated user.
58
+
59
+ Args:
60
+ body (ViewerUserOnboardingCompleted | Unset):
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 | ViewerUserOnboardingCompleted]
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 | ViewerUserOnboardingCompleted]:
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: ViewerUserOnboardingCompleted | Unset = UNSET,
108
+ httpx_request_kwargs: dict[str, Any] | None = None,
109
+ ) -> Response[Error | ViewerUserOnboardingCompleted]:
110
+ """Update the onboarding status of the authenticated user.
111
+
112
+ Args:
113
+ body (ViewerUserOnboardingCompleted | Unset):
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 | ViewerUserOnboardingCompleted]
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 | ViewerUserOnboardingCompleted]:
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,158 @@
1
+ from typing import Any, cast
2
+
3
+ import httpx
4
+ from tenacity import retry
5
+
6
+ from ...models.error import Error
7
+ from ...models.remove_group_user_request import RemoveGroupUserRequest
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: RemoveGroupUserRequest,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "post",
21
+ "url": "/v1/groups:removeUser",
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: RemoveGroupUserRequest,
53
+ httpx_request_kwargs: dict[str, Any] | None = None,
54
+ ) -> Response[Any | Error]:
55
+ """Remove user from a group.
56
+
57
+ Remove a user from a group. Note, group membership may take several minutes to update within our
58
+ identity provider. After removing a user from a group, please allow up to 60 minutes for changes to
59
+ be reflected.
60
+
61
+ Args:
62
+ body (RemoveGroupUserRequest): Must provide either `userId` or `userEmail` and `groupId`
63
+ or `groupName`.
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[Any | Error]
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[Any | Error]:
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: RemoveGroupUserRequest,
111
+ httpx_request_kwargs: dict[str, Any] | None = None,
112
+ ) -> Response[Any | Error]:
113
+ """Remove user from a group.
114
+
115
+ Remove a user from a group. Note, group membership may take several minutes to update within our
116
+ identity provider. After removing a user from a group, please allow up to 60 minutes for changes to
117
+ be reflected.
118
+
119
+ Args:
120
+ body (RemoveGroupUserRequest): Must provide either `userId` or `userEmail` and `groupId`
121
+ or `groupName`.
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Response[Any | Error]
129
+ """
130
+
131
+ httpx_request_kwargs = httpx_request_kwargs or {}
132
+ kwargs = _get_kwargs(
133
+ body=body,
134
+ )
135
+ kwargs.update(httpx_request_kwargs)
136
+ response = await client.request(**kwargs)
137
+ return _build_response(response=response)
138
+
139
+
140
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
141
+ async def asyncio_from_dict(
142
+ *,
143
+ client: httpx.AsyncClient,
144
+ body: dict,
145
+ httpx_request_kwargs: dict[str, Any] | None = None,
146
+ ) -> Response[Any | Error]:
147
+ httpx_request_kwargs = httpx_request_kwargs or {}
148
+
149
+ kwargs = _get_kwargs(
150
+ client=client,
151
+ body=body,
152
+ )
153
+ kwargs.update(httpx_request_kwargs)
154
+ response = await client.request(
155
+ **kwargs,
156
+ )
157
+
158
+ return _build_response(response=response)