fal 0.11.2__py3-none-any.whl → 0.11.4__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 (42) hide show
  1. fal/__init__.py +2 -28
  2. fal/api.py +13 -13
  3. fal/app.py +162 -0
  4. fal/cli.py +124 -73
  5. fal/exceptions/_base.py +1 -1
  6. fal/exceptions/auth.py +1 -1
  7. fal/rest_client.py +1 -0
  8. fal/sdk.py +41 -10
  9. fal/sync.py +3 -2
  10. fal/toolkit/file/file.py +6 -5
  11. fal/toolkit/file/providers/r2.py +83 -0
  12. fal/toolkit/file/types.py +1 -1
  13. fal/toolkit/image/image.py +2 -2
  14. {fal-0.11.2.dist-info → fal-0.11.4.dist-info}/METADATA +40 -3
  15. {fal-0.11.2.dist-info → fal-0.11.4.dist-info}/RECORD +42 -40
  16. openapi_fal_rest/api/admin/handle_user_lock.py +6 -2
  17. openapi_fal_rest/api/applications/get_status_applications_app_user_id_app_alias_or_id_status_get.py +6 -2
  18. openapi_fal_rest/api/billing/delete_payment_method.py +9 -3
  19. openapi_fal_rest/api/billing/get_setup_intent_key.py +6 -2
  20. openapi_fal_rest/api/billing/get_user_price.py +6 -2
  21. openapi_fal_rest/api/billing/get_user_spending.py +6 -2
  22. openapi_fal_rest/api/billing/handle_stripe_webhook.py +21 -7
  23. openapi_fal_rest/api/billing/upcoming_invoice.py +6 -2
  24. openapi_fal_rest/api/billing/update_customer_budget.py +6 -2
  25. openapi_fal_rest/api/files/check_dir_hash.py +9 -3
  26. openapi_fal_rest/api/files/delete.py +6 -2
  27. openapi_fal_rest/api/files/download.py +6 -2
  28. openapi_fal_rest/api/files/file_exists.py +6 -2
  29. openapi_fal_rest/api/files/upload_from_url.py +6 -2
  30. openapi_fal_rest/api/files/upload_local_file.py +9 -3
  31. openapi_fal_rest/api/keys/create_key.py +6 -2
  32. openapi_fal_rest/api/keys/delete_key.py +6 -2
  33. openapi_fal_rest/api/tokens/create_token.py +6 -2
  34. openapi_fal_rest/api/usage/get_gateway_request_stats_by_time.py +41 -7
  35. openapi_fal_rest/api/usage/per_machine_usage_details.py +3 -1
  36. openapi_fal_rest/models/__init__.py +3 -1
  37. openapi_fal_rest/models/body_upload_file.py +4 -1
  38. openapi_fal_rest/models/body_upload_local_file.py +4 -1
  39. openapi_fal_rest/models/get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.py +15 -5
  40. openapi_fal_rest/models/grouped_usage_detail.py +6 -6
  41. {fal-0.11.2.dist-info → fal-0.11.4.dist-info}/WHEEL +0 -0
  42. {fal-0.11.2.dist-info → fal-0.11.4.dist-info}/entry_points.txt +0 -0
@@ -47,7 +47,9 @@ def _get_kwargs(
47
47
  }
48
48
 
49
49
 
50
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, float]]:
50
+ def _parse_response(
51
+ *, client: Client, response: httpx.Response
52
+ ) -> Optional[Union[HTTPValidationError, float]]:
51
53
  if response.status_code == HTTPStatus.OK:
52
54
  response_200 = cast(float, response.json())
53
55
  return response_200
@@ -61,7 +63,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
61
63
  return None
62
64
 
63
65
 
64
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, float]]:
66
+ def _build_response(
67
+ *, client: Client, response: httpx.Response
68
+ ) -> Response[Union[HTTPValidationError, float]]:
65
69
  return Response(
66
70
  status_code=HTTPStatus(response.status_code),
67
71
  content=response.content,
@@ -37,9 +37,13 @@ def _get_kwargs(
37
37
 
38
38
  def _parse_response(
39
39
  *, client: Client, response: httpx.Response
40
- ) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
40
+ ) -> Optional[
41
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
42
+ ]:
41
43
  if response.status_code == HTTPStatus.OK:
42
- response_200 = HandleStripeWebhookResponseHandleStripeWebhook.from_dict(response.json())
44
+ response_200 = HandleStripeWebhookResponseHandleStripeWebhook.from_dict(
45
+ response.json()
46
+ )
43
47
 
44
48
  return response_200
45
49
  if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
@@ -54,7 +58,9 @@ def _parse_response(
54
58
 
55
59
  def _build_response(
56
60
  *, client: Client, response: httpx.Response
57
- ) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
61
+ ) -> Response[
62
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
63
+ ]:
58
64
  return Response(
59
65
  status_code=HTTPStatus(response.status_code),
60
66
  content=response.content,
@@ -67,7 +73,9 @@ def sync_detailed(
67
73
  *,
68
74
  client: Client,
69
75
  stripe_signature: Union[Unset, str] = UNSET,
70
- ) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
76
+ ) -> Response[
77
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
78
+ ]:
71
79
  """Handle Stripe Webhook
72
80
 
73
81
  Args:
@@ -98,7 +106,9 @@ def sync(
98
106
  *,
99
107
  client: Client,
100
108
  stripe_signature: Union[Unset, str] = UNSET,
101
- ) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
109
+ ) -> Optional[
110
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
111
+ ]:
102
112
  """Handle Stripe Webhook
103
113
 
104
114
  Args:
@@ -122,7 +132,9 @@ async def asyncio_detailed(
122
132
  *,
123
133
  client: Client,
124
134
  stripe_signature: Union[Unset, str] = UNSET,
125
- ) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
135
+ ) -> Response[
136
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
137
+ ]:
126
138
  """Handle Stripe Webhook
127
139
 
128
140
  Args:
@@ -151,7 +163,9 @@ async def asyncio(
151
163
  *,
152
164
  client: Client,
153
165
  stripe_signature: Union[Unset, str] = UNSET,
154
- ) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
166
+ ) -> Optional[
167
+ Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
168
+ ]:
155
169
  """Handle Stripe Webhook
156
170
 
157
171
  Args:
@@ -29,7 +29,9 @@ def _get_kwargs(
29
29
  }
30
30
 
31
31
 
32
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, Invoice]]:
32
+ def _parse_response(
33
+ *, client: Client, response: httpx.Response
34
+ ) -> Optional[Union[HTTPValidationError, Invoice]]:
33
35
  if response.status_code == HTTPStatus.OK:
34
36
  response_200 = Invoice.from_dict(response.json())
35
37
 
@@ -44,7 +46,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
44
46
  return None
45
47
 
46
48
 
47
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, Invoice]]:
49
+ def _build_response(
50
+ *, client: Client, response: httpx.Response
51
+ ) -> Response[Union[HTTPValidationError, Invoice]]:
48
52
  return Response(
49
53
  status_code=HTTPStatus(response.status_code),
50
54
  content=response.content,
@@ -38,7 +38,9 @@ def _get_kwargs(
38
38
  }
39
39
 
40
40
 
41
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
41
+ def _parse_response(
42
+ *, client: Client, response: httpx.Response
43
+ ) -> Optional[Union[Any, HTTPValidationError]]:
42
44
  if response.status_code == HTTPStatus.OK:
43
45
  response_200 = cast(Any, response.json())
44
46
  return response_200
@@ -52,7 +54,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
52
54
  return None
53
55
 
54
56
 
55
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
57
+ def _build_response(
58
+ *, client: Client, response: httpx.Response
59
+ ) -> Response[Union[Any, HTTPValidationError]]:
56
60
  return Response(
57
61
  status_code=HTTPStatus(response.status_code),
58
62
  content=response.content,
@@ -16,7 +16,9 @@ def _get_kwargs(
16
16
  client: Client,
17
17
  json_body: HashCheck,
18
18
  ) -> Dict[str, Any]:
19
- url = "{}/files/dir/check_hash/{target_path}".format(client.base_url, target_path=target_path)
19
+ url = "{}/files/dir/check_hash/{target_path}".format(
20
+ client.base_url, target_path=target_path
21
+ )
20
22
 
21
23
  headers: Dict[str, str] = client.get_headers()
22
24
  cookies: Dict[str, Any] = client.get_cookies()
@@ -34,7 +36,9 @@ def _get_kwargs(
34
36
  }
35
37
 
36
38
 
37
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
39
+ def _parse_response(
40
+ *, client: Client, response: httpx.Response
41
+ ) -> Optional[Union[HTTPValidationError, bool]]:
38
42
  if response.status_code == HTTPStatus.OK:
39
43
  response_200 = cast(bool, response.json())
40
44
  return response_200
@@ -48,7 +52,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
48
52
  return None
49
53
 
50
54
 
51
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
55
+ def _build_response(
56
+ *, client: Client, response: httpx.Response
57
+ ) -> Response[Union[HTTPValidationError, bool]]:
52
58
  return Response(
53
59
  status_code=HTTPStatus(response.status_code),
54
60
  content=response.content,
@@ -29,7 +29,9 @@ def _get_kwargs(
29
29
  }
30
30
 
31
31
 
32
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
32
+ def _parse_response(
33
+ *, client: Client, response: httpx.Response
34
+ ) -> Optional[Union[HTTPValidationError, bool]]:
33
35
  if response.status_code == HTTPStatus.OK:
34
36
  response_200 = cast(bool, response.json())
35
37
  return response_200
@@ -43,7 +45,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
43
45
  return None
44
46
 
45
47
 
46
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
48
+ def _build_response(
49
+ *, client: Client, response: httpx.Response
50
+ ) -> Response[Union[HTTPValidationError, bool]]:
47
51
  return Response(
48
52
  status_code=HTTPStatus(response.status_code),
49
53
  content=response.content,
@@ -29,7 +29,9 @@ def _get_kwargs(
29
29
  }
30
30
 
31
31
 
32
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
32
+ def _parse_response(
33
+ *, client: Client, response: httpx.Response
34
+ ) -> Optional[Union[Any, HTTPValidationError]]:
33
35
  if response.status_code == HTTPStatus.OK:
34
36
  response_200 = cast(Any, response.json())
35
37
  return response_200
@@ -43,7 +45,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
43
45
  return None
44
46
 
45
47
 
46
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
48
+ def _build_response(
49
+ *, client: Client, response: httpx.Response
50
+ ) -> Response[Union[Any, HTTPValidationError]]:
47
51
  return Response(
48
52
  status_code=HTTPStatus(response.status_code),
49
53
  content=response.content,
@@ -37,7 +37,9 @@ def _get_kwargs(
37
37
  }
38
38
 
39
39
 
40
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[FileSpec, HTTPValidationError]]:
40
+ def _parse_response(
41
+ *, client: Client, response: httpx.Response
42
+ ) -> Optional[Union[FileSpec, HTTPValidationError]]:
41
43
  if response.status_code == HTTPStatus.OK:
42
44
  response_200 = FileSpec.from_dict(response.json())
43
45
 
@@ -52,7 +54,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
52
54
  return None
53
55
 
54
56
 
55
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[FileSpec, HTTPValidationError]]:
57
+ def _build_response(
58
+ *, client: Client, response: httpx.Response
59
+ ) -> Response[Union[FileSpec, HTTPValidationError]]:
56
60
  return Response(
57
61
  status_code=HTTPStatus(response.status_code),
58
62
  content=response.content,
@@ -34,7 +34,9 @@ def _get_kwargs(
34
34
  }
35
35
 
36
36
 
37
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
37
+ def _parse_response(
38
+ *, client: Client, response: httpx.Response
39
+ ) -> Optional[Union[HTTPValidationError, bool]]:
38
40
  if response.status_code == HTTPStatus.OK:
39
41
  response_200 = cast(bool, response.json())
40
42
  return response_200
@@ -48,7 +50,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
48
50
  return None
49
51
 
50
52
 
51
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
53
+ def _build_response(
54
+ *, client: Client, response: httpx.Response
55
+ ) -> Response[Union[HTTPValidationError, bool]]:
52
56
  return Response(
53
57
  status_code=HTTPStatus(response.status_code),
54
58
  content=response.content,
@@ -17,7 +17,9 @@ def _get_kwargs(
17
17
  multipart_data: BodyUploadLocalFile,
18
18
  unzip: Union[Unset, None, bool] = False,
19
19
  ) -> Dict[str, Any]:
20
- url = "{}/files/file/local/{target_path}".format(client.base_url, target_path=target_path)
20
+ url = "{}/files/file/local/{target_path}".format(
21
+ client.base_url, target_path=target_path
22
+ )
21
23
 
22
24
  headers: Dict[str, str] = client.get_headers()
23
25
  cookies: Dict[str, Any] = client.get_cookies()
@@ -41,7 +43,9 @@ def _get_kwargs(
41
43
  }
42
44
 
43
45
 
44
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
46
+ def _parse_response(
47
+ *, client: Client, response: httpx.Response
48
+ ) -> Optional[Union[HTTPValidationError, bool]]:
45
49
  if response.status_code == HTTPStatus.OK:
46
50
  response_200 = cast(bool, response.json())
47
51
  return response_200
@@ -55,7 +59,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
55
59
  return None
56
60
 
57
61
 
58
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
62
+ def _build_response(
63
+ *, client: Client, response: httpx.Response
64
+ ) -> Response[Union[HTTPValidationError, bool]]:
59
65
  return Response(
60
66
  status_code=HTTPStatus(response.status_code),
61
67
  content=response.content,
@@ -42,7 +42,9 @@ def _get_kwargs(
42
42
  }
43
43
 
44
44
 
45
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, NewUserKey]]:
45
+ def _parse_response(
46
+ *, client: Client, response: httpx.Response
47
+ ) -> Optional[Union[HTTPValidationError, NewUserKey]]:
46
48
  if response.status_code == HTTPStatus.CREATED:
47
49
  response_201 = NewUserKey.from_dict(response.json())
48
50
 
@@ -57,7 +59,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
57
59
  return None
58
60
 
59
61
 
60
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, NewUserKey]]:
62
+ def _build_response(
63
+ *, client: Client, response: httpx.Response
64
+ ) -> Response[Union[HTTPValidationError, NewUserKey]]:
61
65
  return Response(
62
66
  status_code=HTTPStatus(response.status_code),
63
67
  content=response.content,
@@ -29,7 +29,9 @@ def _get_kwargs(
29
29
  }
30
30
 
31
31
 
32
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
32
+ def _parse_response(
33
+ *, client: Client, response: httpx.Response
34
+ ) -> Optional[Union[Any, HTTPValidationError]]:
33
35
  if response.status_code == HTTPStatus.NO_CONTENT:
34
36
  response_204 = cast(Any, None)
35
37
  return response_204
@@ -43,7 +45,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
43
45
  return None
44
46
 
45
47
 
46
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
48
+ def _build_response(
49
+ *, client: Client, response: httpx.Response
50
+ ) -> Response[Union[Any, HTTPValidationError]]:
47
51
  return Response(
48
52
  status_code=HTTPStatus(response.status_code),
49
53
  content=response.content,
@@ -33,7 +33,9 @@ def _get_kwargs(
33
33
  }
34
34
 
35
35
 
36
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, str]]:
36
+ def _parse_response(
37
+ *, client: Client, response: httpx.Response
38
+ ) -> Optional[Union[HTTPValidationError, str]]:
37
39
  if response.status_code == HTTPStatus.CREATED:
38
40
  response_201 = cast(str, response.json())
39
41
  return response_201
@@ -47,7 +49,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
47
49
  return None
48
50
 
49
51
 
50
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, str]]:
52
+ def _build_response(
53
+ *, client: Client, response: httpx.Response
54
+ ) -> Response[Union[HTTPValidationError, str]]:
51
55
  return Response(
52
56
  status_code=HTTPStatus(response.status_code),
53
57
  content=response.content,
@@ -64,9 +64,18 @@ def _get_kwargs(
64
64
 
65
65
  def _parse_response(
66
66
  *, client: Client, response: httpx.Response
67
- ) -> Optional[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
67
+ ) -> Optional[
68
+ Union[
69
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
70
+ HTTPValidationError,
71
+ ]
72
+ ]:
68
73
  if response.status_code == HTTPStatus.OK:
69
- response_200 = GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime.from_dict(response.json())
74
+ response_200 = (
75
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime.from_dict(
76
+ response.json()
77
+ )
78
+ )
70
79
 
71
80
  return response_200
72
81
  if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
@@ -81,7 +90,12 @@ def _parse_response(
81
90
 
82
91
  def _build_response(
83
92
  *, client: Client, response: httpx.Response
84
- ) -> Response[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
93
+ ) -> Response[
94
+ Union[
95
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
96
+ HTTPValidationError,
97
+ ]
98
+ ]:
85
99
  return Response(
86
100
  status_code=HTTPStatus(response.status_code),
87
101
  content=response.content,
@@ -97,7 +111,12 @@ def sync_detailed(
97
111
  end_time: datetime.datetime,
98
112
  timeframe: StatsTimeframe,
99
113
  app_aliases: Union[Unset, None, List[str]] = UNSET,
100
- ) -> Response[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
114
+ ) -> Response[
115
+ Union[
116
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
117
+ HTTPValidationError,
118
+ ]
119
+ ]:
101
120
  """Get Gateway Request Stats By Time
102
121
 
103
122
  Args:
@@ -137,7 +156,12 @@ def sync(
137
156
  end_time: datetime.datetime,
138
157
  timeframe: StatsTimeframe,
139
158
  app_aliases: Union[Unset, None, List[str]] = UNSET,
140
- ) -> Optional[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
159
+ ) -> Optional[
160
+ Union[
161
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
162
+ HTTPValidationError,
163
+ ]
164
+ ]:
141
165
  """Get Gateway Request Stats By Time
142
166
 
143
167
  Args:
@@ -170,7 +194,12 @@ async def asyncio_detailed(
170
194
  end_time: datetime.datetime,
171
195
  timeframe: StatsTimeframe,
172
196
  app_aliases: Union[Unset, None, List[str]] = UNSET,
173
- ) -> Response[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
197
+ ) -> Response[
198
+ Union[
199
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
200
+ HTTPValidationError,
201
+ ]
202
+ ]:
174
203
  """Get Gateway Request Stats By Time
175
204
 
176
205
  Args:
@@ -208,7 +237,12 @@ async def asyncio(
208
237
  end_time: datetime.datetime,
209
238
  timeframe: StatsTimeframe,
210
239
  app_aliases: Union[Unset, None, List[str]] = UNSET,
211
- ) -> Optional[Union[GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime, HTTPValidationError]]:
240
+ ) -> Optional[
241
+ Union[
242
+ GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
243
+ HTTPValidationError,
244
+ ]
245
+ ]:
212
246
  """Get Gateway Request Stats By Time
213
247
 
214
248
  Args:
@@ -15,7 +15,9 @@ def _get_kwargs(
15
15
  *,
16
16
  client: Client,
17
17
  ) -> Dict[str, Any]:
18
- url = "{}/usage/machine_type/{machine_type}".format(client.base_url, machine_type=machine_type)
18
+ url = "{}/usage/machine_type/{machine_type}".format(
19
+ client.base_url, machine_type=machine_type
20
+ )
19
21
 
20
22
  headers: Dict[str, str] = client.get_headers()
21
23
  cookies: Dict[str, Any] = client.get_cookies()
@@ -12,7 +12,9 @@ from .get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_ti
12
12
  GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime,
13
13
  )
14
14
  from .grouped_usage_detail import GroupedUsageDetail
15
- from .handle_stripe_webhook_response_handle_stripe_webhook import HandleStripeWebhookResponseHandleStripeWebhook
15
+ from .handle_stripe_webhook_response_handle_stripe_webhook import (
16
+ HandleStripeWebhookResponseHandleStripeWebhook,
17
+ )
16
18
  from .hash_check import HashCheck
17
19
  from .http_validation_error import HTTPValidationError
18
20
  from .initiate_upload_info import InitiateUploadInfo
@@ -36,7 +36,10 @@ class BodyUploadFile:
36
36
 
37
37
  field_dict: Dict[str, Any] = {}
38
38
  field_dict.update(
39
- {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
39
+ {
40
+ key: (None, str(value).encode(), "text/plain")
41
+ for key, value in self.additional_properties.items()
42
+ }
40
43
  )
41
44
  field_dict.update(
42
45
  {
@@ -36,7 +36,10 @@ class BodyUploadLocalFile:
36
36
 
37
37
  field_dict: Dict[str, Any] = {}
38
38
  field_dict.update(
39
- {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
39
+ {
40
+ key: (None, str(value).encode(), "text/plain")
41
+ for key, value in self.additional_properties.items()
42
+ }
40
43
  )
41
44
  field_dict.update(
42
45
  {
@@ -6,14 +6,18 @@ if TYPE_CHECKING:
6
6
  from ..models.gateway_stats_by_time import GatewayStatsByTime
7
7
 
8
8
 
9
- T = TypeVar("T", bound="GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime")
9
+ T = TypeVar(
10
+ "T", bound="GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime"
11
+ )
10
12
 
11
13
 
12
14
  @attr.s(auto_attribs=True)
13
15
  class GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime:
14
16
  """ """
15
17
 
16
- additional_properties: Dict[str, List["GatewayStatsByTime"]] = attr.ib(init=False, factory=dict)
18
+ additional_properties: Dict[str, List["GatewayStatsByTime"]] = attr.ib(
19
+ init=False, factory=dict
20
+ )
17
21
 
18
22
  def to_dict(self) -> Dict[str, Any]:
19
23
  pass
@@ -35,14 +39,18 @@ class GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime:
35
39
  from ..models.gateway_stats_by_time import GatewayStatsByTime
36
40
 
37
41
  d = src_dict.copy()
38
- get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time = cls()
42
+ get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time = (
43
+ cls()
44
+ )
39
45
 
40
46
  additional_properties = {}
41
47
  for prop_name, prop_dict in d.items():
42
48
  additional_property = []
43
49
  _additional_property = prop_dict
44
50
  for additional_property_item_data in _additional_property:
45
- additional_property_item = GatewayStatsByTime.from_dict(additional_property_item_data)
51
+ additional_property_item = GatewayStatsByTime.from_dict(
52
+ additional_property_item_data
53
+ )
46
54
 
47
55
  additional_property.append(additional_property_item)
48
56
 
@@ -51,7 +59,9 @@ class GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime:
51
59
  get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.additional_properties = (
52
60
  additional_properties
53
61
  )
54
- return get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time
62
+ return (
63
+ get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time
64
+ )
55
65
 
56
66
  @property
57
67
  def additional_keys(self) -> List[str]:
@@ -12,14 +12,14 @@ class GroupedUsageDetail:
12
12
  model_id (str):
13
13
  machine_type (str):
14
14
  request_count (int):
15
- avg_duration (float):
15
+ median_duration (float):
16
16
  total_duration (float):
17
17
  """
18
18
 
19
19
  model_id: str
20
20
  machine_type: str
21
21
  request_count: int
22
- avg_duration: float
22
+ median_duration: float
23
23
  total_duration: float
24
24
  additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
25
25
 
@@ -27,7 +27,7 @@ class GroupedUsageDetail:
27
27
  model_id = self.model_id
28
28
  machine_type = self.machine_type
29
29
  request_count = self.request_count
30
- avg_duration = self.avg_duration
30
+ median_duration = self.median_duration
31
31
  total_duration = self.total_duration
32
32
 
33
33
  field_dict: Dict[str, Any] = {}
@@ -37,7 +37,7 @@ class GroupedUsageDetail:
37
37
  "model_id": model_id,
38
38
  "machine_type": machine_type,
39
39
  "request_count": request_count,
40
- "avg_duration": avg_duration,
40
+ "median_duration": median_duration,
41
41
  "total_duration": total_duration,
42
42
  }
43
43
  )
@@ -53,7 +53,7 @@ class GroupedUsageDetail:
53
53
 
54
54
  request_count = d.pop("request_count")
55
55
 
56
- avg_duration = d.pop("avg_duration")
56
+ median_duration = d.pop("median_duration")
57
57
 
58
58
  total_duration = d.pop("total_duration")
59
59
 
@@ -61,7 +61,7 @@ class GroupedUsageDetail:
61
61
  model_id=model_id,
62
62
  machine_type=machine_type,
63
63
  request_count=request_count,
64
- avg_duration=avg_duration,
64
+ median_duration=median_duration,
65
65
  total_duration=total_duration,
66
66
  )
67
67
 
File without changes