fal 1.0.7__py3-none-any.whl → 1.1.0__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 (50) hide show
  1. fal/_fal_version.py +2 -2
  2. fal/api.py +116 -29
  3. fal/app.py +63 -1
  4. fal/cli/deploy.py +18 -8
  5. fal/cli/doctor.py +37 -0
  6. fal/cli/main.py +2 -2
  7. fal/sdk.py +6 -2
  8. fal/toolkit/file/providers/fal.py +1 -0
  9. fal/workflows.py +1 -1
  10. {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/METADATA +2 -1
  11. {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/RECORD +49 -27
  12. {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/WHEEL +1 -1
  13. openapi_fal_rest/api/comfy/__init__.py +0 -0
  14. openapi_fal_rest/api/comfy/create_workflow.py +172 -0
  15. openapi_fal_rest/api/comfy/delete_workflow.py +175 -0
  16. openapi_fal_rest/api/comfy/get_workflow.py +181 -0
  17. openapi_fal_rest/api/comfy/list_user_workflows.py +189 -0
  18. openapi_fal_rest/api/comfy/update_workflow.py +198 -0
  19. openapi_fal_rest/api/users/__init__.py +0 -0
  20. openapi_fal_rest/api/users/get_current_user.py +143 -0
  21. openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py} +4 -4
  22. openapi_fal_rest/api/workflows/{get_workflows_workflows_get.py → list_user_workflows.py} +4 -4
  23. openapi_fal_rest/api/workflows/update_workflow.py +198 -0
  24. openapi_fal_rest/models/__init__.py +32 -10
  25. openapi_fal_rest/models/comfy_workflow_detail.py +109 -0
  26. openapi_fal_rest/models/comfy_workflow_item.py +88 -0
  27. openapi_fal_rest/models/comfy_workflow_schema.py +119 -0
  28. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0.py → comfy_workflow_schema_extra_data.py} +5 -5
  29. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0.py → comfy_workflow_schema_fal_inputs.py} +5 -5
  30. openapi_fal_rest/models/comfy_workflow_schema_fal_inputs_dev_info.py +44 -0
  31. openapi_fal_rest/models/{workflow_detail_contents_type_0.py → comfy_workflow_schema_prompt.py} +5 -5
  32. openapi_fal_rest/models/current_user.py +138 -0
  33. openapi_fal_rest/models/customer_details.py +8 -8
  34. openapi_fal_rest/models/lock_reason.py +3 -0
  35. openapi_fal_rest/models/page_comfy_workflow_item.py +107 -0
  36. openapi_fal_rest/models/team_role.py +10 -0
  37. openapi_fal_rest/models/typed_comfy_workflow.py +85 -0
  38. openapi_fal_rest/models/typed_comfy_workflow_update.py +95 -0
  39. openapi_fal_rest/models/typed_workflow_update.py +95 -0
  40. openapi_fal_rest/models/user_member.py +87 -0
  41. openapi_fal_rest/models/workflow_contents.py +20 -1
  42. openapi_fal_rest/models/workflow_contents_metadata.py +44 -0
  43. openapi_fal_rest/models/workflow_detail.py +18 -59
  44. openapi_fal_rest/models/workflow_detail_contents.py +44 -0
  45. openapi_fal_rest/models/workflow_item.py +19 -1
  46. openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +0 -268
  47. {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/entry_points.txt +0 -0
  48. {fal-1.0.7.dist-info → fal-1.1.0.dist-info}/top_level.txt +0 -0
  49. /openapi_fal_rest/api/workflows/{delete_workflow_workflows_user_id_workflow_name_delete.py → delete_workflow.py} +0 -0
  50. /openapi_fal_rest/api/workflows/{get_workflow_workflows_user_id_workflow_name_get.py → get_workflow.py} +0 -0
@@ -2,11 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar
2
2
 
3
3
  import attr
4
4
 
5
- T = TypeVar("T", bound="WorkflowDetailContentsType0")
5
+ T = TypeVar("T", bound="ComfyWorkflowSchemaPrompt")
6
6
 
7
7
 
8
8
  @attr.s(auto_attribs=True)
9
- class WorkflowDetailContentsType0:
9
+ class ComfyWorkflowSchemaPrompt:
10
10
  """ """
11
11
 
12
12
  additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@@ -22,10 +22,10 @@ class WorkflowDetailContentsType0:
22
22
  @classmethod
23
23
  def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
24
24
  d = src_dict.copy()
25
- workflow_detail_contents_type_0 = cls()
25
+ comfy_workflow_schema_prompt = cls()
26
26
 
27
- workflow_detail_contents_type_0.additional_properties = d
28
- return workflow_detail_contents_type_0
27
+ comfy_workflow_schema_prompt.additional_properties = d
28
+ return comfy_workflow_schema_prompt
29
29
 
30
30
  @property
31
31
  def additional_keys(self) -> List[str]:
@@ -0,0 +1,138 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ import attr
4
+
5
+ from ..models.lock_reason import LockReason
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.user_member import UserMember
10
+
11
+
12
+ T = TypeVar("T", bound="CurrentUser")
13
+
14
+
15
+ @attr.s(auto_attribs=True)
16
+ class CurrentUser:
17
+ """
18
+ Attributes:
19
+ full_name (str):
20
+ nickname (str):
21
+ user_id (str):
22
+ is_personal (bool):
23
+ is_locked (bool):
24
+ lock_reason (Union[Unset, LockReason]): An enumeration.
25
+ members (Union[Unset, List['UserMember']]):
26
+ is_paying (Union[Unset, bool]):
27
+ """
28
+
29
+ full_name: str
30
+ nickname: str
31
+ user_id: str
32
+ is_personal: bool
33
+ is_locked: bool
34
+ lock_reason: Union[Unset, LockReason] = UNSET
35
+ members: Union[Unset, List["UserMember"]] = UNSET
36
+ is_paying: Union[Unset, bool] = False
37
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
38
+
39
+ def to_dict(self) -> Dict[str, Any]:
40
+ full_name = self.full_name
41
+ nickname = self.nickname
42
+ user_id = self.user_id
43
+ is_personal = self.is_personal
44
+ is_locked = self.is_locked
45
+ lock_reason: Union[Unset, str] = UNSET
46
+ if not isinstance(self.lock_reason, Unset):
47
+ lock_reason = self.lock_reason.value
48
+
49
+ members: Union[Unset, List[Dict[str, Any]]] = UNSET
50
+ if not isinstance(self.members, Unset):
51
+ members = []
52
+ for members_item_data in self.members:
53
+ members_item = members_item_data.to_dict()
54
+
55
+ members.append(members_item)
56
+
57
+ is_paying = self.is_paying
58
+
59
+ field_dict: Dict[str, Any] = {}
60
+ field_dict.update(self.additional_properties)
61
+ field_dict.update(
62
+ {
63
+ "full_name": full_name,
64
+ "nickname": nickname,
65
+ "user_id": user_id,
66
+ "is_personal": is_personal,
67
+ "is_locked": is_locked,
68
+ }
69
+ )
70
+ if lock_reason is not UNSET:
71
+ field_dict["lock_reason"] = lock_reason
72
+ if members is not UNSET:
73
+ field_dict["members"] = members
74
+ if is_paying is not UNSET:
75
+ field_dict["is_paying"] = is_paying
76
+
77
+ return field_dict
78
+
79
+ @classmethod
80
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
81
+ from ..models.user_member import UserMember
82
+
83
+ d = src_dict.copy()
84
+ full_name = d.pop("full_name")
85
+
86
+ nickname = d.pop("nickname")
87
+
88
+ user_id = d.pop("user_id")
89
+
90
+ is_personal = d.pop("is_personal")
91
+
92
+ is_locked = d.pop("is_locked")
93
+
94
+ _lock_reason = d.pop("lock_reason", UNSET)
95
+ lock_reason: Union[Unset, LockReason]
96
+ if _lock_reason is None or isinstance(_lock_reason, Unset):
97
+ lock_reason = UNSET
98
+ else:
99
+ lock_reason = LockReason(_lock_reason)
100
+
101
+ members = []
102
+ _members = d.pop("members", UNSET)
103
+ for members_item_data in _members or []:
104
+ members_item = UserMember.from_dict(members_item_data)
105
+
106
+ members.append(members_item)
107
+
108
+ is_paying = d.pop("is_paying", UNSET)
109
+
110
+ current_user = cls(
111
+ full_name=full_name,
112
+ nickname=nickname,
113
+ user_id=user_id,
114
+ is_personal=is_personal,
115
+ is_locked=is_locked,
116
+ lock_reason=lock_reason,
117
+ members=members,
118
+ is_paying=is_paying,
119
+ )
120
+
121
+ current_user.additional_properties = d
122
+ return current_user
123
+
124
+ @property
125
+ def additional_keys(self) -> List[str]:
126
+ return list(self.additional_properties.keys())
127
+
128
+ def __getitem__(self, key: str) -> Any:
129
+ return self.additional_properties[key]
130
+
131
+ def __setitem__(self, key: str, value: Any) -> None:
132
+ self.additional_properties[key] = value
133
+
134
+ def __delitem__(self, key: str) -> None:
135
+ del self.additional_properties[key]
136
+
137
+ def __contains__(self, key: str) -> bool:
138
+ return key in self.additional_properties
@@ -16,18 +16,18 @@ class CustomerDetails:
16
16
  soft_monthly_budget (Union[Unset, int]):
17
17
  hard_monthly_budget (Union[Unset, int]):
18
18
  lock_reason (Union[Unset, None, LockReason]): An enumeration.
19
- current_balance (Union[Unset, int]):
20
19
  is_paying (Union[Unset, bool]):
21
20
  is_locked (Union[Unset, bool]):
21
+ is_eligible_for_extra_credits (Union[Unset, bool]):
22
22
  """
23
23
 
24
24
  user_id: str
25
25
  soft_monthly_budget: Union[Unset, int] = UNSET
26
26
  hard_monthly_budget: Union[Unset, int] = UNSET
27
27
  lock_reason: Union[Unset, None, LockReason] = UNSET
28
- current_balance: Union[Unset, int] = 0
29
28
  is_paying: Union[Unset, bool] = False
30
29
  is_locked: Union[Unset, bool] = False
30
+ is_eligible_for_extra_credits: Union[Unset, bool] = False
31
31
  additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
32
32
 
33
33
  def to_dict(self) -> Dict[str, Any]:
@@ -38,9 +38,9 @@ class CustomerDetails:
38
38
  if not isinstance(self.lock_reason, Unset):
39
39
  lock_reason = self.lock_reason.value if self.lock_reason else None
40
40
 
41
- current_balance = self.current_balance
42
41
  is_paying = self.is_paying
43
42
  is_locked = self.is_locked
43
+ is_eligible_for_extra_credits = self.is_eligible_for_extra_credits
44
44
 
45
45
  field_dict: Dict[str, Any] = {}
46
46
  field_dict.update(self.additional_properties)
@@ -55,12 +55,12 @@ class CustomerDetails:
55
55
  field_dict["hard_monthly_budget"] = hard_monthly_budget
56
56
  if lock_reason is not UNSET:
57
57
  field_dict["lock_reason"] = lock_reason
58
- if current_balance is not UNSET:
59
- field_dict["current_balance"] = current_balance
60
58
  if is_paying is not UNSET:
61
59
  field_dict["is_paying"] = is_paying
62
60
  if is_locked is not UNSET:
63
61
  field_dict["is_locked"] = is_locked
62
+ if is_eligible_for_extra_credits is not UNSET:
63
+ field_dict["is_eligible_for_extra_credits"] = is_eligible_for_extra_credits
64
64
 
65
65
  return field_dict
66
66
 
@@ -82,20 +82,20 @@ class CustomerDetails:
82
82
  else:
83
83
  lock_reason = LockReason(_lock_reason)
84
84
 
85
- current_balance = d.pop("current_balance", UNSET)
86
-
87
85
  is_paying = d.pop("is_paying", UNSET)
88
86
 
89
87
  is_locked = d.pop("is_locked", UNSET)
90
88
 
89
+ is_eligible_for_extra_credits = d.pop("is_eligible_for_extra_credits", UNSET)
90
+
91
91
  customer_details = cls(
92
92
  user_id=user_id,
93
93
  soft_monthly_budget=soft_monthly_budget,
94
94
  hard_monthly_budget=hard_monthly_budget,
95
95
  lock_reason=lock_reason,
96
- current_balance=current_balance,
97
96
  is_paying=is_paying,
98
97
  is_locked=is_locked,
98
+ is_eligible_for_extra_credits=is_eligible_for_extra_credits,
99
99
  )
100
100
 
101
101
  customer_details.additional_properties = d
@@ -7,6 +7,9 @@ class LockReason(str, Enum):
7
7
  "Exhausted balance. Top up your balance at fal.ai/dashboard/billing"
8
8
  )
9
9
  PLEASE_ADD_A_PAYMENT_METHOD_AT_FAL_AIDASHBOARDBILLING = "Please add a payment method at fal.ai/dashboard/billing"
10
+ THIS_ACCOUNT_HAS_BEEN_ARCHIVED_PLEASE_CONTACT_HELLOFAL_AI = (
11
+ "This account has been archived. Please contact hello@fal.ai."
12
+ )
10
13
  UNKNOWN_PLEASE_CONTACT_HELLOFAL_AI = "Unknown. Please contact hello@fal.ai."
11
14
  USER_BUDGET_IS_EXCEEDED_ADJUST_IT_AT_FAL_AIDASHBOARDBILLING = (
12
15
  "User budget is exceeded. Adjust it at fal.ai/dashboard/billing"
@@ -0,0 +1,107 @@
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.comfy_workflow_item import ComfyWorkflowItem
9
+
10
+
11
+ T = TypeVar("T", bound="PageComfyWorkflowItem")
12
+
13
+
14
+ @attr.s(auto_attribs=True)
15
+ class PageComfyWorkflowItem:
16
+ """
17
+ Attributes:
18
+ items (List['ComfyWorkflowItem']):
19
+ total (Union[Unset, int]):
20
+ page (Union[Unset, int]):
21
+ size (Union[Unset, int]):
22
+ pages (Union[Unset, int]):
23
+ """
24
+
25
+ items: List["ComfyWorkflowItem"]
26
+ total: Union[Unset, int] = UNSET
27
+ page: Union[Unset, int] = UNSET
28
+ size: Union[Unset, int] = UNSET
29
+ pages: Union[Unset, int] = UNSET
30
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
31
+
32
+ def to_dict(self) -> Dict[str, Any]:
33
+ items = []
34
+ for items_item_data in self.items:
35
+ items_item = items_item_data.to_dict()
36
+
37
+ items.append(items_item)
38
+
39
+ total = self.total
40
+ page = self.page
41
+ size = self.size
42
+ pages = self.pages
43
+
44
+ field_dict: Dict[str, Any] = {}
45
+ field_dict.update(self.additional_properties)
46
+ field_dict.update(
47
+ {
48
+ "items": items,
49
+ }
50
+ )
51
+ if total is not UNSET:
52
+ field_dict["total"] = total
53
+ if page is not UNSET:
54
+ field_dict["page"] = page
55
+ if size is not UNSET:
56
+ field_dict["size"] = size
57
+ if pages is not UNSET:
58
+ field_dict["pages"] = pages
59
+
60
+ return field_dict
61
+
62
+ @classmethod
63
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
64
+ from ..models.comfy_workflow_item import ComfyWorkflowItem
65
+
66
+ d = src_dict.copy()
67
+ items = []
68
+ _items = d.pop("items")
69
+ for items_item_data in _items:
70
+ items_item = ComfyWorkflowItem.from_dict(items_item_data)
71
+
72
+ items.append(items_item)
73
+
74
+ total = d.pop("total", UNSET)
75
+
76
+ page = d.pop("page", UNSET)
77
+
78
+ size = d.pop("size", UNSET)
79
+
80
+ pages = d.pop("pages", UNSET)
81
+
82
+ page_comfy_workflow_item = cls(
83
+ items=items,
84
+ total=total,
85
+ page=page,
86
+ size=size,
87
+ pages=pages,
88
+ )
89
+
90
+ page_comfy_workflow_item.additional_properties = d
91
+ return page_comfy_workflow_item
92
+
93
+ @property
94
+ def additional_keys(self) -> List[str]:
95
+ return list(self.additional_properties.keys())
96
+
97
+ def __getitem__(self, key: str) -> Any:
98
+ return self.additional_properties[key]
99
+
100
+ def __setitem__(self, key: str, value: Any) -> None:
101
+ self.additional_properties[key] = value
102
+
103
+ def __delitem__(self, key: str) -> None:
104
+ del self.additional_properties[key]
105
+
106
+ def __contains__(self, key: str) -> bool:
107
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class TeamRole(str, Enum):
5
+ ADMIN = "Admin"
6
+ BILLING = "Billing"
7
+ DEVELOPER = "Developer"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,85 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
2
+
3
+ import attr
4
+
5
+ if TYPE_CHECKING:
6
+ from ..models.comfy_workflow_schema import ComfyWorkflowSchema
7
+
8
+
9
+ T = TypeVar("T", bound="TypedComfyWorkflow")
10
+
11
+
12
+ @attr.s(auto_attribs=True)
13
+ class TypedComfyWorkflow:
14
+ """
15
+ Attributes:
16
+ title (str):
17
+ workflow (ComfyWorkflowSchema):
18
+ is_public (bool):
19
+ name (str):
20
+ """
21
+
22
+ title: str
23
+ workflow: "ComfyWorkflowSchema"
24
+ is_public: bool
25
+ name: str
26
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> Dict[str, Any]:
29
+ title = self.title
30
+ workflow = self.workflow.to_dict()
31
+
32
+ is_public = self.is_public
33
+ name = self.name
34
+
35
+ field_dict: Dict[str, Any] = {}
36
+ field_dict.update(self.additional_properties)
37
+ field_dict.update(
38
+ {
39
+ "title": title,
40
+ "workflow": workflow,
41
+ "is_public": is_public,
42
+ "name": name,
43
+ }
44
+ )
45
+
46
+ return field_dict
47
+
48
+ @classmethod
49
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
50
+ from ..models.comfy_workflow_schema import ComfyWorkflowSchema
51
+
52
+ d = src_dict.copy()
53
+ title = d.pop("title")
54
+
55
+ workflow = ComfyWorkflowSchema.from_dict(d.pop("workflow"))
56
+
57
+ is_public = d.pop("is_public")
58
+
59
+ name = d.pop("name")
60
+
61
+ typed_comfy_workflow = cls(
62
+ title=title,
63
+ workflow=workflow,
64
+ is_public=is_public,
65
+ name=name,
66
+ )
67
+
68
+ typed_comfy_workflow.additional_properties = d
69
+ return typed_comfy_workflow
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
@@ -0,0 +1,95 @@
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.comfy_workflow_schema import ComfyWorkflowSchema
9
+
10
+
11
+ T = TypeVar("T", bound="TypedComfyWorkflowUpdate")
12
+
13
+
14
+ @attr.s(auto_attribs=True)
15
+ class TypedComfyWorkflowUpdate:
16
+ """
17
+ Attributes:
18
+ title (Union[Unset, str]):
19
+ workflow (Union[Unset, ComfyWorkflowSchema]):
20
+ is_public (Union[Unset, bool]):
21
+ name (Union[Unset, str]):
22
+ """
23
+
24
+ title: Union[Unset, str] = UNSET
25
+ workflow: Union[Unset, "ComfyWorkflowSchema"] = UNSET
26
+ is_public: Union[Unset, bool] = UNSET
27
+ name: Union[Unset, str] = UNSET
28
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> Dict[str, Any]:
31
+ title = self.title
32
+ workflow: Union[Unset, Dict[str, Any]] = UNSET
33
+ if not isinstance(self.workflow, Unset):
34
+ workflow = self.workflow.to_dict()
35
+
36
+ is_public = self.is_public
37
+ name = self.name
38
+
39
+ field_dict: Dict[str, Any] = {}
40
+ field_dict.update(self.additional_properties)
41
+ field_dict.update({})
42
+ if title is not UNSET:
43
+ field_dict["title"] = title
44
+ if workflow is not UNSET:
45
+ field_dict["workflow"] = workflow
46
+ if is_public is not UNSET:
47
+ field_dict["is_public"] = is_public
48
+ if name is not UNSET:
49
+ field_dict["name"] = name
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
55
+ from ..models.comfy_workflow_schema import ComfyWorkflowSchema
56
+
57
+ d = src_dict.copy()
58
+ title = d.pop("title", UNSET)
59
+
60
+ _workflow = d.pop("workflow", UNSET)
61
+ workflow: Union[Unset, ComfyWorkflowSchema]
62
+ if isinstance(_workflow, Unset):
63
+ workflow = UNSET
64
+ else:
65
+ workflow = ComfyWorkflowSchema.from_dict(_workflow)
66
+
67
+ is_public = d.pop("is_public", UNSET)
68
+
69
+ name = d.pop("name", UNSET)
70
+
71
+ typed_comfy_workflow_update = cls(
72
+ title=title,
73
+ workflow=workflow,
74
+ is_public=is_public,
75
+ name=name,
76
+ )
77
+
78
+ typed_comfy_workflow_update.additional_properties = d
79
+ return typed_comfy_workflow_update
80
+
81
+ @property
82
+ def additional_keys(self) -> List[str]:
83
+ return list(self.additional_properties.keys())
84
+
85
+ def __getitem__(self, key: str) -> Any:
86
+ return self.additional_properties[key]
87
+
88
+ def __setitem__(self, key: str, value: Any) -> None:
89
+ self.additional_properties[key] = value
90
+
91
+ def __delitem__(self, key: str) -> None:
92
+ del self.additional_properties[key]
93
+
94
+ def __contains__(self, key: str) -> bool:
95
+ return key in self.additional_properties
@@ -0,0 +1,95 @@
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.workflow_contents import WorkflowContents
9
+
10
+
11
+ T = TypeVar("T", bound="TypedWorkflowUpdate")
12
+
13
+
14
+ @attr.s(auto_attribs=True)
15
+ class TypedWorkflowUpdate:
16
+ """
17
+ Attributes:
18
+ name (Union[Unset, str]):
19
+ title (Union[Unset, str]):
20
+ contents (Union[Unset, WorkflowContents]):
21
+ is_public (Union[Unset, bool]):
22
+ """
23
+
24
+ name: Union[Unset, str] = UNSET
25
+ title: Union[Unset, str] = UNSET
26
+ contents: Union[Unset, "WorkflowContents"] = UNSET
27
+ is_public: Union[Unset, bool] = UNSET
28
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> Dict[str, Any]:
31
+ name = self.name
32
+ title = self.title
33
+ contents: Union[Unset, Dict[str, Any]] = UNSET
34
+ if not isinstance(self.contents, Unset):
35
+ contents = self.contents.to_dict()
36
+
37
+ is_public = self.is_public
38
+
39
+ field_dict: Dict[str, Any] = {}
40
+ field_dict.update(self.additional_properties)
41
+ field_dict.update({})
42
+ if name is not UNSET:
43
+ field_dict["name"] = name
44
+ if title is not UNSET:
45
+ field_dict["title"] = title
46
+ if contents is not UNSET:
47
+ field_dict["contents"] = contents
48
+ if is_public is not UNSET:
49
+ field_dict["is_public"] = is_public
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
55
+ from ..models.workflow_contents import WorkflowContents
56
+
57
+ d = src_dict.copy()
58
+ name = d.pop("name", UNSET)
59
+
60
+ title = d.pop("title", UNSET)
61
+
62
+ _contents = d.pop("contents", UNSET)
63
+ contents: Union[Unset, WorkflowContents]
64
+ if isinstance(_contents, Unset):
65
+ contents = UNSET
66
+ else:
67
+ contents = WorkflowContents.from_dict(_contents)
68
+
69
+ is_public = d.pop("is_public", UNSET)
70
+
71
+ typed_workflow_update = cls(
72
+ name=name,
73
+ title=title,
74
+ contents=contents,
75
+ is_public=is_public,
76
+ )
77
+
78
+ typed_workflow_update.additional_properties = d
79
+ return typed_workflow_update
80
+
81
+ @property
82
+ def additional_keys(self) -> List[str]:
83
+ return list(self.additional_properties.keys())
84
+
85
+ def __getitem__(self, key: str) -> Any:
86
+ return self.additional_properties[key]
87
+
88
+ def __setitem__(self, key: str, value: Any) -> None:
89
+ self.additional_properties[key] = value
90
+
91
+ def __delitem__(self, key: str) -> None:
92
+ del self.additional_properties[key]
93
+
94
+ def __contains__(self, key: str) -> bool:
95
+ return key in self.additional_properties