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,123 @@
1
+ from typing import Any
2
+
3
+ import httpx
4
+ from tenacity import retry
5
+
6
+ from ...models.health import Health
7
+ from ...types import Response
8
+ from ...util.errors import QCSHTTPStatusError
9
+ from ...util.retry import DEFAULT_RETRY_ARGUMENTS
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": "/",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(*, response: httpx.Response) -> Health | None:
23
+ if response.status_code == 200:
24
+ response_200 = Health.from_dict(response.json())
25
+
26
+ return response_200
27
+
28
+ raise QCSHTTPStatusError(
29
+ message=f"Unexpected response: status code {response.status_code}",
30
+ response=response,
31
+ )
32
+
33
+
34
+ def _build_response(*, response: httpx.Response) -> Response[Health]:
35
+ """Construct the Response class from the raw ``httpx.Response``."""
36
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
37
+
38
+
39
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
40
+ def sync(
41
+ *,
42
+ client: httpx.Client,
43
+ httpx_request_kwargs: dict[str, Any] | None = None,
44
+ ) -> Response[Health]:
45
+ """Retrieve the health status of the API
46
+
47
+ Raises:
48
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
49
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
50
+
51
+ Returns:
52
+ Response[Health]
53
+ """
54
+
55
+ httpx_request_kwargs = httpx_request_kwargs or {}
56
+
57
+ kwargs = _get_kwargs()
58
+ kwargs.update(httpx_request_kwargs)
59
+ response = client.request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(response=response)
64
+
65
+
66
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
67
+ def sync_from_dict(
68
+ *,
69
+ client: httpx.Client,
70
+ httpx_request_kwargs: dict[str, Any] | None = None,
71
+ ) -> Response[Health]:
72
+ httpx_request_kwargs = httpx_request_kwargs or {}
73
+
74
+ kwargs = _get_kwargs(
75
+ client=client,
76
+ )
77
+ kwargs.update(httpx_request_kwargs)
78
+ response = client.request(
79
+ **kwargs,
80
+ )
81
+ return _build_response(response=response)
82
+
83
+
84
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
85
+ async def asyncio(
86
+ *,
87
+ client: httpx.AsyncClient,
88
+ httpx_request_kwargs: dict[str, Any] | None = None,
89
+ ) -> Response[Health]:
90
+ """Retrieve the health status of the API
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Response[Health]
98
+ """
99
+
100
+ httpx_request_kwargs = httpx_request_kwargs or {}
101
+ kwargs = _get_kwargs()
102
+ kwargs.update(httpx_request_kwargs)
103
+ response = await client.request(**kwargs)
104
+ return _build_response(response=response)
105
+
106
+
107
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
108
+ async def asyncio_from_dict(
109
+ *,
110
+ client: httpx.AsyncClient,
111
+ httpx_request_kwargs: dict[str, Any] | None = None,
112
+ ) -> Response[Health]:
113
+ httpx_request_kwargs = httpx_request_kwargs or {}
114
+
115
+ kwargs = _get_kwargs(
116
+ client=client,
117
+ )
118
+ kwargs.update(httpx_request_kwargs)
119
+ response = await client.request(
120
+ **kwargs,
121
+ )
122
+
123
+ 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 ...types import Response
7
+ from ...util.errors import QCSHTTPStatusError
8
+ from ...util.retry import DEFAULT_RETRY_ARGUMENTS
9
+
10
+
11
+ def _get_kwargs() -> dict[str, Any]:
12
+
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "get",
15
+ "url": "/v1/healthcheck",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(*, response: httpx.Response) -> Any | None:
22
+ if response.status_code == 200:
23
+ return None
24
+
25
+ raise QCSHTTPStatusError(
26
+ message=f"Unexpected response: status code {response.status_code}",
27
+ response=response,
28
+ )
29
+
30
+
31
+ def _build_response(*, response: httpx.Response) -> Response[Any]:
32
+ """Construct the Response class from the raw ``httpx.Response``."""
33
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
34
+
35
+
36
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
37
+ def sync(
38
+ *,
39
+ client: httpx.Client,
40
+ httpx_request_kwargs: dict[str, Any] | None = None,
41
+ ) -> Response[Any]:
42
+ """Health Check
43
+
44
+ Check the health of the service.
45
+
46
+ Raises:
47
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
48
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
49
+
50
+ Returns:
51
+ Response[Any]
52
+ """
53
+
54
+ httpx_request_kwargs = httpx_request_kwargs or {}
55
+
56
+ kwargs = _get_kwargs()
57
+ kwargs.update(httpx_request_kwargs)
58
+ response = client.request(
59
+ **kwargs,
60
+ )
61
+
62
+ return _build_response(response=response)
63
+
64
+
65
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
66
+ def sync_from_dict(
67
+ *,
68
+ client: httpx.Client,
69
+ httpx_request_kwargs: dict[str, Any] | None = None,
70
+ ) -> Response[Any]:
71
+ httpx_request_kwargs = httpx_request_kwargs or {}
72
+
73
+ kwargs = _get_kwargs(
74
+ client=client,
75
+ )
76
+ kwargs.update(httpx_request_kwargs)
77
+ response = client.request(
78
+ **kwargs,
79
+ )
80
+ return _build_response(response=response)
81
+
82
+
83
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
84
+ async def asyncio(
85
+ *,
86
+ client: httpx.AsyncClient,
87
+ httpx_request_kwargs: dict[str, Any] | None = None,
88
+ ) -> Response[Any]:
89
+ """Health Check
90
+
91
+ Check the health of the service.
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[Any]
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[Any]:
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,126 @@
1
+ from typing import Any
2
+
3
+ import httpx
4
+ from tenacity import retry
5
+
6
+ from ...models.validation_error import ValidationError
7
+ from ...types import Response
8
+ from ...util.errors import QCSHTTPStatusError
9
+ from ...util.retry import DEFAULT_RETRY_ARGUMENTS
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": "/v1/",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(*, response: httpx.Response) -> Any | ValidationError | None:
23
+ if response.status_code == 200:
24
+ response_200 = response.json()
25
+ return response_200
26
+
27
+ raise QCSHTTPStatusError(
28
+ message=f"Unexpected response: status code {response.status_code}",
29
+ response=response,
30
+ )
31
+
32
+
33
+ def _build_response(*, response: httpx.Response) -> Response[Any | ValidationError]:
34
+ """Construct the Response class from the raw ``httpx.Response``."""
35
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
36
+
37
+
38
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
39
+ def sync(
40
+ *,
41
+ client: httpx.Client,
42
+ httpx_request_kwargs: dict[str, Any] | None = None,
43
+ ) -> Response[Any | ValidationError]:
44
+ """Health Check
45
+
46
+ Endpoint to return a status 200 for load balancer health checks
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[Any | ValidationError]
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[Any | ValidationError]:
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[Any | ValidationError]:
91
+ """Health Check
92
+
93
+ Endpoint to return a status 200 for load balancer health checks
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Response[Any | ValidationError]
101
+ """
102
+
103
+ httpx_request_kwargs = httpx_request_kwargs or {}
104
+ kwargs = _get_kwargs()
105
+ kwargs.update(httpx_request_kwargs)
106
+ response = await client.request(**kwargs)
107
+ return _build_response(response=response)
108
+
109
+
110
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
111
+ async def asyncio_from_dict(
112
+ *,
113
+ client: httpx.AsyncClient,
114
+ httpx_request_kwargs: dict[str, Any] | None = None,
115
+ ) -> Response[Any | ValidationError]:
116
+ httpx_request_kwargs = httpx_request_kwargs or {}
117
+
118
+ kwargs = _get_kwargs(
119
+ client=client,
120
+ )
121
+ kwargs.update(httpx_request_kwargs)
122
+ response = await client.request(
123
+ **kwargs,
124
+ )
125
+
126
+ return _build_response(response=response)
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,157 @@
1
+ from typing import Any
2
+
3
+ import httpx
4
+ from tenacity import retry
5
+
6
+ from ...models.create_endpoint_parameters import CreateEndpointParameters
7
+ from ...models.endpoint import Endpoint
8
+ from ...models.error import Error
9
+ from ...models.validation_error import ValidationError
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
+ *,
17
+ body: CreateEndpointParameters,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "post",
23
+ "url": "/v1/endpoints",
24
+ }
25
+
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) -> Endpoint | Error | ValidationError | None:
35
+ if response.status_code == 201:
36
+ response_201 = Endpoint.from_dict(response.json())
37
+
38
+ return response_201
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[Endpoint | Error | ValidationError]:
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: CreateEndpointParameters,
56
+ httpx_request_kwargs: dict[str, Any] | None = None,
57
+ ) -> Response[Endpoint | Error | ValidationError]:
58
+ """Create Endpoint
59
+
60
+ Create an endpoint associated with your user account.
61
+
62
+ Args:
63
+ body (CreateEndpointParameters): A publicly available set of parameters for defining an
64
+ endpoint.
65
+
66
+ Raises:
67
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
68
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
69
+
70
+ Returns:
71
+ Response[Endpoint | Error | ValidationError]
72
+ """
73
+
74
+ httpx_request_kwargs = httpx_request_kwargs or {}
75
+
76
+ kwargs = _get_kwargs(
77
+ body=body,
78
+ )
79
+ kwargs.update(httpx_request_kwargs)
80
+ response = client.request(
81
+ **kwargs,
82
+ )
83
+
84
+ return _build_response(response=response)
85
+
86
+
87
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
88
+ def sync_from_dict(
89
+ *,
90
+ client: httpx.Client,
91
+ body: dict,
92
+ httpx_request_kwargs: dict[str, Any] | None = None,
93
+ ) -> Response[Endpoint | Error | ValidationError]:
94
+ httpx_request_kwargs = httpx_request_kwargs or {}
95
+
96
+ kwargs = _get_kwargs(
97
+ client=client,
98
+ body=body,
99
+ )
100
+ kwargs.update(httpx_request_kwargs)
101
+ response = client.request(
102
+ **kwargs,
103
+ )
104
+ return _build_response(response=response)
105
+
106
+
107
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
108
+ async def asyncio(
109
+ *,
110
+ client: httpx.AsyncClient,
111
+ body: CreateEndpointParameters,
112
+ httpx_request_kwargs: dict[str, Any] | None = None,
113
+ ) -> Response[Endpoint | Error | ValidationError]:
114
+ """Create Endpoint
115
+
116
+ Create an endpoint associated with your user account.
117
+
118
+ Args:
119
+ body (CreateEndpointParameters): A publicly available set of parameters for defining an
120
+ endpoint.
121
+
122
+ Raises:
123
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
125
+
126
+ Returns:
127
+ Response[Endpoint | Error | ValidationError]
128
+ """
129
+
130
+ httpx_request_kwargs = httpx_request_kwargs or {}
131
+ kwargs = _get_kwargs(
132
+ body=body,
133
+ )
134
+ kwargs.update(httpx_request_kwargs)
135
+ response = await client.request(**kwargs)
136
+ return _build_response(response=response)
137
+
138
+
139
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
140
+ async def asyncio_from_dict(
141
+ *,
142
+ client: httpx.AsyncClient,
143
+ body: dict,
144
+ httpx_request_kwargs: dict[str, Any] | None = None,
145
+ ) -> Response[Endpoint | Error | ValidationError]:
146
+ httpx_request_kwargs = httpx_request_kwargs or {}
147
+
148
+ kwargs = _get_kwargs(
149
+ client=client,
150
+ body=body,
151
+ )
152
+ kwargs.update(httpx_request_kwargs)
153
+ response = await client.request(
154
+ **kwargs,
155
+ )
156
+
157
+ return _build_response(response=response)
@@ -0,0 +1,148 @@
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 ...models.validation_error import ValidationError
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
+ endpoint_id: str,
16
+ ) -> dict[str, Any]:
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "delete",
20
+ "url": "/v1/endpoints/{endpoint_id}".format(
21
+ endpoint_id=quote(str(endpoint_id), safe=""),
22
+ ),
23
+ }
24
+
25
+ return _kwargs
26
+
27
+
28
+ def _parse_response(*, response: httpx.Response) -> Any | Error | ValidationError | None:
29
+ if response.status_code == 204:
30
+ response_204 = cast(Any, None)
31
+ return response_204
32
+
33
+ raise QCSHTTPStatusError(
34
+ message=f"Unexpected response: status code {response.status_code}",
35
+ response=response,
36
+ )
37
+
38
+
39
+ def _build_response(*, response: httpx.Response) -> Response[Any | Error | ValidationError]:
40
+ """Construct the Response class from the raw ``httpx.Response``."""
41
+ return Response.build_from_httpx_response(response=response, parse_function=_parse_response)
42
+
43
+
44
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
45
+ def sync(
46
+ endpoint_id: str,
47
+ *,
48
+ client: httpx.Client,
49
+ httpx_request_kwargs: dict[str, Any] | None = None,
50
+ ) -> Response[Any | Error | ValidationError]:
51
+ """Delete Endpoint
52
+
53
+ Delete an endpoint, releasing its resources. This operation is not reversible.
54
+
55
+ Args:
56
+ endpoint_id (str):
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[Any | Error | ValidationError]
64
+ """
65
+
66
+ httpx_request_kwargs = httpx_request_kwargs or {}
67
+
68
+ kwargs = _get_kwargs(
69
+ endpoint_id=endpoint_id,
70
+ )
71
+ kwargs.update(httpx_request_kwargs)
72
+ response = client.request(
73
+ **kwargs,
74
+ )
75
+
76
+ return _build_response(response=response)
77
+
78
+
79
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
80
+ def sync_from_dict(
81
+ endpoint_id: str,
82
+ *,
83
+ client: httpx.Client,
84
+ httpx_request_kwargs: dict[str, Any] | None = None,
85
+ ) -> Response[Any | Error | ValidationError]:
86
+ httpx_request_kwargs = httpx_request_kwargs or {}
87
+
88
+ kwargs = _get_kwargs(
89
+ endpoint_id=endpoint_id,
90
+ client=client,
91
+ )
92
+ kwargs.update(httpx_request_kwargs)
93
+ response = client.request(
94
+ **kwargs,
95
+ )
96
+ return _build_response(response=response)
97
+
98
+
99
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
100
+ async def asyncio(
101
+ endpoint_id: str,
102
+ *,
103
+ client: httpx.AsyncClient,
104
+ httpx_request_kwargs: dict[str, Any] | None = None,
105
+ ) -> Response[Any | Error | ValidationError]:
106
+ """Delete Endpoint
107
+
108
+ Delete an endpoint, releasing its resources. This operation is not reversible.
109
+
110
+ Args:
111
+ endpoint_id (str):
112
+
113
+ Raises:
114
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
115
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
116
+
117
+ Returns:
118
+ Response[Any | Error | ValidationError]
119
+ """
120
+
121
+ httpx_request_kwargs = httpx_request_kwargs or {}
122
+ kwargs = _get_kwargs(
123
+ endpoint_id=endpoint_id,
124
+ )
125
+ kwargs.update(httpx_request_kwargs)
126
+ response = await client.request(**kwargs)
127
+ return _build_response(response=response)
128
+
129
+
130
+ @retry(**DEFAULT_RETRY_ARGUMENTS)
131
+ async def asyncio_from_dict(
132
+ endpoint_id: str,
133
+ *,
134
+ client: httpx.AsyncClient,
135
+ httpx_request_kwargs: dict[str, Any] | None = None,
136
+ ) -> Response[Any | Error | ValidationError]:
137
+ httpx_request_kwargs = httpx_request_kwargs or {}
138
+
139
+ kwargs = _get_kwargs(
140
+ endpoint_id=endpoint_id,
141
+ client=client,
142
+ )
143
+ kwargs.update(httpx_request_kwargs)
144
+ response = await client.request(
145
+ **kwargs,
146
+ )
147
+
148
+ return _build_response(response=response)