beamlit 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/create_agent.py +14 -9
- beamlit/api/agents/delete_agent_history.py +159 -0
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
- beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +185 -0
- beamlit/api/agents/update_agent.py +14 -9
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/create_function.py +14 -9
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/functions/update_function.py +14 -9
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/create_integration_connection.py +167 -0
- beamlit/api/integrations/delete_integration_connection.py +158 -0
- beamlit/api/integrations/get_integration.py +97 -0
- beamlit/api/integrations/get_integration_connection.py +154 -0
- beamlit/api/integrations/get_integration_connection_model.py +97 -0
- beamlit/api/integrations/get_integration_model.py +97 -0
- beamlit/api/integrations/list_integration_connection_models.py +97 -0
- beamlit/api/integrations/list_integration_connections.py +139 -0
- beamlit/api/integrations/list_integration_models.py +97 -0
- beamlit/api/integrations/update_integration_connection.py +180 -0
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +29 -8
- beamlit/authentication/apikey.py +8 -2
- beamlit/authentication/authentication.py +66 -3
- beamlit/authentication/clientcredentials.py +108 -0
- beamlit/authentication/credentials.py +22 -8
- beamlit/authentication/device_mode.py +23 -13
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +183 -0
- beamlit/common/logger.py +29 -0
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +156 -0
- beamlit/common/utils.py +15 -0
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/functions/github/__init__.py +3 -0
- beamlit/functions/github/github.py +21 -0
- beamlit/functions/github/kit/__init__.py +7 -0
- beamlit/functions/github/kit/pull_request.py +51 -0
- beamlit/functions/math/__init__.py +3 -0
- beamlit/functions/math/math.py +40 -0
- beamlit/functions/search/__init__.py +3 -0
- beamlit/functions/search/search.py +15 -0
- beamlit/models/__init__.py +24 -0
- beamlit/models/acl.py +4 -2
- beamlit/models/agent.py +5 -3
- beamlit/models/agent_chain.py +4 -2
- beamlit/models/agent_configuration.py +4 -2
- beamlit/models/agent_deployment.py +41 -28
- beamlit/models/agent_deployment_configuration.py +4 -2
- beamlit/models/agent_deployment_configuration_type_0.py +43 -0
- beamlit/models/agent_deployment_history.py +7 -5
- beamlit/models/agent_deployment_history_event.py +11 -9
- beamlit/models/agent_deployment_pod_template.py +4 -2
- beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +4 -2
- beamlit/models/agent_spec.py +248 -0
- beamlit/models/agent_with_deployments.py +176 -0
- beamlit/models/api_key.py +4 -2
- beamlit/models/authentication_provider_model.py +8 -6
- beamlit/models/authentication_provider_organization.py +4 -2
- beamlit/models/configuration.py +12 -10
- beamlit/models/continent.py +4 -2
- beamlit/models/core_spec.py +185 -0
- beamlit/models/country.py +4 -2
- beamlit/models/create_api_key_for_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_response_200.py +4 -2
- beamlit/models/delete_workspace_service_account_response_200.py +4 -2
- beamlit/models/deployment_configuration.py +4 -2
- beamlit/models/deployment_configurations.py +22 -7
- beamlit/models/deployment_serverless_config.py +4 -2
- beamlit/models/deployment_serverless_config_type_0.py +220 -0
- beamlit/models/environment.py +9 -7
- beamlit/models/environment_metrics.py +26 -5
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +11 -9
- beamlit/models/function.py +5 -3
- beamlit/models/function_configuration.py +4 -2
- beamlit/models/function_deployment.py +33 -20
- beamlit/models/function_deployment_configuration.py +4 -2
- beamlit/models/function_deployment_configuration_type_0.py +43 -0
- beamlit/models/function_deployment_pod_template.py +4 -2
- beamlit/models/function_deployment_pod_template_type_0.py +43 -0
- beamlit/models/function_kit.py +7 -5
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +4 -2
- beamlit/models/function_release.py +4 -2
- beamlit/models/function_spec.py +246 -0
- beamlit/models/function_with_deployments.py +176 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
- beamlit/models/increase_and_rate_metric.py +104 -0
- beamlit/models/integration.py +198 -0
- beamlit/models/integration_config.py +45 -0
- beamlit/models/integration_connection.py +198 -0
- beamlit/models/integration_connection_config.py +45 -0
- beamlit/models/integration_connection_secret.py +61 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +144 -0
- beamlit/models/integration_secret.py +61 -0
- beamlit/models/invite_workspace_user_body.py +4 -2
- beamlit/models/labels_type_0.py +4 -2
- beamlit/models/location.py +7 -5
- beamlit/models/location_response.py +7 -5
- beamlit/models/metadata.py +135 -0
- beamlit/models/{labels.py → metadata_labels.py} +5 -5
- beamlit/models/metric.py +4 -2
- beamlit/models/metrics.py +68 -25
- beamlit/models/model.py +5 -3
- beamlit/models/model_deployment.py +27 -14
- beamlit/models/model_deployment_log.py +4 -2
- beamlit/models/model_deployment_metrics.py +11 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/model_deployment_pod_template.py +4 -2
- beamlit/models/model_deployment_pod_template_type_0.py +43 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +8 -6
- beamlit/models/model_provider.py +13 -11
- beamlit/models/model_provider_ref.py +4 -2
- beamlit/models/model_release.py +4 -2
- beamlit/models/model_spec.py +194 -0
- beamlit/models/model_with_deployments.py +8 -6
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +4 -2
- beamlit/models/pending_invitation_accept.py +5 -3
- beamlit/models/pending_invitation_render.py +7 -5
- beamlit/models/pending_invitation_render_invited_by.py +4 -2
- beamlit/models/pending_invitation_render_workspace.py +4 -2
- beamlit/models/pending_invitation_workspace_details.py +8 -6
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +22 -20
- beamlit/models/policy_location.py +11 -9
- beamlit/models/policy_spec.py +125 -0
- beamlit/models/provider_config.py +9 -16
- beamlit/models/qps.py +4 -2
- beamlit/models/resource_deployment_log.py +4 -2
- beamlit/models/resource_deployment_metrics.py +119 -9
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_environment_metrics.py +210 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +44 -6
- beamlit/models/runtime.py +25 -23
- beamlit/models/runtime_readiness_probe.py +4 -2
- beamlit/models/runtime_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_resources.py +4 -2
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +4 -2
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +4 -2
- beamlit/models/store_agent.py +8 -6
- beamlit/models/store_agent_configuration.py +4 -2
- beamlit/models/store_agent_labels.py +4 -2
- beamlit/models/store_agent_labels_type_0.py +43 -0
- beamlit/models/store_configuration.py +18 -16
- beamlit/models/store_configuration_option.py +4 -2
- beamlit/models/store_function.py +14 -12
- beamlit/models/store_function_configuration.py +4 -2
- beamlit/models/store_function_kit.py +7 -5
- beamlit/models/store_function_labels.py +4 -2
- beamlit/models/store_function_labels_type_0.py +43 -0
- beamlit/models/store_function_parameter.py +11 -9
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +4 -2
- beamlit/models/update_workspace_service_account_response_200.py +4 -2
- beamlit/models/update_workspace_user_role_body.py +4 -2
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +5 -3
- beamlit/models/workspace_labels.py +4 -2
- beamlit/models/workspace_user.py +4 -2
- beamlit/run.py +49 -0
- beamlit/serve/app.py +78 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
- beamlit-0.0.20.dist-info/RECORD +301 -0
- beamlit-0.0.18.dist-info/RECORD +0 -211
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,198 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.integration_config import IntegrationConfig
|
10
|
+
from ..models.integration_secret import IntegrationSecret
|
11
|
+
from ..models.labels_type_0 import LabelsType0
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="Integration")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class Integration:
|
19
|
+
"""Model provider
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
23
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
24
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
25
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
26
|
+
config (Union[Unset, IntegrationConfig]): Integration config
|
27
|
+
display_name (Union[Unset, str]): Integration display name
|
28
|
+
labels (Union['LabelsType0', None, Unset]): Labels
|
29
|
+
name (Union[Unset, str]): Integration name
|
30
|
+
secret (Union[Unset, IntegrationSecret]): Integration secret
|
31
|
+
type_ (Union[Unset, str]): Integration type
|
32
|
+
workspace (Union[Unset, str]): Workspace name
|
33
|
+
"""
|
34
|
+
|
35
|
+
created_at: Union[Unset, str] = UNSET
|
36
|
+
created_by: Union[Unset, str] = UNSET
|
37
|
+
updated_at: Union[Unset, str] = UNSET
|
38
|
+
updated_by: Union[Unset, str] = UNSET
|
39
|
+
config: Union[Unset, "IntegrationConfig"] = UNSET
|
40
|
+
display_name: Union[Unset, str] = UNSET
|
41
|
+
labels: Union["LabelsType0", None, Unset] = UNSET
|
42
|
+
name: Union[Unset, str] = UNSET
|
43
|
+
secret: Union[Unset, "IntegrationSecret"] = UNSET
|
44
|
+
type_: Union[Unset, str] = UNSET
|
45
|
+
workspace: Union[Unset, str] = UNSET
|
46
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
47
|
+
|
48
|
+
def to_dict(self) -> dict[str, Any]:
|
49
|
+
from ..models.labels_type_0 import LabelsType0
|
50
|
+
|
51
|
+
created_at = self.created_at
|
52
|
+
|
53
|
+
created_by = self.created_by
|
54
|
+
|
55
|
+
updated_at = self.updated_at
|
56
|
+
|
57
|
+
updated_by = self.updated_by
|
58
|
+
|
59
|
+
config: Union[Unset, dict[str, Any]] = UNSET
|
60
|
+
if not isinstance(self.config, Unset):
|
61
|
+
config = self.config.to_dict()
|
62
|
+
|
63
|
+
display_name = self.display_name
|
64
|
+
|
65
|
+
labels: Union[None, Unset, dict[str, Any]]
|
66
|
+
if isinstance(self.labels, Unset):
|
67
|
+
labels = UNSET
|
68
|
+
elif isinstance(self.labels, LabelsType0):
|
69
|
+
labels = self.labels.to_dict()
|
70
|
+
else:
|
71
|
+
labels = self.labels
|
72
|
+
|
73
|
+
name = self.name
|
74
|
+
|
75
|
+
secret: Union[Unset, dict[str, Any]] = UNSET
|
76
|
+
if not isinstance(self.secret, Unset):
|
77
|
+
secret = self.secret.to_dict()
|
78
|
+
|
79
|
+
type_ = self.type_
|
80
|
+
|
81
|
+
workspace = self.workspace
|
82
|
+
|
83
|
+
field_dict: dict[str, Any] = {}
|
84
|
+
field_dict.update(self.additional_properties)
|
85
|
+
field_dict.update({})
|
86
|
+
if created_at is not UNSET:
|
87
|
+
field_dict["created_at"] = created_at
|
88
|
+
if created_by is not UNSET:
|
89
|
+
field_dict["created_by"] = created_by
|
90
|
+
if updated_at is not UNSET:
|
91
|
+
field_dict["updated_at"] = updated_at
|
92
|
+
if updated_by is not UNSET:
|
93
|
+
field_dict["updated_by"] = updated_by
|
94
|
+
if config is not UNSET:
|
95
|
+
field_dict["config"] = config
|
96
|
+
if display_name is not UNSET:
|
97
|
+
field_dict["display_name"] = display_name
|
98
|
+
if labels is not UNSET:
|
99
|
+
field_dict["labels"] = labels
|
100
|
+
if name is not UNSET:
|
101
|
+
field_dict["name"] = name
|
102
|
+
if secret is not UNSET:
|
103
|
+
field_dict["secret"] = secret
|
104
|
+
if type_ is not UNSET:
|
105
|
+
field_dict["type"] = type_
|
106
|
+
if workspace is not UNSET:
|
107
|
+
field_dict["workspace"] = workspace
|
108
|
+
|
109
|
+
return field_dict
|
110
|
+
|
111
|
+
@classmethod
|
112
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
113
|
+
from ..models.integration_config import IntegrationConfig
|
114
|
+
from ..models.integration_secret import IntegrationSecret
|
115
|
+
from ..models.labels_type_0 import LabelsType0
|
116
|
+
|
117
|
+
if not src_dict:
|
118
|
+
return None
|
119
|
+
d = src_dict.copy()
|
120
|
+
created_at = d.pop("created_at", UNSET)
|
121
|
+
|
122
|
+
created_by = d.pop("created_by", UNSET)
|
123
|
+
|
124
|
+
updated_at = d.pop("updated_at", UNSET)
|
125
|
+
|
126
|
+
updated_by = d.pop("updated_by", UNSET)
|
127
|
+
|
128
|
+
_config = d.pop("config", UNSET)
|
129
|
+
config: Union[Unset, IntegrationConfig]
|
130
|
+
if isinstance(_config, Unset):
|
131
|
+
config = UNSET
|
132
|
+
else:
|
133
|
+
config = IntegrationConfig.from_dict(_config)
|
134
|
+
|
135
|
+
display_name = d.pop("display_name", UNSET)
|
136
|
+
|
137
|
+
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
138
|
+
if data is None:
|
139
|
+
return data
|
140
|
+
if isinstance(data, Unset):
|
141
|
+
return data
|
142
|
+
try:
|
143
|
+
if not isinstance(data, dict):
|
144
|
+
raise TypeError()
|
145
|
+
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
146
|
+
|
147
|
+
return componentsschemas_labels_type_0
|
148
|
+
except: # noqa: E722
|
149
|
+
pass
|
150
|
+
return cast(Union["LabelsType0", None, Unset], data)
|
151
|
+
|
152
|
+
labels = _parse_labels(d.pop("labels", UNSET))
|
153
|
+
|
154
|
+
name = d.pop("name", UNSET)
|
155
|
+
|
156
|
+
_secret = d.pop("secret", UNSET)
|
157
|
+
secret: Union[Unset, IntegrationSecret]
|
158
|
+
if isinstance(_secret, Unset):
|
159
|
+
secret = UNSET
|
160
|
+
else:
|
161
|
+
secret = IntegrationSecret.from_dict(_secret)
|
162
|
+
|
163
|
+
type_ = d.pop("type", UNSET)
|
164
|
+
|
165
|
+
workspace = d.pop("workspace", UNSET)
|
166
|
+
|
167
|
+
integration = cls(
|
168
|
+
created_at=created_at,
|
169
|
+
created_by=created_by,
|
170
|
+
updated_at=updated_at,
|
171
|
+
updated_by=updated_by,
|
172
|
+
config=config,
|
173
|
+
display_name=display_name,
|
174
|
+
labels=labels,
|
175
|
+
name=name,
|
176
|
+
secret=secret,
|
177
|
+
type_=type_,
|
178
|
+
workspace=workspace,
|
179
|
+
)
|
180
|
+
|
181
|
+
integration.additional_properties = d
|
182
|
+
return integration
|
183
|
+
|
184
|
+
@property
|
185
|
+
def additional_keys(self) -> list[str]:
|
186
|
+
return list(self.additional_properties.keys())
|
187
|
+
|
188
|
+
def __getitem__(self, key: str) -> Any:
|
189
|
+
return self.additional_properties[key]
|
190
|
+
|
191
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
192
|
+
self.additional_properties[key] = value
|
193
|
+
|
194
|
+
def __delitem__(self, key: str) -> None:
|
195
|
+
del self.additional_properties[key]
|
196
|
+
|
197
|
+
def __contains__(self, key: str) -> bool:
|
198
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="IntegrationConfig")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class IntegrationConfig:
|
11
|
+
"""Integration config"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _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
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
integration_config = cls()
|
27
|
+
|
28
|
+
integration_config.additional_properties = d
|
29
|
+
return integration_config
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,198 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.integration_connection_config import IntegrationConnectionConfig
|
10
|
+
from ..models.integration_connection_secret import IntegrationConnectionSecret
|
11
|
+
from ..models.labels_type_0 import LabelsType0
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="IntegrationConnection")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class IntegrationConnection:
|
19
|
+
"""Integration Connection
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
23
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
24
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
25
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
26
|
+
config (Union[Unset, IntegrationConnectionConfig]): Integration config
|
27
|
+
display_name (Union[Unset, str]): Integration connection display name
|
28
|
+
integration (Union[Unset, str]): Integration type
|
29
|
+
labels (Union['LabelsType0', None, Unset]): Labels
|
30
|
+
name (Union[Unset, str]): Integration connection name
|
31
|
+
secret (Union[Unset, IntegrationConnectionSecret]): Integration secret
|
32
|
+
workspace (Union[Unset, str]): Workspace name
|
33
|
+
"""
|
34
|
+
|
35
|
+
created_at: Union[Unset, str] = UNSET
|
36
|
+
created_by: Union[Unset, str] = UNSET
|
37
|
+
updated_at: Union[Unset, str] = UNSET
|
38
|
+
updated_by: Union[Unset, str] = UNSET
|
39
|
+
config: Union[Unset, "IntegrationConnectionConfig"] = UNSET
|
40
|
+
display_name: Union[Unset, str] = UNSET
|
41
|
+
integration: Union[Unset, str] = UNSET
|
42
|
+
labels: Union["LabelsType0", None, Unset] = UNSET
|
43
|
+
name: Union[Unset, str] = UNSET
|
44
|
+
secret: Union[Unset, "IntegrationConnectionSecret"] = UNSET
|
45
|
+
workspace: Union[Unset, str] = UNSET
|
46
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
47
|
+
|
48
|
+
def to_dict(self) -> dict[str, Any]:
|
49
|
+
from ..models.labels_type_0 import LabelsType0
|
50
|
+
|
51
|
+
created_at = self.created_at
|
52
|
+
|
53
|
+
created_by = self.created_by
|
54
|
+
|
55
|
+
updated_at = self.updated_at
|
56
|
+
|
57
|
+
updated_by = self.updated_by
|
58
|
+
|
59
|
+
config: Union[Unset, dict[str, Any]] = UNSET
|
60
|
+
if not isinstance(self.config, Unset):
|
61
|
+
config = self.config.to_dict()
|
62
|
+
|
63
|
+
display_name = self.display_name
|
64
|
+
|
65
|
+
integration = self.integration
|
66
|
+
|
67
|
+
labels: Union[None, Unset, dict[str, Any]]
|
68
|
+
if isinstance(self.labels, Unset):
|
69
|
+
labels = UNSET
|
70
|
+
elif isinstance(self.labels, LabelsType0):
|
71
|
+
labels = self.labels.to_dict()
|
72
|
+
else:
|
73
|
+
labels = self.labels
|
74
|
+
|
75
|
+
name = self.name
|
76
|
+
|
77
|
+
secret: Union[Unset, dict[str, Any]] = UNSET
|
78
|
+
if not isinstance(self.secret, Unset):
|
79
|
+
secret = self.secret.to_dict()
|
80
|
+
|
81
|
+
workspace = self.workspace
|
82
|
+
|
83
|
+
field_dict: dict[str, Any] = {}
|
84
|
+
field_dict.update(self.additional_properties)
|
85
|
+
field_dict.update({})
|
86
|
+
if created_at is not UNSET:
|
87
|
+
field_dict["created_at"] = created_at
|
88
|
+
if created_by is not UNSET:
|
89
|
+
field_dict["created_by"] = created_by
|
90
|
+
if updated_at is not UNSET:
|
91
|
+
field_dict["updated_at"] = updated_at
|
92
|
+
if updated_by is not UNSET:
|
93
|
+
field_dict["updated_by"] = updated_by
|
94
|
+
if config is not UNSET:
|
95
|
+
field_dict["config"] = config
|
96
|
+
if display_name is not UNSET:
|
97
|
+
field_dict["display_name"] = display_name
|
98
|
+
if integration is not UNSET:
|
99
|
+
field_dict["integration"] = integration
|
100
|
+
if labels is not UNSET:
|
101
|
+
field_dict["labels"] = labels
|
102
|
+
if name is not UNSET:
|
103
|
+
field_dict["name"] = name
|
104
|
+
if secret is not UNSET:
|
105
|
+
field_dict["secret"] = secret
|
106
|
+
if workspace is not UNSET:
|
107
|
+
field_dict["workspace"] = workspace
|
108
|
+
|
109
|
+
return field_dict
|
110
|
+
|
111
|
+
@classmethod
|
112
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
113
|
+
from ..models.integration_connection_config import IntegrationConnectionConfig
|
114
|
+
from ..models.integration_connection_secret import IntegrationConnectionSecret
|
115
|
+
from ..models.labels_type_0 import LabelsType0
|
116
|
+
|
117
|
+
if not src_dict:
|
118
|
+
return None
|
119
|
+
d = src_dict.copy()
|
120
|
+
created_at = d.pop("created_at", UNSET)
|
121
|
+
|
122
|
+
created_by = d.pop("created_by", UNSET)
|
123
|
+
|
124
|
+
updated_at = d.pop("updated_at", UNSET)
|
125
|
+
|
126
|
+
updated_by = d.pop("updated_by", UNSET)
|
127
|
+
|
128
|
+
_config = d.pop("config", UNSET)
|
129
|
+
config: Union[Unset, IntegrationConnectionConfig]
|
130
|
+
if isinstance(_config, Unset):
|
131
|
+
config = UNSET
|
132
|
+
else:
|
133
|
+
config = IntegrationConnectionConfig.from_dict(_config)
|
134
|
+
|
135
|
+
display_name = d.pop("display_name", UNSET)
|
136
|
+
|
137
|
+
integration = d.pop("integration", UNSET)
|
138
|
+
|
139
|
+
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
140
|
+
if data is None:
|
141
|
+
return data
|
142
|
+
if isinstance(data, Unset):
|
143
|
+
return data
|
144
|
+
try:
|
145
|
+
if not isinstance(data, dict):
|
146
|
+
raise TypeError()
|
147
|
+
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
148
|
+
|
149
|
+
return componentsschemas_labels_type_0
|
150
|
+
except: # noqa: E722
|
151
|
+
pass
|
152
|
+
return cast(Union["LabelsType0", None, Unset], data)
|
153
|
+
|
154
|
+
labels = _parse_labels(d.pop("labels", UNSET))
|
155
|
+
|
156
|
+
name = d.pop("name", UNSET)
|
157
|
+
|
158
|
+
_secret = d.pop("secret", UNSET)
|
159
|
+
secret: Union[Unset, IntegrationConnectionSecret]
|
160
|
+
if isinstance(_secret, Unset):
|
161
|
+
secret = UNSET
|
162
|
+
else:
|
163
|
+
secret = IntegrationConnectionSecret.from_dict(_secret)
|
164
|
+
|
165
|
+
workspace = d.pop("workspace", UNSET)
|
166
|
+
|
167
|
+
integration_connection = cls(
|
168
|
+
created_at=created_at,
|
169
|
+
created_by=created_by,
|
170
|
+
updated_at=updated_at,
|
171
|
+
updated_by=updated_by,
|
172
|
+
config=config,
|
173
|
+
display_name=display_name,
|
174
|
+
integration=integration,
|
175
|
+
labels=labels,
|
176
|
+
name=name,
|
177
|
+
secret=secret,
|
178
|
+
workspace=workspace,
|
179
|
+
)
|
180
|
+
|
181
|
+
integration_connection.additional_properties = d
|
182
|
+
return integration_connection
|
183
|
+
|
184
|
+
@property
|
185
|
+
def additional_keys(self) -> list[str]:
|
186
|
+
return list(self.additional_properties.keys())
|
187
|
+
|
188
|
+
def __getitem__(self, key: str) -> Any:
|
189
|
+
return self.additional_properties[key]
|
190
|
+
|
191
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
192
|
+
self.additional_properties[key] = value
|
193
|
+
|
194
|
+
def __delitem__(self, key: str) -> None:
|
195
|
+
del self.additional_properties[key]
|
196
|
+
|
197
|
+
def __contains__(self, key: str) -> bool:
|
198
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="IntegrationConnectionConfig")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class IntegrationConnectionConfig:
|
11
|
+
"""Integration config"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _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
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
integration_connection_config = cls()
|
27
|
+
|
28
|
+
integration_connection_config.additional_properties = d
|
29
|
+
return integration_connection_config
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,61 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="IntegrationConnectionSecret")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class IntegrationConnectionSecret:
|
13
|
+
"""Integration secret
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
api_key (Union[Unset, str]): The API key to use for the integration
|
17
|
+
"""
|
18
|
+
|
19
|
+
api_key: Union[Unset, str] = UNSET
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
api_key = self.api_key
|
24
|
+
|
25
|
+
field_dict: dict[str, Any] = {}
|
26
|
+
field_dict.update(self.additional_properties)
|
27
|
+
field_dict.update({})
|
28
|
+
if api_key is not UNSET:
|
29
|
+
field_dict["api_key"] = api_key
|
30
|
+
|
31
|
+
return field_dict
|
32
|
+
|
33
|
+
@classmethod
|
34
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
35
|
+
if not src_dict:
|
36
|
+
return None
|
37
|
+
d = src_dict.copy()
|
38
|
+
api_key = d.pop("api_key", UNSET)
|
39
|
+
|
40
|
+
integration_connection_secret = cls(
|
41
|
+
api_key=api_key,
|
42
|
+
)
|
43
|
+
|
44
|
+
integration_connection_secret.additional_properties = d
|
45
|
+
return integration_connection_secret
|
46
|
+
|
47
|
+
@property
|
48
|
+
def additional_keys(self) -> list[str]:
|
49
|
+
return list(self.additional_properties.keys())
|
50
|
+
|
51
|
+
def __getitem__(self, key: str) -> Any:
|
52
|
+
return self.additional_properties[key]
|
53
|
+
|
54
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
55
|
+
self.additional_properties[key] = value
|
56
|
+
|
57
|
+
def __delitem__(self, key: str) -> None:
|
58
|
+
del self.additional_properties[key]
|
59
|
+
|
60
|
+
def __contains__(self, key: str) -> bool:
|
61
|
+
return key in self.additional_properties
|
@@ -0,0 +1,99 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.integration_connection_config import IntegrationConnectionConfig
|
10
|
+
from ..models.integration_connection_secret import IntegrationConnectionSecret
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="IntegrationConnectionSpec")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class IntegrationConnectionSpec:
|
18
|
+
"""Integration connection specification
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
config (Union[Unset, IntegrationConnectionConfig]): Integration config
|
22
|
+
integration (Union[Unset, str]): Integration type
|
23
|
+
secret (Union[Unset, IntegrationConnectionSecret]): Integration secret
|
24
|
+
"""
|
25
|
+
|
26
|
+
config: Union[Unset, "IntegrationConnectionConfig"] = UNSET
|
27
|
+
integration: Union[Unset, str] = UNSET
|
28
|
+
secret: Union[Unset, "IntegrationConnectionSecret"] = UNSET
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
30
|
+
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
32
|
+
config: Union[Unset, Dict[str, Any]] = UNSET
|
33
|
+
if not isinstance(self.config, Unset):
|
34
|
+
config = self.config.to_dict()
|
35
|
+
|
36
|
+
integration = self.integration
|
37
|
+
|
38
|
+
secret: Union[Unset, Dict[str, Any]] = UNSET
|
39
|
+
if not isinstance(self.secret, Unset):
|
40
|
+
secret = self.secret.to_dict()
|
41
|
+
|
42
|
+
field_dict: dict[str, Any] = {}
|
43
|
+
field_dict.update(self.additional_properties)
|
44
|
+
field_dict.update({})
|
45
|
+
if config is not UNSET:
|
46
|
+
field_dict["config"] = config
|
47
|
+
if integration is not UNSET:
|
48
|
+
field_dict["integration"] = integration
|
49
|
+
if secret is not UNSET:
|
50
|
+
field_dict["secret"] = secret
|
51
|
+
|
52
|
+
return field_dict
|
53
|
+
|
54
|
+
@classmethod
|
55
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
56
|
+
from ..models.integration_connection_config import IntegrationConnectionConfig
|
57
|
+
from ..models.integration_connection_secret import IntegrationConnectionSecret
|
58
|
+
|
59
|
+
d = src_dict.copy()
|
60
|
+
_config = d.pop("config", UNSET)
|
61
|
+
config: Union[Unset, IntegrationConnectionConfig]
|
62
|
+
if isinstance(_config, Unset):
|
63
|
+
config = UNSET
|
64
|
+
else:
|
65
|
+
config = IntegrationConnectionConfig.from_dict(_config)
|
66
|
+
|
67
|
+
integration = d.pop("integration", UNSET)
|
68
|
+
|
69
|
+
_secret = d.pop("secret", UNSET)
|
70
|
+
secret: Union[Unset, IntegrationConnectionSecret]
|
71
|
+
if isinstance(_secret, Unset):
|
72
|
+
secret = UNSET
|
73
|
+
else:
|
74
|
+
secret = IntegrationConnectionSecret.from_dict(_secret)
|
75
|
+
|
76
|
+
integration_connection_spec = cls(
|
77
|
+
config=config,
|
78
|
+
integration=integration,
|
79
|
+
secret=secret,
|
80
|
+
)
|
81
|
+
|
82
|
+
integration_connection_spec.additional_properties = d
|
83
|
+
return integration_connection_spec
|
84
|
+
|
85
|
+
@property
|
86
|
+
def additional_keys(self) -> list[str]:
|
87
|
+
return list(self.additional_properties.keys())
|
88
|
+
|
89
|
+
def __getitem__(self, key: str) -> Any:
|
90
|
+
return self.additional_properties[key]
|
91
|
+
|
92
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
93
|
+
self.additional_properties[key] = value
|
94
|
+
|
95
|
+
def __delitem__(self, key: str) -> None:
|
96
|
+
del self.additional_properties[key]
|
97
|
+
|
98
|
+
def __contains__(self, key: str) -> bool:
|
99
|
+
return key in self.additional_properties
|