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.user_key_info import UserKeyInfo
10
- from ...types import Response
11
-
12
-
13
- def _get_kwargs(
14
- *,
15
- client: Client,
16
- ) -> Dict[str, Any]:
17
- url = "{}/keys/".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["UserKeyInfo"]]]:
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 = UserKeyInfo.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["UserKeyInfo"]]]:
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["UserKeyInfo"]]]:
69
- """List Keys
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['UserKeyInfo']]]
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["UserKeyInfo"]]]:
95
- """List Keys
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['UserKeyInfo']]
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["UserKeyInfo"]]]:
114
- """List Keys
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['UserKeyInfo']]]
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["UserKeyInfo"]]]:
138
- """List Keys
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['UserKeyInfo']]
146
- """
147
-
148
- return (
149
- await asyncio_detailed(
150
- client=client,
151
- )
152
- ).parsed
File without changes
@@ -1,224 +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.log_entry import LogEntry
10
- from ...types import UNSET, Response, Unset
11
-
12
-
13
- def _get_kwargs(
14
- *,
15
- client: Client,
16
- limit: Union[Unset, None, int] = 100,
17
- offset: Union[Unset, None, int] = 0,
18
- since: Union[Unset, None, str] = UNSET,
19
- url_query: Union[Unset, None, str] = UNSET,
20
- ) -> Dict[str, Any]:
21
- url = "{}/logs/".format(client.base_url)
22
-
23
- headers: Dict[str, str] = client.get_headers()
24
- cookies: Dict[str, Any] = client.get_cookies()
25
-
26
- params: Dict[str, Any] = {}
27
- params["limit"] = limit
28
-
29
- params["offset"] = offset
30
-
31
- params["since"] = since
32
-
33
- params["url"] = url_query
34
-
35
- params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
36
-
37
- return {
38
- "method": "get",
39
- "url": url,
40
- "headers": headers,
41
- "cookies": cookies,
42
- "timeout": client.get_timeout(),
43
- "follow_redirects": client.follow_redirects,
44
- "params": params,
45
- }
46
-
47
-
48
- def _parse_response(
49
- *, client: Client, response: httpx.Response
50
- ) -> Optional[Union[HTTPValidationError, List["LogEntry"]]]:
51
- if response.status_code == HTTPStatus.OK:
52
- response_200 = []
53
- _response_200 = response.json()
54
- for response_200_item_data in _response_200:
55
- response_200_item = LogEntry.from_dict(response_200_item_data)
56
-
57
- response_200.append(response_200_item)
58
-
59
- return response_200
60
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
61
- response_422 = HTTPValidationError.from_dict(response.json())
62
-
63
- return response_422
64
- if client.raise_on_unexpected_status:
65
- raise errors.UnexpectedStatus(response.status_code, response.content)
66
- else:
67
- return None
68
-
69
-
70
- def _build_response(
71
- *, client: Client, response: httpx.Response
72
- ) -> Response[Union[HTTPValidationError, List["LogEntry"]]]:
73
- return Response(
74
- status_code=HTTPStatus(response.status_code),
75
- content=response.content,
76
- headers=response.headers,
77
- parsed=_parse_response(client=client, response=response),
78
- )
79
-
80
-
81
- def sync_detailed(
82
- *,
83
- client: Client,
84
- limit: Union[Unset, None, int] = 100,
85
- offset: Union[Unset, None, int] = 0,
86
- since: Union[Unset, None, str] = UNSET,
87
- url_query: Union[Unset, None, str] = UNSET,
88
- ) -> Response[Union[HTTPValidationError, List["LogEntry"]]]:
89
- """List Logs Since
90
-
91
- Args:
92
- limit (Union[Unset, None, int]): Default: 100.
93
- offset (Union[Unset, None, int]):
94
- since (Union[Unset, None, str]):
95
- url_query (Union[Unset, None, str]):
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
- Response[Union[HTTPValidationError, List['LogEntry']]]
103
- """
104
-
105
- kwargs = _get_kwargs(
106
- client=client,
107
- limit=limit,
108
- offset=offset,
109
- since=since,
110
- url_query=url_query,
111
- )
112
-
113
- response = httpx.request(
114
- verify=client.verify_ssl,
115
- **kwargs,
116
- )
117
-
118
- return _build_response(client=client, response=response)
119
-
120
-
121
- def sync(
122
- *,
123
- client: Client,
124
- limit: Union[Unset, None, int] = 100,
125
- offset: Union[Unset, None, int] = 0,
126
- since: Union[Unset, None, str] = UNSET,
127
- url_query: Union[Unset, None, str] = UNSET,
128
- ) -> Optional[Union[HTTPValidationError, List["LogEntry"]]]:
129
- """List Logs Since
130
-
131
- Args:
132
- limit (Union[Unset, None, int]): Default: 100.
133
- offset (Union[Unset, None, int]):
134
- since (Union[Unset, None, str]):
135
- url_query (Union[Unset, None, str]):
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
- Union[HTTPValidationError, List['LogEntry']]
143
- """
144
-
145
- return sync_detailed(
146
- client=client,
147
- limit=limit,
148
- offset=offset,
149
- since=since,
150
- url_query=url_query,
151
- ).parsed
152
-
153
-
154
- async def asyncio_detailed(
155
- *,
156
- client: Client,
157
- limit: Union[Unset, None, int] = 100,
158
- offset: Union[Unset, None, int] = 0,
159
- since: Union[Unset, None, str] = UNSET,
160
- url_query: Union[Unset, None, str] = UNSET,
161
- ) -> Response[Union[HTTPValidationError, List["LogEntry"]]]:
162
- """List Logs Since
163
-
164
- Args:
165
- limit (Union[Unset, None, int]): Default: 100.
166
- offset (Union[Unset, None, int]):
167
- since (Union[Unset, None, str]):
168
- url_query (Union[Unset, None, str]):
169
-
170
- Raises:
171
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
172
- httpx.TimeoutException: If the request takes longer than Client.timeout.
173
-
174
- Returns:
175
- Response[Union[HTTPValidationError, List['LogEntry']]]
176
- """
177
-
178
- kwargs = _get_kwargs(
179
- client=client,
180
- limit=limit,
181
- offset=offset,
182
- since=since,
183
- url_query=url_query,
184
- )
185
-
186
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
187
- response = await _client.request(**kwargs)
188
-
189
- return _build_response(client=client, response=response)
190
-
191
-
192
- async def asyncio(
193
- *,
194
- client: Client,
195
- limit: Union[Unset, None, int] = 100,
196
- offset: Union[Unset, None, int] = 0,
197
- since: Union[Unset, None, str] = UNSET,
198
- url_query: Union[Unset, None, str] = UNSET,
199
- ) -> Optional[Union[HTTPValidationError, List["LogEntry"]]]:
200
- """List Logs Since
201
-
202
- Args:
203
- limit (Union[Unset, None, int]): Default: 100.
204
- offset (Union[Unset, None, int]):
205
- since (Union[Unset, None, str]):
206
- url_query (Union[Unset, None, str]):
207
-
208
- Raises:
209
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
210
- httpx.TimeoutException: If the request takes longer than Client.timeout.
211
-
212
- Returns:
213
- Union[HTTPValidationError, List['LogEntry']]
214
- """
215
-
216
- return (
217
- await asyncio_detailed(
218
- client=client,
219
- limit=limit,
220
- offset=offset,
221
- since=since,
222
- url_query=url_query,
223
- )
224
- ).parsed
File without changes
@@ -1,247 +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.request_io import RequestIO
11
- from ...models.stats_timeframe import StatsTimeframe
12
- from ...types import UNSET, Response, Unset
13
-
14
-
15
- def _get_kwargs(
16
- *,
17
- client: Client,
18
- start_time: datetime.datetime,
19
- end_time: datetime.datetime,
20
- app_alias: str,
21
- timeframe: StatsTimeframe,
22
- limit: Union[Unset, None, int] = 100,
23
- ) -> Dict[str, Any]:
24
- url = "{}/requests/".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_time = start_time.isoformat()
31
-
32
- params["start_time"] = json_start_time
33
-
34
- json_end_time = end_time.isoformat()
35
-
36
- params["end_time"] = json_end_time
37
-
38
- params["app_alias"] = app_alias
39
-
40
- json_timeframe = timeframe.value
41
-
42
- params["timeframe"] = json_timeframe
43
-
44
- params["limit"] = limit
45
-
46
- params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
47
-
48
- return {
49
- "method": "get",
50
- "url": url,
51
- "headers": headers,
52
- "cookies": cookies,
53
- "timeout": client.get_timeout(),
54
- "follow_redirects": client.follow_redirects,
55
- "params": params,
56
- }
57
-
58
-
59
- def _parse_response(
60
- *, client: Client, response: httpx.Response
61
- ) -> Optional[Union[HTTPValidationError, List["RequestIO"]]]:
62
- if response.status_code == HTTPStatus.OK:
63
- response_200 = []
64
- _response_200 = response.json()
65
- for response_200_item_data in _response_200:
66
- response_200_item = RequestIO.from_dict(response_200_item_data)
67
-
68
- response_200.append(response_200_item)
69
-
70
- return response_200
71
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
72
- response_422 = HTTPValidationError.from_dict(response.json())
73
-
74
- return response_422
75
- if client.raise_on_unexpected_status:
76
- raise errors.UnexpectedStatus(response.status_code, response.content)
77
- else:
78
- return None
79
-
80
-
81
- def _build_response(
82
- *, client: Client, response: httpx.Response
83
- ) -> Response[Union[HTTPValidationError, List["RequestIO"]]]:
84
- return Response(
85
- status_code=HTTPStatus(response.status_code),
86
- content=response.content,
87
- headers=response.headers,
88
- parsed=_parse_response(client=client, response=response),
89
- )
90
-
91
-
92
- def sync_detailed(
93
- *,
94
- client: Client,
95
- start_time: datetime.datetime,
96
- end_time: datetime.datetime,
97
- app_alias: str,
98
- timeframe: StatsTimeframe,
99
- limit: Union[Unset, None, int] = 100,
100
- ) -> Response[Union[HTTPValidationError, List["RequestIO"]]]:
101
- """Per Machine Usage
102
-
103
- Args:
104
- start_time (datetime.datetime):
105
- end_time (datetime.datetime):
106
- app_alias (str):
107
- timeframe (StatsTimeframe): An enumeration.
108
- limit (Union[Unset, None, int]): Default: 100.
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[Union[HTTPValidationError, List['RequestIO']]]
116
- """
117
-
118
- kwargs = _get_kwargs(
119
- client=client,
120
- start_time=start_time,
121
- end_time=end_time,
122
- app_alias=app_alias,
123
- timeframe=timeframe,
124
- limit=limit,
125
- )
126
-
127
- response = httpx.request(
128
- verify=client.verify_ssl,
129
- **kwargs,
130
- )
131
-
132
- return _build_response(client=client, response=response)
133
-
134
-
135
- def sync(
136
- *,
137
- client: Client,
138
- start_time: datetime.datetime,
139
- end_time: datetime.datetime,
140
- app_alias: str,
141
- timeframe: StatsTimeframe,
142
- limit: Union[Unset, None, int] = 100,
143
- ) -> Optional[Union[HTTPValidationError, List["RequestIO"]]]:
144
- """Per Machine Usage
145
-
146
- Args:
147
- start_time (datetime.datetime):
148
- end_time (datetime.datetime):
149
- app_alias (str):
150
- timeframe (StatsTimeframe): An enumeration.
151
- limit (Union[Unset, None, int]): Default: 100.
152
-
153
- Raises:
154
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
- httpx.TimeoutException: If the request takes longer than Client.timeout.
156
-
157
- Returns:
158
- Union[HTTPValidationError, List['RequestIO']]
159
- """
160
-
161
- return sync_detailed(
162
- client=client,
163
- start_time=start_time,
164
- end_time=end_time,
165
- app_alias=app_alias,
166
- timeframe=timeframe,
167
- limit=limit,
168
- ).parsed
169
-
170
-
171
- async def asyncio_detailed(
172
- *,
173
- client: Client,
174
- start_time: datetime.datetime,
175
- end_time: datetime.datetime,
176
- app_alias: str,
177
- timeframe: StatsTimeframe,
178
- limit: Union[Unset, None, int] = 100,
179
- ) -> Response[Union[HTTPValidationError, List["RequestIO"]]]:
180
- """Per Machine Usage
181
-
182
- Args:
183
- start_time (datetime.datetime):
184
- end_time (datetime.datetime):
185
- app_alias (str):
186
- timeframe (StatsTimeframe): An enumeration.
187
- limit (Union[Unset, None, int]): Default: 100.
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
- Response[Union[HTTPValidationError, List['RequestIO']]]
195
- """
196
-
197
- kwargs = _get_kwargs(
198
- client=client,
199
- start_time=start_time,
200
- end_time=end_time,
201
- app_alias=app_alias,
202
- timeframe=timeframe,
203
- limit=limit,
204
- )
205
-
206
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
207
- response = await _client.request(**kwargs)
208
-
209
- return _build_response(client=client, response=response)
210
-
211
-
212
- async def asyncio(
213
- *,
214
- client: Client,
215
- start_time: datetime.datetime,
216
- end_time: datetime.datetime,
217
- app_alias: str,
218
- timeframe: StatsTimeframe,
219
- limit: Union[Unset, None, int] = 100,
220
- ) -> Optional[Union[HTTPValidationError, List["RequestIO"]]]:
221
- """Per Machine Usage
222
-
223
- Args:
224
- start_time (datetime.datetime):
225
- end_time (datetime.datetime):
226
- app_alias (str):
227
- timeframe (StatsTimeframe): An enumeration.
228
- limit (Union[Unset, None, int]): Default: 100.
229
-
230
- Raises:
231
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
232
- httpx.TimeoutException: If the request takes longer than Client.timeout.
233
-
234
- Returns:
235
- Union[HTTPValidationError, List['RequestIO']]
236
- """
237
-
238
- return (
239
- await asyncio_detailed(
240
- client=client,
241
- start_time=start_time,
242
- end_time=end_time,
243
- app_alias=app_alias,
244
- timeframe=timeframe,
245
- limit=limit,
246
- )
247
- ).parsed
File without changes