fal 0.12.1__py3-none-any.whl → 0.12.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.

Potentially problematic release.


This version of fal might be problematic. Click here for more details.

Files changed (116) hide show
  1. fal/__init__.py +12 -3
  2. fal/_serialization.py +18 -0
  3. fal/api.py +140 -59
  4. fal/app.py +309 -86
  5. fal/apps.py +92 -8
  6. fal/auth/__init__.py +20 -1
  7. fal/auth/auth0.py +32 -22
  8. fal/cli.py +34 -52
  9. fal/env.py +0 -4
  10. fal/exceptions/handlers.py +3 -2
  11. fal/flags.py +5 -0
  12. fal/logging/__init__.py +0 -2
  13. fal/logging/trace.py +8 -1
  14. fal/logging/user.py +2 -1
  15. fal/rest_client.py +2 -2
  16. fal/sdk.py +46 -31
  17. fal/sync.py +3 -3
  18. fal/toolkit/__init__.py +18 -1
  19. fal/toolkit/file/file.py +98 -11
  20. fal/toolkit/file/providers/fal.py +43 -2
  21. fal/toolkit/file/types.py +1 -1
  22. fal/toolkit/image/image.py +26 -4
  23. fal/toolkit/optimize.py +50 -0
  24. fal/toolkit/utils/download_utils.py +59 -13
  25. {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/METADATA +7 -7
  26. fal-0.12.3.dist-info/RECORD +66 -0
  27. openapi_fal_rest/models/__init__.py +2 -70
  28. openapi_fal_rest/models/customer_details.py +26 -0
  29. openapi_fal_rest/models/lock_reason.py +16 -0
  30. fal/logging/datadog.py +0 -77
  31. fal-0.12.1.dist-info/RECORD +0 -147
  32. openapi_fal_rest/api/admin/get_invoice_users.py +0 -142
  33. openapi_fal_rest/api/admin/get_usage_per_user.py +0 -199
  34. openapi_fal_rest/api/admin/handle_user_lock.py +0 -191
  35. openapi_fal_rest/api/admin/set_billing_type.py +0 -186
  36. openapi_fal_rest/api/applications/get_status_applications_app_user_id_app_alias_or_id_status_get.py +0 -179
  37. openapi_fal_rest/api/billing/delete_payment_method.py +0 -162
  38. openapi_fal_rest/api/billing/get_checkout_page.py +0 -198
  39. openapi_fal_rest/api/billing/get_setup_intent_key.py +0 -141
  40. openapi_fal_rest/api/billing/get_user_invoices.py +0 -152
  41. openapi_fal_rest/api/billing/get_user_payment_methods.py +0 -152
  42. openapi_fal_rest/api/billing/get_user_price.py +0 -186
  43. openapi_fal_rest/api/billing/get_user_spending.py +0 -192
  44. openapi_fal_rest/api/billing/handle_stripe_webhook.py +0 -173
  45. openapi_fal_rest/api/billing/upcoming_invoice.py +0 -143
  46. openapi_fal_rest/api/billing/update_customer_budget.py +0 -183
  47. openapi_fal_rest/api/files/delete.py +0 -162
  48. openapi_fal_rest/api/files/download.py +0 -162
  49. openapi_fal_rest/api/files/file_exists.py +0 -183
  50. openapi_fal_rest/api/files/list_directory.py +0 -173
  51. openapi_fal_rest/api/files/list_root.py +0 -152
  52. openapi_fal_rest/api/files/upload_from_url.py +0 -179
  53. openapi_fal_rest/api/health/__init__.py +0 -0
  54. openapi_fal_rest/api/health/check.py +0 -136
  55. openapi_fal_rest/api/keys/__init__.py +0 -0
  56. openapi_fal_rest/api/keys/create_key.py +0 -188
  57. openapi_fal_rest/api/keys/delete_key.py +0 -162
  58. openapi_fal_rest/api/keys/list_keys.py +0 -152
  59. openapi_fal_rest/api/logs/__init__.py +0 -0
  60. openapi_fal_rest/api/logs/list_since.py +0 -224
  61. openapi_fal_rest/api/requests/__init__.py +0 -0
  62. openapi_fal_rest/api/requests/requests.py +0 -247
  63. openapi_fal_rest/api/storage/__init__.py +0 -0
  64. openapi_fal_rest/api/storage/get_file_link.py +0 -200
  65. openapi_fal_rest/api/storage/initiate_upload.py +0 -172
  66. openapi_fal_rest/api/storage/upload_file.py +0 -172
  67. openapi_fal_rest/api/tokens/__init__.py +0 -0
  68. openapi_fal_rest/api/tokens/create_token.py +0 -166
  69. openapi_fal_rest/api/usage/__init__.py +0 -0
  70. openapi_fal_rest/api/usage/get_custom_usage_per_machine.py +0 -203
  71. openapi_fal_rest/api/usage/get_gateway_request_stats.py +0 -247
  72. openapi_fal_rest/api/usage/get_gateway_request_stats_by_time.py +0 -236
  73. openapi_fal_rest/api/usage/get_gateway_stats_for_yesterday.py +0 -152
  74. openapi_fal_rest/api/usage/get_shared_usage_per_app.py +0 -203
  75. openapi_fal_rest/api/usage/get_usage_records.py +0 -253
  76. openapi_fal_rest/api/usage/per_machine_usage.py +0 -218
  77. openapi_fal_rest/api/usage/per_machine_usage_details.py +0 -173
  78. openapi_fal_rest/api/users/__init__.py +0 -0
  79. openapi_fal_rest/api/users/handle_user_registration.py +0 -228
  80. openapi_fal_rest/models/billing_type.py +0 -9
  81. openapi_fal_rest/models/body_create_token.py +0 -68
  82. openapi_fal_rest/models/body_upload_file.py +0 -75
  83. openapi_fal_rest/models/file_spec.py +0 -110
  84. openapi_fal_rest/models/gateway_stats_by_time.py +0 -115
  85. openapi_fal_rest/models/gateway_usage_stats.py +0 -147
  86. openapi_fal_rest/models/get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.py +0 -70
  87. openapi_fal_rest/models/grouped_usage_detail.py +0 -85
  88. openapi_fal_rest/models/handle_stripe_webhook_response_handle_stripe_webhook.py +0 -43
  89. openapi_fal_rest/models/initiate_upload_info.py +0 -64
  90. openapi_fal_rest/models/invoice.py +0 -129
  91. openapi_fal_rest/models/invoice_item.py +0 -85
  92. openapi_fal_rest/models/key_scope.py +0 -9
  93. openapi_fal_rest/models/log_entry.py +0 -104
  94. openapi_fal_rest/models/log_entry_labels.py +0 -43
  95. openapi_fal_rest/models/new_user_key.py +0 -64
  96. openapi_fal_rest/models/payment_method.py +0 -96
  97. openapi_fal_rest/models/per_app_usage_detail.py +0 -88
  98. openapi_fal_rest/models/persisted_usage_record.py +0 -118
  99. openapi_fal_rest/models/persisted_usage_record_meta.py +0 -43
  100. openapi_fal_rest/models/presigned_upload_url.py +0 -64
  101. openapi_fal_rest/models/request_io.py +0 -112
  102. openapi_fal_rest/models/request_io_json_input.py +0 -43
  103. openapi_fal_rest/models/request_io_json_output.py +0 -43
  104. openapi_fal_rest/models/run_type.py +0 -9
  105. openapi_fal_rest/models/stats_timeframe.py +0 -12
  106. openapi_fal_rest/models/status.py +0 -82
  107. openapi_fal_rest/models/status_health.py +0 -10
  108. openapi_fal_rest/models/uploaded_file_result.py +0 -64
  109. openapi_fal_rest/models/url_file_upload.py +0 -57
  110. openapi_fal_rest/models/usage_per_machine_type.py +0 -115
  111. openapi_fal_rest/models/usage_per_user.py +0 -71
  112. openapi_fal_rest/models/usage_run_detail.py +0 -73
  113. openapi_fal_rest/models/user_key_info.py +0 -84
  114. /openapi_fal_rest/api/admin/__init__.py → /fal/py.typed +0 -0
  115. {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/WHEEL +0 -0
  116. {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/entry_points.txt +0 -0
@@ -1,152 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Dict, List, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...models.http_validation_error import HTTPValidationError
9
- from ...models.per_app_usage_detail import PerAppUsageDetail
10
- from ...types import Response
11
-
12
-
13
- def _get_kwargs(
14
- *,
15
- client: Client,
16
- ) -> Dict[str, Any]:
17
- url = "{}/usage/stats/yesterday".format(client.base_url)
18
-
19
- headers: Dict[str, str] = client.get_headers()
20
- cookies: Dict[str, Any] = client.get_cookies()
21
-
22
- return {
23
- "method": "get",
24
- "url": url,
25
- "headers": headers,
26
- "cookies": cookies,
27
- "timeout": client.get_timeout(),
28
- "follow_redirects": client.follow_redirects,
29
- }
30
-
31
-
32
- def _parse_response(
33
- *, client: Client, response: httpx.Response
34
- ) -> Optional[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
35
- if response.status_code == HTTPStatus.OK:
36
- response_200 = []
37
- _response_200 = response.json()
38
- for response_200_item_data in _response_200:
39
- response_200_item = PerAppUsageDetail.from_dict(response_200_item_data)
40
-
41
- response_200.append(response_200_item)
42
-
43
- return response_200
44
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
45
- response_422 = HTTPValidationError.from_dict(response.json())
46
-
47
- return response_422
48
- if client.raise_on_unexpected_status:
49
- raise errors.UnexpectedStatus(response.status_code, response.content)
50
- else:
51
- return None
52
-
53
-
54
- def _build_response(
55
- *, client: Client, response: httpx.Response
56
- ) -> Response[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
57
- return Response(
58
- status_code=HTTPStatus(response.status_code),
59
- content=response.content,
60
- headers=response.headers,
61
- parsed=_parse_response(client=client, response=response),
62
- )
63
-
64
-
65
- def sync_detailed(
66
- *,
67
- client: Client,
68
- ) -> Response[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
69
- """Get Gateway Stats For Yesterday
70
-
71
- Raises:
72
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
73
- httpx.TimeoutException: If the request takes longer than Client.timeout.
74
-
75
- Returns:
76
- Response[Union[HTTPValidationError, List['PerAppUsageDetail']]]
77
- """
78
-
79
- kwargs = _get_kwargs(
80
- client=client,
81
- )
82
-
83
- response = httpx.request(
84
- verify=client.verify_ssl,
85
- **kwargs,
86
- )
87
-
88
- return _build_response(client=client, response=response)
89
-
90
-
91
- def sync(
92
- *,
93
- client: Client,
94
- ) -> Optional[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
95
- """Get Gateway Stats For Yesterday
96
-
97
- Raises:
98
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
- httpx.TimeoutException: If the request takes longer than Client.timeout.
100
-
101
- Returns:
102
- Union[HTTPValidationError, List['PerAppUsageDetail']]
103
- """
104
-
105
- return sync_detailed(
106
- client=client,
107
- ).parsed
108
-
109
-
110
- async def asyncio_detailed(
111
- *,
112
- client: Client,
113
- ) -> Response[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
114
- """Get Gateway Stats For Yesterday
115
-
116
- Raises:
117
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
- httpx.TimeoutException: If the request takes longer than Client.timeout.
119
-
120
- Returns:
121
- Response[Union[HTTPValidationError, List['PerAppUsageDetail']]]
122
- """
123
-
124
- kwargs = _get_kwargs(
125
- client=client,
126
- )
127
-
128
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
129
- response = await _client.request(**kwargs)
130
-
131
- return _build_response(client=client, response=response)
132
-
133
-
134
- async def asyncio(
135
- *,
136
- client: Client,
137
- ) -> Optional[Union[HTTPValidationError, List["PerAppUsageDetail"]]]:
138
- """Get Gateway Stats For Yesterday
139
-
140
- Raises:
141
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142
- httpx.TimeoutException: If the request takes longer than Client.timeout.
143
-
144
- Returns:
145
- Union[HTTPValidationError, List['PerAppUsageDetail']]
146
- """
147
-
148
- return (
149
- await asyncio_detailed(
150
- client=client,
151
- )
152
- ).parsed
@@ -1,203 +0,0 @@
1
- import datetime
2
- from http import HTTPStatus
3
- from typing import Any, Dict, List, Optional, Union
4
-
5
- import httpx
6
-
7
- from ... import errors
8
- from ...client import Client
9
- from ...models.grouped_usage_detail import GroupedUsageDetail
10
- from ...models.http_validation_error import HTTPValidationError
11
- from ...types import UNSET, Response, Unset
12
-
13
-
14
- def _get_kwargs(
15
- *,
16
- client: Client,
17
- start_date: Union[Unset, None, datetime.date] = UNSET,
18
- end_date: Union[Unset, None, datetime.date] = UNSET,
19
- ) -> Dict[str, Any]:
20
- url = "{}/usage/shared_usage_per_app".format(client.base_url)
21
-
22
- headers: Dict[str, str] = client.get_headers()
23
- cookies: Dict[str, Any] = client.get_cookies()
24
-
25
- params: Dict[str, Any] = {}
26
- json_start_date: Union[Unset, None, str] = UNSET
27
- if not isinstance(start_date, Unset):
28
- json_start_date = start_date.isoformat() if start_date else None
29
-
30
- params["start_date"] = json_start_date
31
-
32
- json_end_date: Union[Unset, None, str] = UNSET
33
- if not isinstance(end_date, Unset):
34
- json_end_date = end_date.isoformat() if end_date else None
35
-
36
- params["end_date"] = json_end_date
37
-
38
- params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
39
-
40
- return {
41
- "method": "get",
42
- "url": url,
43
- "headers": headers,
44
- "cookies": cookies,
45
- "timeout": client.get_timeout(),
46
- "follow_redirects": client.follow_redirects,
47
- "params": params,
48
- }
49
-
50
-
51
- def _parse_response(
52
- *, client: Client, response: httpx.Response
53
- ) -> Optional[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
54
- if response.status_code == HTTPStatus.OK:
55
- response_200 = []
56
- _response_200 = response.json()
57
- for response_200_item_data in _response_200:
58
- response_200_item = GroupedUsageDetail.from_dict(response_200_item_data)
59
-
60
- response_200.append(response_200_item)
61
-
62
- return response_200
63
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
64
- response_422 = HTTPValidationError.from_dict(response.json())
65
-
66
- return response_422
67
- if client.raise_on_unexpected_status:
68
- raise errors.UnexpectedStatus(response.status_code, response.content)
69
- else:
70
- return None
71
-
72
-
73
- def _build_response(
74
- *, client: Client, response: httpx.Response
75
- ) -> Response[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
76
- return Response(
77
- status_code=HTTPStatus(response.status_code),
78
- content=response.content,
79
- headers=response.headers,
80
- parsed=_parse_response(client=client, response=response),
81
- )
82
-
83
-
84
- def sync_detailed(
85
- *,
86
- client: Client,
87
- start_date: Union[Unset, None, datetime.date] = UNSET,
88
- end_date: Union[Unset, None, datetime.date] = UNSET,
89
- ) -> Response[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
90
- """Get Shared Usage Per App
91
-
92
- Args:
93
- start_date (Union[Unset, None, datetime.date]):
94
- end_date (Union[Unset, None, datetime.date]):
95
-
96
- Raises:
97
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
- httpx.TimeoutException: If the request takes longer than Client.timeout.
99
-
100
- Returns:
101
- Response[Union[HTTPValidationError, List['GroupedUsageDetail']]]
102
- """
103
-
104
- kwargs = _get_kwargs(
105
- client=client,
106
- start_date=start_date,
107
- end_date=end_date,
108
- )
109
-
110
- response = httpx.request(
111
- verify=client.verify_ssl,
112
- **kwargs,
113
- )
114
-
115
- return _build_response(client=client, response=response)
116
-
117
-
118
- def sync(
119
- *,
120
- client: Client,
121
- start_date: Union[Unset, None, datetime.date] = UNSET,
122
- end_date: Union[Unset, None, datetime.date] = UNSET,
123
- ) -> Optional[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
124
- """Get Shared Usage Per App
125
-
126
- Args:
127
- start_date (Union[Unset, None, datetime.date]):
128
- end_date (Union[Unset, None, datetime.date]):
129
-
130
- Raises:
131
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
132
- httpx.TimeoutException: If the request takes longer than Client.timeout.
133
-
134
- Returns:
135
- Union[HTTPValidationError, List['GroupedUsageDetail']]
136
- """
137
-
138
- return sync_detailed(
139
- client=client,
140
- start_date=start_date,
141
- end_date=end_date,
142
- ).parsed
143
-
144
-
145
- async def asyncio_detailed(
146
- *,
147
- client: Client,
148
- start_date: Union[Unset, None, datetime.date] = UNSET,
149
- end_date: Union[Unset, None, datetime.date] = UNSET,
150
- ) -> Response[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
151
- """Get Shared Usage Per App
152
-
153
- Args:
154
- start_date (Union[Unset, None, datetime.date]):
155
- end_date (Union[Unset, None, datetime.date]):
156
-
157
- Raises:
158
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
- httpx.TimeoutException: If the request takes longer than Client.timeout.
160
-
161
- Returns:
162
- Response[Union[HTTPValidationError, List['GroupedUsageDetail']]]
163
- """
164
-
165
- kwargs = _get_kwargs(
166
- client=client,
167
- start_date=start_date,
168
- end_date=end_date,
169
- )
170
-
171
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
172
- response = await _client.request(**kwargs)
173
-
174
- return _build_response(client=client, response=response)
175
-
176
-
177
- async def asyncio(
178
- *,
179
- client: Client,
180
- start_date: Union[Unset, None, datetime.date] = UNSET,
181
- end_date: Union[Unset, None, datetime.date] = UNSET,
182
- ) -> Optional[Union[HTTPValidationError, List["GroupedUsageDetail"]]]:
183
- """Get Shared Usage Per App
184
-
185
- Args:
186
- start_date (Union[Unset, None, datetime.date]):
187
- end_date (Union[Unset, None, datetime.date]):
188
-
189
- Raises:
190
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
191
- httpx.TimeoutException: If the request takes longer than Client.timeout.
192
-
193
- Returns:
194
- Union[HTTPValidationError, List['GroupedUsageDetail']]
195
- """
196
-
197
- return (
198
- await asyncio_detailed(
199
- client=client,
200
- start_date=start_date,
201
- end_date=end_date,
202
- )
203
- ).parsed
@@ -1,253 +0,0 @@
1
- import datetime
2
- from http import HTTPStatus
3
- from typing import Any, Dict, List, Optional, Union
4
-
5
- import httpx
6
-
7
- from ... import errors
8
- from ...client import Client
9
- from ...models.http_validation_error import HTTPValidationError
10
- from ...models.persisted_usage_record import PersistedUsageRecord
11
- from ...models.run_type import RunType
12
- from ...types import UNSET, Response, Unset
13
-
14
-
15
- def _get_kwargs(
16
- *,
17
- client: Client,
18
- start_date: Union[Unset, None, datetime.date] = UNSET,
19
- end_date: Union[Unset, None, datetime.date] = UNSET,
20
- run_type: Union[Unset, None, RunType] = UNSET,
21
- request_host: Union[Unset, None, str] = UNSET,
22
- machine_type: Union[Unset, None, str] = UNSET,
23
- ) -> Dict[str, Any]:
24
- url = "{}/usage/usage_records".format(client.base_url)
25
-
26
- headers: Dict[str, str] = client.get_headers()
27
- cookies: Dict[str, Any] = client.get_cookies()
28
-
29
- params: Dict[str, Any] = {}
30
- json_start_date: Union[Unset, None, str] = UNSET
31
- if not isinstance(start_date, Unset):
32
- json_start_date = start_date.isoformat() if start_date else None
33
-
34
- params["start_date"] = json_start_date
35
-
36
- json_end_date: Union[Unset, None, str] = UNSET
37
- if not isinstance(end_date, Unset):
38
- json_end_date = end_date.isoformat() if end_date else None
39
-
40
- params["end_date"] = json_end_date
41
-
42
- json_run_type: Union[Unset, None, str] = UNSET
43
- if not isinstance(run_type, Unset):
44
- json_run_type = run_type.value if run_type else None
45
-
46
- params["run_type"] = json_run_type
47
-
48
- params["request_host"] = request_host
49
-
50
- params["machine_type"] = machine_type
51
-
52
- params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
53
-
54
- return {
55
- "method": "get",
56
- "url": url,
57
- "headers": headers,
58
- "cookies": cookies,
59
- "timeout": client.get_timeout(),
60
- "follow_redirects": client.follow_redirects,
61
- "params": params,
62
- }
63
-
64
-
65
- def _parse_response(
66
- *, client: Client, response: httpx.Response
67
- ) -> Optional[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
68
- if response.status_code == HTTPStatus.OK:
69
- response_200 = []
70
- _response_200 = response.json()
71
- for response_200_item_data in _response_200:
72
- response_200_item = PersistedUsageRecord.from_dict(response_200_item_data)
73
-
74
- response_200.append(response_200_item)
75
-
76
- return response_200
77
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
78
- response_422 = HTTPValidationError.from_dict(response.json())
79
-
80
- return response_422
81
- if client.raise_on_unexpected_status:
82
- raise errors.UnexpectedStatus(response.status_code, response.content)
83
- else:
84
- return None
85
-
86
-
87
- def _build_response(
88
- *, client: Client, response: httpx.Response
89
- ) -> Response[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
90
- return Response(
91
- status_code=HTTPStatus(response.status_code),
92
- content=response.content,
93
- headers=response.headers,
94
- parsed=_parse_response(client=client, response=response),
95
- )
96
-
97
-
98
- def sync_detailed(
99
- *,
100
- client: Client,
101
- start_date: Union[Unset, None, datetime.date] = UNSET,
102
- end_date: Union[Unset, None, datetime.date] = UNSET,
103
- run_type: Union[Unset, None, RunType] = UNSET,
104
- request_host: Union[Unset, None, str] = UNSET,
105
- machine_type: Union[Unset, None, str] = UNSET,
106
- ) -> Response[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
107
- """Get Usage Records
108
-
109
- Args:
110
- start_date (Union[Unset, None, datetime.date]):
111
- end_date (Union[Unset, None, datetime.date]):
112
- run_type (Union[Unset, None, RunType]): An enumeration.
113
- request_host (Union[Unset, None, str]):
114
- machine_type (Union[Unset, None, str]):
115
-
116
- Raises:
117
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
- httpx.TimeoutException: If the request takes longer than Client.timeout.
119
-
120
- Returns:
121
- Response[Union[HTTPValidationError, List['PersistedUsageRecord']]]
122
- """
123
-
124
- kwargs = _get_kwargs(
125
- client=client,
126
- start_date=start_date,
127
- end_date=end_date,
128
- run_type=run_type,
129
- request_host=request_host,
130
- machine_type=machine_type,
131
- )
132
-
133
- response = httpx.request(
134
- verify=client.verify_ssl,
135
- **kwargs,
136
- )
137
-
138
- return _build_response(client=client, response=response)
139
-
140
-
141
- def sync(
142
- *,
143
- client: Client,
144
- start_date: Union[Unset, None, datetime.date] = UNSET,
145
- end_date: Union[Unset, None, datetime.date] = UNSET,
146
- run_type: Union[Unset, None, RunType] = UNSET,
147
- request_host: Union[Unset, None, str] = UNSET,
148
- machine_type: Union[Unset, None, str] = UNSET,
149
- ) -> Optional[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
150
- """Get Usage Records
151
-
152
- Args:
153
- start_date (Union[Unset, None, datetime.date]):
154
- end_date (Union[Unset, None, datetime.date]):
155
- run_type (Union[Unset, None, RunType]): An enumeration.
156
- request_host (Union[Unset, None, str]):
157
- machine_type (Union[Unset, None, str]):
158
-
159
- Raises:
160
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
161
- httpx.TimeoutException: If the request takes longer than Client.timeout.
162
-
163
- Returns:
164
- Union[HTTPValidationError, List['PersistedUsageRecord']]
165
- """
166
-
167
- return sync_detailed(
168
- client=client,
169
- start_date=start_date,
170
- end_date=end_date,
171
- run_type=run_type,
172
- request_host=request_host,
173
- machine_type=machine_type,
174
- ).parsed
175
-
176
-
177
- async def asyncio_detailed(
178
- *,
179
- client: Client,
180
- start_date: Union[Unset, None, datetime.date] = UNSET,
181
- end_date: Union[Unset, None, datetime.date] = UNSET,
182
- run_type: Union[Unset, None, RunType] = UNSET,
183
- request_host: Union[Unset, None, str] = UNSET,
184
- machine_type: Union[Unset, None, str] = UNSET,
185
- ) -> Response[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
186
- """Get Usage Records
187
-
188
- Args:
189
- start_date (Union[Unset, None, datetime.date]):
190
- end_date (Union[Unset, None, datetime.date]):
191
- run_type (Union[Unset, None, RunType]): An enumeration.
192
- request_host (Union[Unset, None, str]):
193
- machine_type (Union[Unset, None, str]):
194
-
195
- Raises:
196
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
197
- httpx.TimeoutException: If the request takes longer than Client.timeout.
198
-
199
- Returns:
200
- Response[Union[HTTPValidationError, List['PersistedUsageRecord']]]
201
- """
202
-
203
- kwargs = _get_kwargs(
204
- client=client,
205
- start_date=start_date,
206
- end_date=end_date,
207
- run_type=run_type,
208
- request_host=request_host,
209
- machine_type=machine_type,
210
- )
211
-
212
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
213
- response = await _client.request(**kwargs)
214
-
215
- return _build_response(client=client, response=response)
216
-
217
-
218
- async def asyncio(
219
- *,
220
- client: Client,
221
- start_date: Union[Unset, None, datetime.date] = UNSET,
222
- end_date: Union[Unset, None, datetime.date] = UNSET,
223
- run_type: Union[Unset, None, RunType] = UNSET,
224
- request_host: Union[Unset, None, str] = UNSET,
225
- machine_type: Union[Unset, None, str] = UNSET,
226
- ) -> Optional[Union[HTTPValidationError, List["PersistedUsageRecord"]]]:
227
- """Get Usage Records
228
-
229
- Args:
230
- start_date (Union[Unset, None, datetime.date]):
231
- end_date (Union[Unset, None, datetime.date]):
232
- run_type (Union[Unset, None, RunType]): An enumeration.
233
- request_host (Union[Unset, None, str]):
234
- machine_type (Union[Unset, None, str]):
235
-
236
- Raises:
237
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
238
- httpx.TimeoutException: If the request takes longer than Client.timeout.
239
-
240
- Returns:
241
- Union[HTTPValidationError, List['PersistedUsageRecord']]
242
- """
243
-
244
- return (
245
- await asyncio_detailed(
246
- client=client,
247
- start_date=start_date,
248
- end_date=end_date,
249
- run_type=run_type,
250
- request_host=request_host,
251
- machine_type=machine_type,
252
- )
253
- ).parsed