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,118 +0,0 @@
1
- import datetime
2
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
3
-
4
- import attr
5
- from dateutil.parser import isoparse
6
-
7
- from ..models.run_type import RunType
8
-
9
- if TYPE_CHECKING:
10
- from ..models.persisted_usage_record_meta import PersistedUsageRecordMeta
11
-
12
-
13
- T = TypeVar("T", bound="PersistedUsageRecord")
14
-
15
-
16
- @attr.s(auto_attribs=True)
17
- class PersistedUsageRecord:
18
- """
19
- Attributes:
20
- id (str):
21
- subscription_item_id (str):
22
- subscription_id (str):
23
- quantity (int):
24
- run_type (RunType): An enumeration.
25
- machine_type (str):
26
- timestamp (datetime.datetime):
27
- meta (PersistedUsageRecordMeta):
28
- """
29
-
30
- id: str
31
- subscription_item_id: str
32
- subscription_id: str
33
- quantity: int
34
- run_type: RunType
35
- machine_type: str
36
- timestamp: datetime.datetime
37
- meta: "PersistedUsageRecordMeta"
38
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
39
-
40
- def to_dict(self) -> Dict[str, Any]:
41
- id = self.id
42
- subscription_item_id = self.subscription_item_id
43
- subscription_id = self.subscription_id
44
- quantity = self.quantity
45
- run_type = self.run_type.value
46
-
47
- machine_type = self.machine_type
48
- timestamp = self.timestamp.isoformat()
49
-
50
- meta = self.meta.to_dict()
51
-
52
- field_dict: Dict[str, Any] = {}
53
- field_dict.update(self.additional_properties)
54
- field_dict.update(
55
- {
56
- "id": id,
57
- "subscription_item_id": subscription_item_id,
58
- "subscription_id": subscription_id,
59
- "quantity": quantity,
60
- "run_type": run_type,
61
- "machine_type": machine_type,
62
- "timestamp": timestamp,
63
- "meta": meta,
64
- }
65
- )
66
-
67
- return field_dict
68
-
69
- @classmethod
70
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
71
- from ..models.persisted_usage_record_meta import PersistedUsageRecordMeta
72
-
73
- d = src_dict.copy()
74
- id = d.pop("id")
75
-
76
- subscription_item_id = d.pop("subscription_item_id")
77
-
78
- subscription_id = d.pop("subscription_id")
79
-
80
- quantity = d.pop("quantity")
81
-
82
- run_type = RunType(d.pop("run_type"))
83
-
84
- machine_type = d.pop("machine_type")
85
-
86
- timestamp = isoparse(d.pop("timestamp"))
87
-
88
- meta = PersistedUsageRecordMeta.from_dict(d.pop("meta"))
89
-
90
- persisted_usage_record = cls(
91
- id=id,
92
- subscription_item_id=subscription_item_id,
93
- subscription_id=subscription_id,
94
- quantity=quantity,
95
- run_type=run_type,
96
- machine_type=machine_type,
97
- timestamp=timestamp,
98
- meta=meta,
99
- )
100
-
101
- persisted_usage_record.additional_properties = d
102
- return persisted_usage_record
103
-
104
- @property
105
- def additional_keys(self) -> List[str]:
106
- return list(self.additional_properties.keys())
107
-
108
- def __getitem__(self, key: str) -> Any:
109
- return self.additional_properties[key]
110
-
111
- def __setitem__(self, key: str, value: Any) -> None:
112
- self.additional_properties[key] = value
113
-
114
- def __delitem__(self, key: str) -> None:
115
- del self.additional_properties[key]
116
-
117
- def __contains__(self, key: str) -> bool:
118
- 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="PersistedUsageRecordMeta")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class PersistedUsageRecordMeta:
10
- """ """
11
-
12
- additional_properties: Dict[str, Any] = 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
- persisted_usage_record_meta = cls()
25
-
26
- persisted_usage_record_meta.additional_properties = d
27
- return persisted_usage_record_meta
28
-
29
- @property
30
- def additional_keys(self) -> List[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> Any:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: Any) -> 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
@@ -1,64 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="PresignedUploadUrl")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class PresignedUploadUrl:
10
- """
11
- Attributes:
12
- file_url (str):
13
- upload_url (str):
14
- """
15
-
16
- file_url: str
17
- upload_url: str
18
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
19
-
20
- def to_dict(self) -> Dict[str, Any]:
21
- file_url = self.file_url
22
- upload_url = self.upload_url
23
-
24
- field_dict: Dict[str, Any] = {}
25
- field_dict.update(self.additional_properties)
26
- field_dict.update(
27
- {
28
- "file_url": file_url,
29
- "upload_url": upload_url,
30
- }
31
- )
32
-
33
- return field_dict
34
-
35
- @classmethod
36
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
37
- d = src_dict.copy()
38
- file_url = d.pop("file_url")
39
-
40
- upload_url = d.pop("upload_url")
41
-
42
- presigned_upload_url = cls(
43
- file_url=file_url,
44
- upload_url=upload_url,
45
- )
46
-
47
- presigned_upload_url.additional_properties = d
48
- return presigned_upload_url
49
-
50
- @property
51
- def additional_keys(self) -> List[str]:
52
- return list(self.additional_properties.keys())
53
-
54
- def __getitem__(self, key: str) -> Any:
55
- return self.additional_properties[key]
56
-
57
- def __setitem__(self, key: str, value: Any) -> None:
58
- self.additional_properties[key] = value
59
-
60
- def __delitem__(self, key: str) -> None:
61
- del self.additional_properties[key]
62
-
63
- def __contains__(self, key: str) -> bool:
64
- return key in self.additional_properties
@@ -1,112 +0,0 @@
1
- import datetime
2
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
3
-
4
- import attr
5
- from dateutil.parser import isoparse
6
-
7
- if TYPE_CHECKING:
8
- from ..models.request_io_json_input import RequestIOJsonInput
9
- from ..models.request_io_json_output import RequestIOJsonOutput
10
-
11
-
12
- T = TypeVar("T", bound="RequestIO")
13
-
14
-
15
- @attr.s(auto_attribs=True)
16
- class RequestIO:
17
- """
18
- Attributes:
19
- request_id (str):
20
- date (datetime.datetime):
21
- json_input (RequestIOJsonInput):
22
- json_output (RequestIOJsonOutput):
23
- status_code (int):
24
- logs (str):
25
- duration_in_seconds (int):
26
- """
27
-
28
- request_id: str
29
- date: datetime.datetime
30
- json_input: "RequestIOJsonInput"
31
- json_output: "RequestIOJsonOutput"
32
- status_code: int
33
- logs: str
34
- duration_in_seconds: int
35
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
36
-
37
- def to_dict(self) -> Dict[str, Any]:
38
- request_id = self.request_id
39
- date = self.date.isoformat()
40
-
41
- json_input = self.json_input.to_dict()
42
-
43
- json_output = self.json_output.to_dict()
44
-
45
- status_code = self.status_code
46
- logs = self.logs
47
- duration_in_seconds = self.duration_in_seconds
48
-
49
- field_dict: Dict[str, Any] = {}
50
- field_dict.update(self.additional_properties)
51
- field_dict.update(
52
- {
53
- "request_id": request_id,
54
- "date": date,
55
- "json_input": json_input,
56
- "json_output": json_output,
57
- "status_code": status_code,
58
- "logs": logs,
59
- "duration_in_seconds": duration_in_seconds,
60
- }
61
- )
62
-
63
- return field_dict
64
-
65
- @classmethod
66
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
67
- from ..models.request_io_json_input import RequestIOJsonInput
68
- from ..models.request_io_json_output import RequestIOJsonOutput
69
-
70
- d = src_dict.copy()
71
- request_id = d.pop("request_id")
72
-
73
- date = isoparse(d.pop("date"))
74
-
75
- json_input = RequestIOJsonInput.from_dict(d.pop("json_input"))
76
-
77
- json_output = RequestIOJsonOutput.from_dict(d.pop("json_output"))
78
-
79
- status_code = d.pop("status_code")
80
-
81
- logs = d.pop("logs")
82
-
83
- duration_in_seconds = d.pop("duration_in_seconds")
84
-
85
- request_io = cls(
86
- request_id=request_id,
87
- date=date,
88
- json_input=json_input,
89
- json_output=json_output,
90
- status_code=status_code,
91
- logs=logs,
92
- duration_in_seconds=duration_in_seconds,
93
- )
94
-
95
- request_io.additional_properties = d
96
- return request_io
97
-
98
- @property
99
- def additional_keys(self) -> List[str]:
100
- return list(self.additional_properties.keys())
101
-
102
- def __getitem__(self, key: str) -> Any:
103
- return self.additional_properties[key]
104
-
105
- def __setitem__(self, key: str, value: Any) -> None:
106
- self.additional_properties[key] = value
107
-
108
- def __delitem__(self, key: str) -> None:
109
- del self.additional_properties[key]
110
-
111
- def __contains__(self, key: str) -> bool:
112
- 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="RequestIOJsonInput")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class RequestIOJsonInput:
10
- """ """
11
-
12
- additional_properties: Dict[str, Any] = 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
- request_io_json_input = cls()
25
-
26
- request_io_json_input.additional_properties = d
27
- return request_io_json_input
28
-
29
- @property
30
- def additional_keys(self) -> List[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> Any:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: Any) -> 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
@@ -1,43 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="RequestIOJsonOutput")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class RequestIOJsonOutput:
10
- """ """
11
-
12
- additional_properties: Dict[str, Any] = 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
- request_io_json_output = cls()
25
-
26
- request_io_json_output.additional_properties = d
27
- return request_io_json_output
28
-
29
- @property
30
- def additional_keys(self) -> List[str]:
31
- return list(self.additional_properties.keys())
32
-
33
- def __getitem__(self, key: str) -> Any:
34
- return self.additional_properties[key]
35
-
36
- def __setitem__(self, key: str, value: Any) -> 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
@@ -1,9 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- class RunType(str, Enum):
5
- CUSTOM = "custom"
6
- SHARED = "shared"
7
-
8
- def __str__(self) -> str:
9
- return str(self.value)
@@ -1,12 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- class StatsTimeframe(str, Enum):
5
- DAY = "day"
6
- HOUR = "hour"
7
- MINUTE = "minute"
8
- MONTH = "month"
9
- WEEK = "week"
10
-
11
- def __str__(self) -> str:
12
- return str(self.value)
@@ -1,82 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar, Union
2
-
3
- import attr
4
-
5
- from ..models.status_health import StatusHealth
6
- from ..types import UNSET, Unset
7
-
8
- T = TypeVar("T", bound="Status")
9
-
10
-
11
- @attr.s(auto_attribs=True)
12
- class Status:
13
- """
14
- Attributes:
15
- health (Union[Unset, StatusHealth]): Default: StatusHealth.HEALTHY.
16
- queue_size (Union[Unset, int]):
17
- median_processing_time (Union[Unset, float]):
18
- """
19
-
20
- health: Union[Unset, StatusHealth] = StatusHealth.HEALTHY
21
- queue_size: Union[Unset, int] = 0
22
- median_processing_time: Union[Unset, float] = 0.0
23
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
24
-
25
- def to_dict(self) -> Dict[str, Any]:
26
- health: Union[Unset, str] = UNSET
27
- if not isinstance(self.health, Unset):
28
- health = self.health.value
29
-
30
- queue_size = self.queue_size
31
- median_processing_time = self.median_processing_time
32
-
33
- field_dict: Dict[str, Any] = {}
34
- field_dict.update(self.additional_properties)
35
- field_dict.update({})
36
- if health is not UNSET:
37
- field_dict["health"] = health
38
- if queue_size is not UNSET:
39
- field_dict["queue_size"] = queue_size
40
- if median_processing_time is not UNSET:
41
- field_dict["median_processing_time"] = median_processing_time
42
-
43
- return field_dict
44
-
45
- @classmethod
46
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
47
- d = src_dict.copy()
48
- _health = d.pop("health", UNSET)
49
- health: Union[Unset, StatusHealth]
50
- if isinstance(_health, Unset):
51
- health = UNSET
52
- else:
53
- health = StatusHealth(_health)
54
-
55
- queue_size = d.pop("queue_size", UNSET)
56
-
57
- median_processing_time = d.pop("median_processing_time", UNSET)
58
-
59
- status = cls(
60
- health=health,
61
- queue_size=queue_size,
62
- median_processing_time=median_processing_time,
63
- )
64
-
65
- status.additional_properties = d
66
- return status
67
-
68
- @property
69
- def additional_keys(self) -> List[str]:
70
- return list(self.additional_properties.keys())
71
-
72
- def __getitem__(self, key: str) -> Any:
73
- return self.additional_properties[key]
74
-
75
- def __setitem__(self, key: str, value: Any) -> None:
76
- self.additional_properties[key] = value
77
-
78
- def __delitem__(self, key: str) -> None:
79
- del self.additional_properties[key]
80
-
81
- def __contains__(self, key: str) -> bool:
82
- return key in self.additional_properties
@@ -1,10 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- class StatusHealth(str, Enum):
5
- DEGRADED = "DEGRADED"
6
- HEALTHY = "HEALTHY"
7
- UNHEALTHY = "UNHEALTHY"
8
-
9
- def __str__(self) -> str:
10
- return str(self.value)
@@ -1,64 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="UploadedFileResult")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class UploadedFileResult:
10
- """
11
- Attributes:
12
- file_name (str):
13
- url (str):
14
- """
15
-
16
- file_name: str
17
- url: str
18
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
19
-
20
- def to_dict(self) -> Dict[str, Any]:
21
- file_name = self.file_name
22
- url = self.url
23
-
24
- field_dict: Dict[str, Any] = {}
25
- field_dict.update(self.additional_properties)
26
- field_dict.update(
27
- {
28
- "file_name": file_name,
29
- "url": url,
30
- }
31
- )
32
-
33
- return field_dict
34
-
35
- @classmethod
36
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
37
- d = src_dict.copy()
38
- file_name = d.pop("file_name")
39
-
40
- url = d.pop("url")
41
-
42
- uploaded_file_result = cls(
43
- file_name=file_name,
44
- url=url,
45
- )
46
-
47
- uploaded_file_result.additional_properties = d
48
- return uploaded_file_result
49
-
50
- @property
51
- def additional_keys(self) -> List[str]:
52
- return list(self.additional_properties.keys())
53
-
54
- def __getitem__(self, key: str) -> Any:
55
- return self.additional_properties[key]
56
-
57
- def __setitem__(self, key: str, value: Any) -> None:
58
- self.additional_properties[key] = value
59
-
60
- def __delitem__(self, key: str) -> None:
61
- del self.additional_properties[key]
62
-
63
- def __contains__(self, key: str) -> bool:
64
- return key in self.additional_properties
@@ -1,57 +0,0 @@
1
- from typing import Any, Dict, List, Type, TypeVar
2
-
3
- import attr
4
-
5
- T = TypeVar("T", bound="UrlFileUpload")
6
-
7
-
8
- @attr.s(auto_attribs=True)
9
- class UrlFileUpload:
10
- """
11
- Attributes:
12
- url (str):
13
- """
14
-
15
- url: str
16
- additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
17
-
18
- def to_dict(self) -> Dict[str, Any]:
19
- url = self.url
20
-
21
- field_dict: Dict[str, Any] = {}
22
- field_dict.update(self.additional_properties)
23
- field_dict.update(
24
- {
25
- "url": url,
26
- }
27
- )
28
-
29
- return field_dict
30
-
31
- @classmethod
32
- def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
33
- d = src_dict.copy()
34
- url = d.pop("url")
35
-
36
- url_file_upload = cls(
37
- url=url,
38
- )
39
-
40
- url_file_upload.additional_properties = d
41
- return url_file_upload
42
-
43
- @property
44
- def additional_keys(self) -> List[str]:
45
- return list(self.additional_properties.keys())
46
-
47
- def __getitem__(self, key: str) -> Any:
48
- return self.additional_properties[key]
49
-
50
- def __setitem__(self, key: str, value: Any) -> None:
51
- self.additional_properties[key] = value
52
-
53
- def __delitem__(self, key: str) -> None:
54
- del self.additional_properties[key]
55
-
56
- def __contains__(self, key: str) -> bool:
57
- return key in self.additional_properties