fal 0.11.2__py3-none-any.whl → 0.11.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 (36) hide show
  1. fal/api.py +8 -12
  2. fal/cli.py +90 -31
  3. fal/rest_client.py +1 -0
  4. fal/sdk.py +41 -10
  5. fal/sync.py +3 -2
  6. fal/toolkit/file/file.py +6 -5
  7. fal/toolkit/file/providers/r2.py +83 -0
  8. fal/toolkit/file/types.py +1 -1
  9. fal/toolkit/image/image.py +2 -2
  10. {fal-0.11.2.dist-info → fal-0.11.3.dist-info}/METADATA +40 -3
  11. {fal-0.11.2.dist-info → fal-0.11.3.dist-info}/RECORD +36 -35
  12. openapi_fal_rest/api/admin/handle_user_lock.py +6 -2
  13. openapi_fal_rest/api/applications/get_status_applications_app_user_id_app_alias_or_id_status_get.py +6 -2
  14. openapi_fal_rest/api/billing/delete_payment_method.py +9 -3
  15. openapi_fal_rest/api/billing/get_setup_intent_key.py +6 -2
  16. openapi_fal_rest/api/billing/get_user_price.py +6 -2
  17. openapi_fal_rest/api/billing/get_user_spending.py +6 -2
  18. openapi_fal_rest/api/billing/handle_stripe_webhook.py +21 -7
  19. openapi_fal_rest/api/billing/upcoming_invoice.py +6 -2
  20. openapi_fal_rest/api/billing/update_customer_budget.py +6 -2
  21. openapi_fal_rest/api/files/check_dir_hash.py +9 -3
  22. openapi_fal_rest/api/files/delete.py +6 -2
  23. openapi_fal_rest/api/files/download.py +6 -2
  24. openapi_fal_rest/api/files/file_exists.py +6 -2
  25. openapi_fal_rest/api/files/upload_from_url.py +6 -2
  26. openapi_fal_rest/api/files/upload_local_file.py +9 -3
  27. openapi_fal_rest/api/keys/create_key.py +6 -2
  28. openapi_fal_rest/api/keys/delete_key.py +6 -2
  29. openapi_fal_rest/api/tokens/create_token.py +6 -2
  30. openapi_fal_rest/api/usage/get_gateway_request_stats_by_time.py +41 -7
  31. openapi_fal_rest/api/usage/per_machine_usage_details.py +3 -1
  32. openapi_fal_rest/models/body_upload_file.py +4 -1
  33. openapi_fal_rest/models/body_upload_local_file.py +4 -1
  34. openapi_fal_rest/models/get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.py +15 -5
  35. {fal-0.11.2.dist-info → fal-0.11.3.dist-info}/WHEEL +0 -0
  36. {fal-0.11.2.dist-info → fal-0.11.3.dist-info}/entry_points.txt +0 -0
@@ -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()
@@ -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]:
File without changes