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,75 +0,0 @@
1
- from io import BytesIO
2
- from typing import Any, Dict, List, Type, TypeVar
3
-
4
- import attr
5
-
6
- from ..types import File
7
-
8
- T = TypeVar("T", bound="BodyUploadFile")
9
-
10
-
11
- @attr.s(auto_attribs=True)
12
- class BodyUploadFile:
13
- """
14
- Attributes:
15
- file (File):
16
- """
17
-
18
- file: File
19
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
20
-
21
- def to_dict(self) -> Dict[str, Any]:
22
- file = self.file.to_tuple()
23
-
24
- field_dict: Dict[str, Any] = {}
25
- field_dict.update(self.additional_properties)
26
- field_dict.update(
27
- {
28
- "file": file,
29
- }
30
- )
31
-
32
- return field_dict
33
-
34
- def to_multipart(self) -> Dict[str, Any]:
35
- file = self.file.to_tuple()
36
-
37
- field_dict: Dict[str, Any] = {}
38
- field_dict.update(
39
- {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
40
- )
41
- field_dict.update(
42
- {
43
- "file": file,
44
- }
45
- )
46
-
47
- return field_dict
48
-
49
- @classmethod
50
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
51
- d = src_dict.copy()
52
- file = File(payload=BytesIO(d.pop("file")))
53
-
54
- body_upload_file = cls(
55
- file=file,
56
- )
57
-
58
- body_upload_file.additional_properties = d
59
- return body_upload_file
60
-
61
- @property
62
- def additional_keys(self) -> List[str]:
63
- return list(self.additional_properties.keys())
64
-
65
- def __getitem__(self, key: str) -> Any:
66
- return self.additional_properties[key]
67
-
68
- def __setitem__(self, key: str, value: Any) -> None:
69
- self.additional_properties[key] = value
70
-
71
- def __delitem__(self, key: str) -> None:
72
- del self.additional_properties[key]
73
-
74
- def __contains__(self, key: str) -> bool:
75
- return key in self.additional_properties
@@ -1,110 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar, Union
2
-
3
- import attr
4
-
5
- from ..types import UNSET, Unset
6
-
7
- T = TypeVar("T", bound="FileSpec")
8
-
9
-
10
- @attr.s(auto_attribs=True)
11
- class FileSpec:
12
- """
13
- Attributes:
14
- path (str):
15
- name (str):
16
- created_time (float):
17
- updated_time (float):
18
- is_file (bool):
19
- size (int):
20
- checksum_sha256 (Union[Unset, str]):
21
- checksum_md5 (Union[Unset, str]):
22
- """
23
-
24
- path: str
25
- name: str
26
- created_time: float
27
- updated_time: float
28
- is_file: bool
29
- size: int
30
- checksum_sha256: Union[Unset, str] = UNSET
31
- checksum_md5: Union[Unset, str] = UNSET
32
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
33
-
34
- def to_dict(self) -> Dict[str, Any]:
35
- path = self.path
36
- name = self.name
37
- created_time = self.created_time
38
- updated_time = self.updated_time
39
- is_file = self.is_file
40
- size = self.size
41
- checksum_sha256 = self.checksum_sha256
42
- checksum_md5 = self.checksum_md5
43
-
44
- field_dict: Dict[str, Any] = {}
45
- field_dict.update(self.additional_properties)
46
- field_dict.update(
47
- {
48
- "path": path,
49
- "name": name,
50
- "created_time": created_time,
51
- "updated_time": updated_time,
52
- "is_file": is_file,
53
- "size": size,
54
- }
55
- )
56
- if checksum_sha256 is not UNSET:
57
- field_dict["checksum_sha256"] = checksum_sha256
58
- if checksum_md5 is not UNSET:
59
- field_dict["checksum_md5"] = checksum_md5
60
-
61
- return field_dict
62
-
63
- @classmethod
64
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
65
- d = src_dict.copy()
66
- path = d.pop("path")
67
-
68
- name = d.pop("name")
69
-
70
- created_time = d.pop("created_time")
71
-
72
- updated_time = d.pop("updated_time")
73
-
74
- is_file = d.pop("is_file")
75
-
76
- size = d.pop("size")
77
-
78
- checksum_sha256 = d.pop("checksum_sha256", UNSET)
79
-
80
- checksum_md5 = d.pop("checksum_md5", UNSET)
81
-
82
- file_spec = cls(
83
- path=path,
84
- name=name,
85
- created_time=created_time,
86
- updated_time=updated_time,
87
- is_file=is_file,
88
- size=size,
89
- checksum_sha256=checksum_sha256,
90
- checksum_md5=checksum_md5,
91
- )
92
-
93
- file_spec.additional_properties = d
94
- return file_spec
95
-
96
- @property
97
- def additional_keys(self) -> List[str]:
98
- return list(self.additional_properties.keys())
99
-
100
- def __getitem__(self, key: str) -> Any:
101
- return self.additional_properties[key]
102
-
103
- def __setitem__(self, key: str, value: Any) -> None:
104
- self.additional_properties[key] = value
105
-
106
- def __delitem__(self, key: str) -> None:
107
- del self.additional_properties[key]
108
-
109
- def __contains__(self, key: str) -> bool:
110
- return key in self.additional_properties
@@ -1,115 +0,0 @@
1
- import datetime
2
- from typing import Any, Dict, List, Type, TypeVar, Union
3
-
4
- import attr
5
- from dateutil.parser import isoparse
6
-
7
- from ..types import UNSET, Unset
8
-
9
- T = TypeVar("T", bound="GatewayStatsByTime")
10
-
11
-
12
- @attr.s(auto_attribs=True)
13
- class GatewayStatsByTime:
14
- """
15
- Attributes:
16
- request_count (int):
17
- success_count (int):
18
- error_count (int):
19
- datetime_ (datetime.datetime):
20
- p25_duration (Union[Unset, None, float]):
21
- p50_duration (Union[Unset, None, float]):
22
- p75_duration (Union[Unset, None, float]):
23
- p90_duration (Union[Unset, None, float]):
24
- """
25
-
26
- request_count: int
27
- success_count: int
28
- error_count: int
29
- datetime_: datetime.datetime
30
- p25_duration: Union[Unset, None, float] = UNSET
31
- p50_duration: Union[Unset, None, float] = UNSET
32
- p75_duration: Union[Unset, None, float] = UNSET
33
- p90_duration: Union[Unset, None, float] = UNSET
34
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
35
-
36
- def to_dict(self) -> Dict[str, Any]:
37
- request_count = self.request_count
38
- success_count = self.success_count
39
- error_count = self.error_count
40
- datetime_ = self.datetime_.isoformat()
41
-
42
- p25_duration = self.p25_duration
43
- p50_duration = self.p50_duration
44
- p75_duration = self.p75_duration
45
- p90_duration = self.p90_duration
46
-
47
- field_dict: Dict[str, Any] = {}
48
- field_dict.update(self.additional_properties)
49
- field_dict.update(
50
- {
51
- "request_count": request_count,
52
- "success_count": success_count,
53
- "error_count": error_count,
54
- "datetime": datetime_,
55
- }
56
- )
57
- if p25_duration is not UNSET:
58
- field_dict["p25_duration"] = p25_duration
59
- if p50_duration is not UNSET:
60
- field_dict["p50_duration"] = p50_duration
61
- if p75_duration is not UNSET:
62
- field_dict["p75_duration"] = p75_duration
63
- if p90_duration is not UNSET:
64
- field_dict["p90_duration"] = p90_duration
65
-
66
- return field_dict
67
-
68
- @classmethod
69
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
70
- d = src_dict.copy()
71
- request_count = d.pop("request_count")
72
-
73
- success_count = d.pop("success_count")
74
-
75
- error_count = d.pop("error_count")
76
-
77
- datetime_ = isoparse(d.pop("datetime"))
78
-
79
- p25_duration = d.pop("p25_duration", UNSET)
80
-
81
- p50_duration = d.pop("p50_duration", UNSET)
82
-
83
- p75_duration = d.pop("p75_duration", UNSET)
84
-
85
- p90_duration = d.pop("p90_duration", UNSET)
86
-
87
- gateway_stats_by_time = cls(
88
- request_count=request_count,
89
- success_count=success_count,
90
- error_count=error_count,
91
- datetime_=datetime_,
92
- p25_duration=p25_duration,
93
- p50_duration=p50_duration,
94
- p75_duration=p75_duration,
95
- p90_duration=p90_duration,
96
- )
97
-
98
- gateway_stats_by_time.additional_properties = d
99
- return gateway_stats_by_time
100
-
101
- @property
102
- def additional_keys(self) -> List[str]:
103
- return list(self.additional_properties.keys())
104
-
105
- def __getitem__(self, key: str) -> Any:
106
- return self.additional_properties[key]
107
-
108
- def __setitem__(self, key: str, value: Any) -> None:
109
- self.additional_properties[key] = value
110
-
111
- def __delitem__(self, key: str) -> None:
112
- del self.additional_properties[key]
113
-
114
- def __contains__(self, key: str) -> bool:
115
- return key in self.additional_properties
@@ -1,147 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
-
3
- import attr
4
-
5
- from ..types import UNSET, Unset
6
-
7
- if TYPE_CHECKING:
8
- from ..models.gateway_stats_by_time import GatewayStatsByTime
9
-
10
-
11
- T = TypeVar("T", bound="GatewayUsageStats")
12
-
13
-
14
- @attr.s(auto_attribs=True)
15
- class GatewayUsageStats:
16
- """
17
- Attributes:
18
- request_count (int):
19
- success_count (int):
20
- error_count (int):
21
- application_name (str):
22
- total_billable_duration (float):
23
- p25_duration (Union[Unset, None, float]):
24
- p50_duration (Union[Unset, None, float]):
25
- p75_duration (Union[Unset, None, float]):
26
- p90_duration (Union[Unset, None, float]):
27
- time_stats (Union[Unset, None, List['GatewayStatsByTime']]):
28
- """
29
-
30
- request_count: int
31
- success_count: int
32
- error_count: int
33
- application_name: str
34
- total_billable_duration: float
35
- p25_duration: Union[Unset, None, float] = UNSET
36
- p50_duration: Union[Unset, None, float] = UNSET
37
- p75_duration: Union[Unset, None, float] = UNSET
38
- p90_duration: Union[Unset, None, float] = UNSET
39
- time_stats: Union[Unset, None, List["GatewayStatsByTime"]] = UNSET
40
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
41
-
42
- def to_dict(self) -> Dict[str, Any]:
43
- request_count = self.request_count
44
- success_count = self.success_count
45
- error_count = self.error_count
46
- application_name = self.application_name
47
- total_billable_duration = self.total_billable_duration
48
- p25_duration = self.p25_duration
49
- p50_duration = self.p50_duration
50
- p75_duration = self.p75_duration
51
- p90_duration = self.p90_duration
52
- time_stats: Union[Unset, None, List[Dict[str, Any]]] = UNSET
53
- if not isinstance(self.time_stats, Unset):
54
- if self.time_stats is None:
55
- time_stats = None
56
- else:
57
- time_stats = []
58
- for time_stats_item_data in self.time_stats:
59
- time_stats_item = time_stats_item_data.to_dict()
60
-
61
- time_stats.append(time_stats_item)
62
-
63
- field_dict: Dict[str, Any] = {}
64
- field_dict.update(self.additional_properties)
65
- field_dict.update(
66
- {
67
- "request_count": request_count,
68
- "success_count": success_count,
69
- "error_count": error_count,
70
- "application_name": application_name,
71
- "total_billable_duration": total_billable_duration,
72
- }
73
- )
74
- if p25_duration is not UNSET:
75
- field_dict["p25_duration"] = p25_duration
76
- if p50_duration is not UNSET:
77
- field_dict["p50_duration"] = p50_duration
78
- if p75_duration is not UNSET:
79
- field_dict["p75_duration"] = p75_duration
80
- if p90_duration is not UNSET:
81
- field_dict["p90_duration"] = p90_duration
82
- if time_stats is not UNSET:
83
- field_dict["time_stats"] = time_stats
84
-
85
- return field_dict
86
-
87
- @classmethod
88
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
89
- from ..models.gateway_stats_by_time import GatewayStatsByTime
90
-
91
- d = src_dict.copy()
92
- request_count = d.pop("request_count")
93
-
94
- success_count = d.pop("success_count")
95
-
96
- error_count = d.pop("error_count")
97
-
98
- application_name = d.pop("application_name")
99
-
100
- total_billable_duration = d.pop("total_billable_duration")
101
-
102
- p25_duration = d.pop("p25_duration", UNSET)
103
-
104
- p50_duration = d.pop("p50_duration", UNSET)
105
-
106
- p75_duration = d.pop("p75_duration", UNSET)
107
-
108
- p90_duration = d.pop("p90_duration", UNSET)
109
-
110
- time_stats = []
111
- _time_stats = d.pop("time_stats", UNSET)
112
- for time_stats_item_data in _time_stats or []:
113
- time_stats_item = GatewayStatsByTime.from_dict(time_stats_item_data)
114
-
115
- time_stats.append(time_stats_item)
116
-
117
- gateway_usage_stats = cls(
118
- request_count=request_count,
119
- success_count=success_count,
120
- error_count=error_count,
121
- application_name=application_name,
122
- total_billable_duration=total_billable_duration,
123
- p25_duration=p25_duration,
124
- p50_duration=p50_duration,
125
- p75_duration=p75_duration,
126
- p90_duration=p90_duration,
127
- time_stats=time_stats,
128
- )
129
-
130
- gateway_usage_stats.additional_properties = d
131
- return gateway_usage_stats
132
-
133
- @property
134
- def additional_keys(self) -> List[str]:
135
- return list(self.additional_properties.keys())
136
-
137
- def __getitem__(self, key: str) -> Any:
138
- return self.additional_properties[key]
139
-
140
- def __setitem__(self, key: str, value: Any) -> None:
141
- self.additional_properties[key] = value
142
-
143
- def __delitem__(self, key: str) -> None:
144
- del self.additional_properties[key]
145
-
146
- def __contains__(self, key: str) -> bool:
147
- return key in self.additional_properties
@@ -1,70 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- if TYPE_CHECKING:
6
- from ..models.gateway_stats_by_time import GatewayStatsByTime
7
-
8
-
9
- T = TypeVar("T", bound="GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime")
10
-
11
-
12
- @attr.s(auto_attribs=True)
13
- class GetGatewayRequestStatsByTimeResponseGetGatewayRequestStatsByTime:
14
- """ """
15
-
16
- additional_properties: Dict[str, List["GatewayStatsByTime"]] = attr.ib(init=False, factory=dict)
17
-
18
- def to_dict(self) -> Dict[str, Any]:
19
- pass
20
-
21
- field_dict: Dict[str, Any] = {}
22
- for prop_name, prop in self.additional_properties.items():
23
- field_dict[prop_name] = []
24
- for additional_property_item_data in prop:
25
- additional_property_item = additional_property_item_data.to_dict()
26
-
27
- field_dict[prop_name].append(additional_property_item)
28
-
29
- field_dict.update({})
30
-
31
- return field_dict
32
-
33
- @classmethod
34
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
35
- from ..models.gateway_stats_by_time import GatewayStatsByTime
36
-
37
- d = src_dict.copy()
38
- get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time = cls()
39
-
40
- additional_properties = {}
41
- for prop_name, prop_dict in d.items():
42
- additional_property = []
43
- _additional_property = prop_dict
44
- for additional_property_item_data in _additional_property:
45
- additional_property_item = GatewayStatsByTime.from_dict(additional_property_item_data)
46
-
47
- additional_property.append(additional_property_item)
48
-
49
- additional_properties[prop_name] = additional_property
50
-
51
- get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.additional_properties = (
52
- additional_properties
53
- )
54
- return get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time
55
-
56
- @property
57
- def additional_keys(self) -> List[str]:
58
- return list(self.additional_properties.keys())
59
-
60
- def __getitem__(self, key: str) -> List["GatewayStatsByTime"]:
61
- return self.additional_properties[key]
62
-
63
- def __setitem__(self, key: str, value: List["GatewayStatsByTime"]) -> None:
64
- self.additional_properties[key] = value
65
-
66
- def __delitem__(self, key: str) -> None:
67
- del self.additional_properties[key]
68
-
69
- def __contains__(self, key: str) -> bool:
70
- return key in self.additional_properties
@@ -1,85 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="GroupedUsageDetail")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class GroupedUsageDetail:
10
- """
11
- Attributes:
12
- model_id (str):
13
- machine_type (str):
14
- request_count (int):
15
- median_duration (float):
16
- total_duration (float):
17
- """
18
-
19
- model_id: str
20
- machine_type: str
21
- request_count: int
22
- median_duration: float
23
- total_duration: float
24
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
25
-
26
- def to_dict(self) -> Dict[str, Any]:
27
- model_id = self.model_id
28
- machine_type = self.machine_type
29
- request_count = self.request_count
30
- median_duration = self.median_duration
31
- total_duration = self.total_duration
32
-
33
- field_dict: Dict[str, Any] = {}
34
- field_dict.update(self.additional_properties)
35
- field_dict.update(
36
- {
37
- "model_id": model_id,
38
- "machine_type": machine_type,
39
- "request_count": request_count,
40
- "median_duration": median_duration,
41
- "total_duration": total_duration,
42
- }
43
- )
44
-
45
- return field_dict
46
-
47
- @classmethod
48
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
49
- d = src_dict.copy()
50
- model_id = d.pop("model_id")
51
-
52
- machine_type = d.pop("machine_type")
53
-
54
- request_count = d.pop("request_count")
55
-
56
- median_duration = d.pop("median_duration")
57
-
58
- total_duration = d.pop("total_duration")
59
-
60
- grouped_usage_detail = cls(
61
- model_id=model_id,
62
- machine_type=machine_type,
63
- request_count=request_count,
64
- median_duration=median_duration,
65
- total_duration=total_duration,
66
- )
67
-
68
- grouped_usage_detail.additional_properties = d
69
- return grouped_usage_detail
70
-
71
- @property
72
- def additional_keys(self) -> List[str]:
73
- return list(self.additional_properties.keys())
74
-
75
- def __getitem__(self, key: str) -> Any:
76
- return self.additional_properties[key]
77
-
78
- def __setitem__(self, key: str, value: Any) -> None:
79
- self.additional_properties[key] = value
80
-
81
- def __delitem__(self, key: str) -> None:
82
- del self.additional_properties[key]
83
-
84
- def __contains__(self, key: str) -> bool:
85
- return key in self.additional_properties
@@ -1,43 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="HandleStripeWebhookResponseHandleStripeWebhook")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class HandleStripeWebhookResponseHandleStripeWebhook:
10
- """ """
11
-
12
- additional_properties: Dict[str, bool] = attr.ib(init=False, factory=dict)
13
-
14
- def to_dict(self) -> Dict[str, Any]:
15
- field_dict: Dict[str, Any] = {}
16
- field_dict.update(self.additional_properties)
17
- field_dict.update({})
18
-
19
- return field_dict
20
-
21
- @classmethod
22
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
23
- d = src_dict.copy()
24
- handle_stripe_webhook_response_handle_stripe_webhook = cls()
25
-
26
- handle_stripe_webhook_response_handle_stripe_webhook.additional_properties = d
27
- return handle_stripe_webhook_response_handle_stripe_webhook
28
-
29
- @property
30
- def additional_keys(self) -> List[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> bool:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: bool) -> None:
37
- self.additional_properties[key] = value
38
-
39
- def __delitem__(self, key: str) -> None:
40
- del self.additional_properties[key]
41
-
42
- def __contains__(self, key: str) -> bool:
43
- return key in self.additional_properties