windmill-api 1.435.2__py3-none-any.whl → 1.437.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 windmill-api might be problematic. Click here for more details.

Files changed (40) hide show
  1. windmill_api/api/app/get_app_lite_by_path.py +166 -0
  2. windmill_api/models/completed_job_job_kind.py +2 -0
  3. windmill_api/models/delete_completed_job_response_200_job_kind.py +2 -0
  4. windmill_api/models/execute_component_json_body.py +16 -0
  5. windmill_api/models/extended_jobs_jobs_item_type_0_job_kind.py +2 -0
  6. windmill_api/models/extended_jobs_jobs_item_type_1_job_kind.py +2 -0
  7. windmill_api/models/get_app_lite_by_path_response_200.py +147 -0
  8. windmill_api/models/get_app_lite_by_path_response_200_execution_mode.py +10 -0
  9. windmill_api/models/get_app_lite_by_path_response_200_extra_perms.py +44 -0
  10. windmill_api/models/get_app_lite_by_path_response_200_policy.py +159 -0
  11. windmill_api/models/get_app_lite_by_path_response_200_policy_execution_mode.py +10 -0
  12. windmill_api/models/get_app_lite_by_path_response_200_policy_s3_inputs_item.py +44 -0
  13. windmill_api/models/get_app_lite_by_path_response_200_policy_triggerables.py +66 -0
  14. windmill_api/models/get_app_lite_by_path_response_200_policy_triggerables_additional_property.py +44 -0
  15. windmill_api/models/get_app_lite_by_path_response_200_policy_triggerables_v2.py +66 -0
  16. windmill_api/models/get_app_lite_by_path_response_200_policy_triggerables_v2_additional_property.py +44 -0
  17. windmill_api/models/get_app_lite_by_path_response_200_value.py +44 -0
  18. windmill_api/models/get_completed_job_response_200_job_kind.py +2 -0
  19. windmill_api/models/get_job_response_200_type_0_job_kind.py +2 -0
  20. windmill_api/models/get_job_response_200_type_1_job_kind.py +2 -0
  21. windmill_api/models/get_suspended_job_flow_response_200_job_type_0_job_kind.py +2 -0
  22. windmill_api/models/get_suspended_job_flow_response_200_job_type_1_job_kind.py +2 -0
  23. windmill_api/models/get_user_response_200.py +8 -0
  24. windmill_api/models/job_type_0_job_kind.py +2 -0
  25. windmill_api/models/job_type_1_job_kind.py +2 -0
  26. windmill_api/models/list_completed_jobs_response_200_item_job_kind.py +2 -0
  27. windmill_api/models/list_extended_jobs_response_200_jobs_item_type_0_job_kind.py +2 -0
  28. windmill_api/models/list_extended_jobs_response_200_jobs_item_type_1_job_kind.py +2 -0
  29. windmill_api/models/list_jobs_response_200_item_type_0_job_kind.py +2 -0
  30. windmill_api/models/list_jobs_response_200_item_type_1_job_kind.py +2 -0
  31. windmill_api/models/list_queue_response_200_item_job_kind.py +2 -0
  32. windmill_api/models/list_users_response_200_item.py +8 -0
  33. windmill_api/models/queued_job_job_kind.py +2 -0
  34. windmill_api/models/user.py +8 -0
  35. windmill_api/models/whoami_response_200.py +8 -0
  36. windmill_api/models/whois_response_200.py +8 -0
  37. {windmill_api-1.435.2.dist-info → windmill_api-1.437.0.dist-info}/METADATA +1 -1
  38. {windmill_api-1.435.2.dist-info → windmill_api-1.437.0.dist-info}/RECORD +40 -28
  39. {windmill_api-1.435.2.dist-info → windmill_api-1.437.0.dist-info}/LICENSE +0 -0
  40. {windmill_api-1.435.2.dist-info → windmill_api-1.437.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.get_app_lite_by_path_response_200 import GetAppLiteByPathResponse200
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ path: str,
15
+ ) -> Dict[str, Any]:
16
+ pass
17
+
18
+ return {
19
+ "method": "get",
20
+ "url": "/w/{workspace}/apps/get/lite/{path}".format(
21
+ workspace=workspace,
22
+ path=path,
23
+ ),
24
+ }
25
+
26
+
27
+ def _parse_response(
28
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
29
+ ) -> Optional[GetAppLiteByPathResponse200]:
30
+ if response.status_code == HTTPStatus.OK:
31
+ response_200 = GetAppLiteByPathResponse200.from_dict(response.json())
32
+
33
+ return response_200
34
+ if client.raise_on_unexpected_status:
35
+ raise errors.UnexpectedStatus(response.status_code, response.content)
36
+ else:
37
+ return None
38
+
39
+
40
+ def _build_response(
41
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
42
+ ) -> Response[GetAppLiteByPathResponse200]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(client=client, response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ workspace: str,
53
+ path: str,
54
+ *,
55
+ client: Union[AuthenticatedClient, Client],
56
+ ) -> Response[GetAppLiteByPathResponse200]:
57
+ """get app lite by path
58
+
59
+ Args:
60
+ workspace (str):
61
+ path (str):
62
+
63
+ Raises:
64
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
66
+
67
+ Returns:
68
+ Response[GetAppLiteByPathResponse200]
69
+ """
70
+
71
+ kwargs = _get_kwargs(
72
+ workspace=workspace,
73
+ path=path,
74
+ )
75
+
76
+ response = client.get_httpx_client().request(
77
+ **kwargs,
78
+ )
79
+
80
+ return _build_response(client=client, response=response)
81
+
82
+
83
+ def sync(
84
+ workspace: str,
85
+ path: str,
86
+ *,
87
+ client: Union[AuthenticatedClient, Client],
88
+ ) -> Optional[GetAppLiteByPathResponse200]:
89
+ """get app lite by path
90
+
91
+ Args:
92
+ workspace (str):
93
+ path (str):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ GetAppLiteByPathResponse200
101
+ """
102
+
103
+ return sync_detailed(
104
+ workspace=workspace,
105
+ path=path,
106
+ client=client,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ workspace: str,
112
+ path: str,
113
+ *,
114
+ client: Union[AuthenticatedClient, Client],
115
+ ) -> Response[GetAppLiteByPathResponse200]:
116
+ """get app lite by path
117
+
118
+ Args:
119
+ workspace (str):
120
+ path (str):
121
+
122
+ Raises:
123
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
125
+
126
+ Returns:
127
+ Response[GetAppLiteByPathResponse200]
128
+ """
129
+
130
+ kwargs = _get_kwargs(
131
+ workspace=workspace,
132
+ path=path,
133
+ )
134
+
135
+ response = await client.get_async_httpx_client().request(**kwargs)
136
+
137
+ return _build_response(client=client, response=response)
138
+
139
+
140
+ async def asyncio(
141
+ workspace: str,
142
+ path: str,
143
+ *,
144
+ client: Union[AuthenticatedClient, Client],
145
+ ) -> Optional[GetAppLiteByPathResponse200]:
146
+ """get app lite by path
147
+
148
+ Args:
149
+ workspace (str):
150
+ path (str):
151
+
152
+ Raises:
153
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
154
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
155
+
156
+ Returns:
157
+ GetAppLiteByPathResponse200
158
+ """
159
+
160
+ return (
161
+ await asyncio_detailed(
162
+ workspace=workspace,
163
+ path=path,
164
+ client=client,
165
+ )
166
+ ).parsed
@@ -3,10 +3,12 @@ from enum import Enum
3
3
 
4
4
  class CompletedJobJobKind(str, Enum):
5
5
  APPDEPENDENCIES = "appdependencies"
6
+ APPSCRIPT = "appscript"
6
7
  DEPENDENCIES = "dependencies"
7
8
  DEPLOYMENTCALLBACK = "deploymentcallback"
8
9
  FLOW = "flow"
9
10
  FLOWDEPENDENCIES = "flowdependencies"
11
+ FLOWNODE = "flownode"
10
12
  FLOWPREVIEW = "flowpreview"
11
13
  FLOWSCRIPT = "flowscript"
12
14
  IDENTITY = "identity"
@@ -3,10 +3,12 @@ from enum import Enum
3
3
 
4
4
  class DeleteCompletedJobResponse200JobKind(str, Enum):
5
5
  APPDEPENDENCIES = "appdependencies"
6
+ APPSCRIPT = "appscript"
6
7
  DEPENDENCIES = "dependencies"
7
8
  DEPLOYMENTCALLBACK = "deploymentcallback"
8
9
  FLOW = "flow"
9
10
  FLOWDEPENDENCIES = "flowdependencies"
11
+ FLOWNODE = "flownode"
10
12
  FLOWPREVIEW = "flowpreview"
11
13
  FLOWSCRIPT = "flowscript"
12
14
  IDENTITY = "identity"
@@ -25,7 +25,9 @@ class ExecuteComponentJsonBody:
25
25
  component (str):
26
26
  args (Any):
27
27
  path (Union[Unset, str]):
28
+ version (Union[Unset, int]):
28
29
  raw_code (Union[Unset, ExecuteComponentJsonBodyRawCode]):
30
+ id (Union[Unset, int]):
29
31
  force_viewer_static_fields (Union[Unset, ExecuteComponentJsonBodyForceViewerStaticFields]):
30
32
  force_viewer_one_of_fields (Union[Unset, ExecuteComponentJsonBodyForceViewerOneOfFields]):
31
33
  force_viewer_allow_user_resources (Union[Unset, List[str]]):
@@ -34,7 +36,9 @@ class ExecuteComponentJsonBody:
34
36
  component: str
35
37
  args: Any
36
38
  path: Union[Unset, str] = UNSET
39
+ version: Union[Unset, int] = UNSET
37
40
  raw_code: Union[Unset, "ExecuteComponentJsonBodyRawCode"] = UNSET
41
+ id: Union[Unset, int] = UNSET
38
42
  force_viewer_static_fields: Union[Unset, "ExecuteComponentJsonBodyForceViewerStaticFields"] = UNSET
39
43
  force_viewer_one_of_fields: Union[Unset, "ExecuteComponentJsonBodyForceViewerOneOfFields"] = UNSET
40
44
  force_viewer_allow_user_resources: Union[Unset, List[str]] = UNSET
@@ -44,10 +48,12 @@ class ExecuteComponentJsonBody:
44
48
  component = self.component
45
49
  args = self.args
46
50
  path = self.path
51
+ version = self.version
47
52
  raw_code: Union[Unset, Dict[str, Any]] = UNSET
48
53
  if not isinstance(self.raw_code, Unset):
49
54
  raw_code = self.raw_code.to_dict()
50
55
 
56
+ id = self.id
51
57
  force_viewer_static_fields: Union[Unset, Dict[str, Any]] = UNSET
52
58
  if not isinstance(self.force_viewer_static_fields, Unset):
53
59
  force_viewer_static_fields = self.force_viewer_static_fields.to_dict()
@@ -70,8 +76,12 @@ class ExecuteComponentJsonBody:
70
76
  )
71
77
  if path is not UNSET:
72
78
  field_dict["path"] = path
79
+ if version is not UNSET:
80
+ field_dict["version"] = version
73
81
  if raw_code is not UNSET:
74
82
  field_dict["raw_code"] = raw_code
83
+ if id is not UNSET:
84
+ field_dict["id"] = id
75
85
  if force_viewer_static_fields is not UNSET:
76
86
  field_dict["force_viewer_static_fields"] = force_viewer_static_fields
77
87
  if force_viewer_one_of_fields is not UNSET:
@@ -98,6 +108,8 @@ class ExecuteComponentJsonBody:
98
108
 
99
109
  path = d.pop("path", UNSET)
100
110
 
111
+ version = d.pop("version", UNSET)
112
+
101
113
  _raw_code = d.pop("raw_code", UNSET)
102
114
  raw_code: Union[Unset, ExecuteComponentJsonBodyRawCode]
103
115
  if isinstance(_raw_code, Unset):
@@ -105,6 +117,8 @@ class ExecuteComponentJsonBody:
105
117
  else:
106
118
  raw_code = ExecuteComponentJsonBodyRawCode.from_dict(_raw_code)
107
119
 
120
+ id = d.pop("id", UNSET)
121
+
108
122
  _force_viewer_static_fields = d.pop("force_viewer_static_fields", UNSET)
109
123
  force_viewer_static_fields: Union[Unset, ExecuteComponentJsonBodyForceViewerStaticFields]
110
124
  if isinstance(_force_viewer_static_fields, Unset):
@@ -129,7 +143,9 @@ class ExecuteComponentJsonBody:
129
143
  component=component,
130
144
  args=args,
131
145
  path=path,
146
+ version=version,
132
147
  raw_code=raw_code,
148
+ id=id,
133
149
  force_viewer_static_fields=force_viewer_static_fields,
134
150
  force_viewer_one_of_fields=force_viewer_one_of_fields,
135
151
  force_viewer_allow_user_resources=force_viewer_allow_user_resources,
@@ -3,10 +3,12 @@ from enum import Enum
3
3
 
4
4
  class ExtendedJobsJobsItemType0JobKind(str, Enum):
5
5
  APPDEPENDENCIES = "appdependencies"
6
+ APPSCRIPT = "appscript"
6
7
  DEPENDENCIES = "dependencies"
7
8
  DEPLOYMENTCALLBACK = "deploymentcallback"
8
9
  FLOW = "flow"
9
10
  FLOWDEPENDENCIES = "flowdependencies"
11
+ FLOWNODE = "flownode"
10
12
  FLOWPREVIEW = "flowpreview"
11
13
  FLOWSCRIPT = "flowscript"
12
14
  IDENTITY = "identity"
@@ -3,10 +3,12 @@ from enum import Enum
3
3
 
4
4
  class ExtendedJobsJobsItemType1JobKind(str, Enum):
5
5
  APPDEPENDENCIES = "appdependencies"
6
+ APPSCRIPT = "appscript"
6
7
  DEPENDENCIES = "dependencies"
7
8
  DEPLOYMENTCALLBACK = "deploymentcallback"
8
9
  FLOW = "flow"
9
10
  FLOWDEPENDENCIES = "flowdependencies"
11
+ FLOWNODE = "flownode"
10
12
  FLOWPREVIEW = "flowpreview"
11
13
  FLOWSCRIPT = "flowscript"
12
14
  IDENTITY = "identity"
@@ -0,0 +1,147 @@
1
+ import datetime
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+ from dateutil.parser import isoparse
7
+
8
+ from ..models.get_app_lite_by_path_response_200_execution_mode import GetAppLiteByPathResponse200ExecutionMode
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.get_app_lite_by_path_response_200_extra_perms import GetAppLiteByPathResponse200ExtraPerms
12
+ from ..models.get_app_lite_by_path_response_200_policy import GetAppLiteByPathResponse200Policy
13
+ from ..models.get_app_lite_by_path_response_200_value import GetAppLiteByPathResponse200Value
14
+
15
+
16
+ T = TypeVar("T", bound="GetAppLiteByPathResponse200")
17
+
18
+
19
+ @_attrs_define
20
+ class GetAppLiteByPathResponse200:
21
+ """
22
+ Attributes:
23
+ id (int):
24
+ workspace_id (str):
25
+ path (str):
26
+ summary (str):
27
+ versions (List[int]):
28
+ created_by (str):
29
+ created_at (datetime.datetime):
30
+ value (GetAppLiteByPathResponse200Value):
31
+ policy (GetAppLiteByPathResponse200Policy):
32
+ execution_mode (GetAppLiteByPathResponse200ExecutionMode):
33
+ extra_perms (GetAppLiteByPathResponse200ExtraPerms):
34
+ """
35
+
36
+ id: int
37
+ workspace_id: str
38
+ path: str
39
+ summary: str
40
+ versions: List[int]
41
+ created_by: str
42
+ created_at: datetime.datetime
43
+ value: "GetAppLiteByPathResponse200Value"
44
+ policy: "GetAppLiteByPathResponse200Policy"
45
+ execution_mode: GetAppLiteByPathResponse200ExecutionMode
46
+ extra_perms: "GetAppLiteByPathResponse200ExtraPerms"
47
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
48
+
49
+ def to_dict(self) -> Dict[str, Any]:
50
+ id = self.id
51
+ workspace_id = self.workspace_id
52
+ path = self.path
53
+ summary = self.summary
54
+ versions = self.versions
55
+
56
+ created_by = self.created_by
57
+ created_at = self.created_at.isoformat()
58
+
59
+ value = self.value.to_dict()
60
+
61
+ policy = self.policy.to_dict()
62
+
63
+ execution_mode = self.execution_mode.value
64
+
65
+ extra_perms = self.extra_perms.to_dict()
66
+
67
+ field_dict: Dict[str, Any] = {}
68
+ field_dict.update(self.additional_properties)
69
+ field_dict.update(
70
+ {
71
+ "id": id,
72
+ "workspace_id": workspace_id,
73
+ "path": path,
74
+ "summary": summary,
75
+ "versions": versions,
76
+ "created_by": created_by,
77
+ "created_at": created_at,
78
+ "value": value,
79
+ "policy": policy,
80
+ "execution_mode": execution_mode,
81
+ "extra_perms": extra_perms,
82
+ }
83
+ )
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
89
+ from ..models.get_app_lite_by_path_response_200_extra_perms import GetAppLiteByPathResponse200ExtraPerms
90
+ from ..models.get_app_lite_by_path_response_200_policy import GetAppLiteByPathResponse200Policy
91
+ from ..models.get_app_lite_by_path_response_200_value import GetAppLiteByPathResponse200Value
92
+
93
+ d = src_dict.copy()
94
+ id = d.pop("id")
95
+
96
+ workspace_id = d.pop("workspace_id")
97
+
98
+ path = d.pop("path")
99
+
100
+ summary = d.pop("summary")
101
+
102
+ versions = cast(List[int], d.pop("versions"))
103
+
104
+ created_by = d.pop("created_by")
105
+
106
+ created_at = isoparse(d.pop("created_at"))
107
+
108
+ value = GetAppLiteByPathResponse200Value.from_dict(d.pop("value"))
109
+
110
+ policy = GetAppLiteByPathResponse200Policy.from_dict(d.pop("policy"))
111
+
112
+ execution_mode = GetAppLiteByPathResponse200ExecutionMode(d.pop("execution_mode"))
113
+
114
+ extra_perms = GetAppLiteByPathResponse200ExtraPerms.from_dict(d.pop("extra_perms"))
115
+
116
+ get_app_lite_by_path_response_200 = cls(
117
+ id=id,
118
+ workspace_id=workspace_id,
119
+ path=path,
120
+ summary=summary,
121
+ versions=versions,
122
+ created_by=created_by,
123
+ created_at=created_at,
124
+ value=value,
125
+ policy=policy,
126
+ execution_mode=execution_mode,
127
+ extra_perms=extra_perms,
128
+ )
129
+
130
+ get_app_lite_by_path_response_200.additional_properties = d
131
+ return get_app_lite_by_path_response_200
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
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class GetAppLiteByPathResponse200ExecutionMode(str, Enum):
5
+ ANONYMOUS = "anonymous"
6
+ PUBLISHER = "publisher"
7
+ VIEWER = "viewer"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,44 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="GetAppLiteByPathResponse200ExtraPerms")
7
+
8
+
9
+ @_attrs_define
10
+ class GetAppLiteByPathResponse200ExtraPerms:
11
+ """ """
12
+
13
+ additional_properties: Dict[str, bool] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> Dict[str, Any]:
16
+ field_dict: Dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+ field_dict.update({})
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
24
+ d = src_dict.copy()
25
+ get_app_lite_by_path_response_200_extra_perms = cls()
26
+
27
+ get_app_lite_by_path_response_200_extra_perms.additional_properties = d
28
+ return get_app_lite_by_path_response_200_extra_perms
29
+
30
+ @property
31
+ def additional_keys(self) -> List[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> bool:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: bool) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -0,0 +1,159 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..models.get_app_lite_by_path_response_200_policy_execution_mode import (
7
+ GetAppLiteByPathResponse200PolicyExecutionMode,
8
+ )
9
+ from ..types import UNSET, Unset
10
+
11
+ if TYPE_CHECKING:
12
+ from ..models.get_app_lite_by_path_response_200_policy_s3_inputs_item import (
13
+ GetAppLiteByPathResponse200PolicyS3InputsItem,
14
+ )
15
+ from ..models.get_app_lite_by_path_response_200_policy_triggerables import (
16
+ GetAppLiteByPathResponse200PolicyTriggerables,
17
+ )
18
+ from ..models.get_app_lite_by_path_response_200_policy_triggerables_v2 import (
19
+ GetAppLiteByPathResponse200PolicyTriggerablesV2,
20
+ )
21
+
22
+
23
+ T = TypeVar("T", bound="GetAppLiteByPathResponse200Policy")
24
+
25
+
26
+ @_attrs_define
27
+ class GetAppLiteByPathResponse200Policy:
28
+ """
29
+ Attributes:
30
+ triggerables (Union[Unset, GetAppLiteByPathResponse200PolicyTriggerables]):
31
+ triggerables_v2 (Union[Unset, GetAppLiteByPathResponse200PolicyTriggerablesV2]):
32
+ s3_inputs (Union[Unset, List['GetAppLiteByPathResponse200PolicyS3InputsItem']]):
33
+ execution_mode (Union[Unset, GetAppLiteByPathResponse200PolicyExecutionMode]):
34
+ on_behalf_of (Union[Unset, str]):
35
+ on_behalf_of_email (Union[Unset, str]):
36
+ """
37
+
38
+ triggerables: Union[Unset, "GetAppLiteByPathResponse200PolicyTriggerables"] = UNSET
39
+ triggerables_v2: Union[Unset, "GetAppLiteByPathResponse200PolicyTriggerablesV2"] = UNSET
40
+ s3_inputs: Union[Unset, List["GetAppLiteByPathResponse200PolicyS3InputsItem"]] = UNSET
41
+ execution_mode: Union[Unset, GetAppLiteByPathResponse200PolicyExecutionMode] = UNSET
42
+ on_behalf_of: Union[Unset, str] = UNSET
43
+ on_behalf_of_email: Union[Unset, str] = UNSET
44
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
45
+
46
+ def to_dict(self) -> Dict[str, Any]:
47
+ triggerables: Union[Unset, Dict[str, Any]] = UNSET
48
+ if not isinstance(self.triggerables, Unset):
49
+ triggerables = self.triggerables.to_dict()
50
+
51
+ triggerables_v2: Union[Unset, Dict[str, Any]] = UNSET
52
+ if not isinstance(self.triggerables_v2, Unset):
53
+ triggerables_v2 = self.triggerables_v2.to_dict()
54
+
55
+ s3_inputs: Union[Unset, List[Dict[str, Any]]] = UNSET
56
+ if not isinstance(self.s3_inputs, Unset):
57
+ s3_inputs = []
58
+ for s3_inputs_item_data in self.s3_inputs:
59
+ s3_inputs_item = s3_inputs_item_data.to_dict()
60
+
61
+ s3_inputs.append(s3_inputs_item)
62
+
63
+ execution_mode: Union[Unset, str] = UNSET
64
+ if not isinstance(self.execution_mode, Unset):
65
+ execution_mode = self.execution_mode.value
66
+
67
+ on_behalf_of = self.on_behalf_of
68
+ on_behalf_of_email = self.on_behalf_of_email
69
+
70
+ field_dict: Dict[str, Any] = {}
71
+ field_dict.update(self.additional_properties)
72
+ field_dict.update({})
73
+ if triggerables is not UNSET:
74
+ field_dict["triggerables"] = triggerables
75
+ if triggerables_v2 is not UNSET:
76
+ field_dict["triggerables_v2"] = triggerables_v2
77
+ if s3_inputs is not UNSET:
78
+ field_dict["s3_inputs"] = s3_inputs
79
+ if execution_mode is not UNSET:
80
+ field_dict["execution_mode"] = execution_mode
81
+ if on_behalf_of is not UNSET:
82
+ field_dict["on_behalf_of"] = on_behalf_of
83
+ if on_behalf_of_email is not UNSET:
84
+ field_dict["on_behalf_of_email"] = on_behalf_of_email
85
+
86
+ return field_dict
87
+
88
+ @classmethod
89
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
90
+ from ..models.get_app_lite_by_path_response_200_policy_s3_inputs_item import (
91
+ GetAppLiteByPathResponse200PolicyS3InputsItem,
92
+ )
93
+ from ..models.get_app_lite_by_path_response_200_policy_triggerables import (
94
+ GetAppLiteByPathResponse200PolicyTriggerables,
95
+ )
96
+ from ..models.get_app_lite_by_path_response_200_policy_triggerables_v2 import (
97
+ GetAppLiteByPathResponse200PolicyTriggerablesV2,
98
+ )
99
+
100
+ d = src_dict.copy()
101
+ _triggerables = d.pop("triggerables", UNSET)
102
+ triggerables: Union[Unset, GetAppLiteByPathResponse200PolicyTriggerables]
103
+ if isinstance(_triggerables, Unset):
104
+ triggerables = UNSET
105
+ else:
106
+ triggerables = GetAppLiteByPathResponse200PolicyTriggerables.from_dict(_triggerables)
107
+
108
+ _triggerables_v2 = d.pop("triggerables_v2", UNSET)
109
+ triggerables_v2: Union[Unset, GetAppLiteByPathResponse200PolicyTriggerablesV2]
110
+ if isinstance(_triggerables_v2, Unset):
111
+ triggerables_v2 = UNSET
112
+ else:
113
+ triggerables_v2 = GetAppLiteByPathResponse200PolicyTriggerablesV2.from_dict(_triggerables_v2)
114
+
115
+ s3_inputs = []
116
+ _s3_inputs = d.pop("s3_inputs", UNSET)
117
+ for s3_inputs_item_data in _s3_inputs or []:
118
+ s3_inputs_item = GetAppLiteByPathResponse200PolicyS3InputsItem.from_dict(s3_inputs_item_data)
119
+
120
+ s3_inputs.append(s3_inputs_item)
121
+
122
+ _execution_mode = d.pop("execution_mode", UNSET)
123
+ execution_mode: Union[Unset, GetAppLiteByPathResponse200PolicyExecutionMode]
124
+ if isinstance(_execution_mode, Unset):
125
+ execution_mode = UNSET
126
+ else:
127
+ execution_mode = GetAppLiteByPathResponse200PolicyExecutionMode(_execution_mode)
128
+
129
+ on_behalf_of = d.pop("on_behalf_of", UNSET)
130
+
131
+ on_behalf_of_email = d.pop("on_behalf_of_email", UNSET)
132
+
133
+ get_app_lite_by_path_response_200_policy = cls(
134
+ triggerables=triggerables,
135
+ triggerables_v2=triggerables_v2,
136
+ s3_inputs=s3_inputs,
137
+ execution_mode=execution_mode,
138
+ on_behalf_of=on_behalf_of,
139
+ on_behalf_of_email=on_behalf_of_email,
140
+ )
141
+
142
+ get_app_lite_by_path_response_200_policy.additional_properties = d
143
+ return get_app_lite_by_path_response_200_policy
144
+
145
+ @property
146
+ def additional_keys(self) -> List[str]:
147
+ return list(self.additional_properties.keys())
148
+
149
+ def __getitem__(self, key: str) -> Any:
150
+ return self.additional_properties[key]
151
+
152
+ def __setitem__(self, key: str, value: Any) -> None:
153
+ self.additional_properties[key] = value
154
+
155
+ def __delitem__(self, key: str) -> None:
156
+ del self.additional_properties[key]
157
+
158
+ def __contains__(self, key: str) -> bool:
159
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class GetAppLiteByPathResponse200PolicyExecutionMode(str, Enum):
5
+ ANONYMOUS = "anonymous"
6
+ PUBLISHER = "publisher"
7
+ VIEWER = "viewer"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)