diff --git a/README.md b/README.md index 971a101..d2405c2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPipedreamHQ%2Fpipedream-sdk-python) [![pypi](https://img.shields.io/pypi/v/pipedream)](https://pypi.python.org/pypi/pipedream) -The Pipedream Python library provides convenient access to the Pipedream API from Python. +The Pipedream Python library provides convenient access to the Pipedream APIs from Python. ## Installation diff --git a/pyproject.toml b/pyproject.toml index d3d3731..6a115d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "pipedream" [tool.poetry] name = "pipedream" -version = "1.0.5" +version = "1.0.6" description = "" readme = "README.md" authors = [] diff --git a/src/pipedream/actions/client.py b/src/pipedream/actions/client.py index 20db8b9..a7a44f6 100644 --- a/src/pipedream/actions/client.py +++ b/src/pipedream/actions/client.py @@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.reload_props_response import ReloadPropsResponse from ..types.run_action_opts_stash_id import RunActionOptsStashId from ..types.run_action_response import RunActionResponse @@ -131,7 +132,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -155,8 +156,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -214,7 +214,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -232,8 +232,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -276,7 +275,7 @@ def run( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -292,8 +291,7 @@ def run( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the action + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -468,7 +466,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -492,8 +490,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -559,7 +556,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -577,8 +574,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -629,7 +625,7 @@ async def run( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -645,8 +641,7 @@ async def run( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the action + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props diff --git a/src/pipedream/actions/raw_client.py b/src/pipedream/actions/raw_client.py index 5efb6a8..026d20d 100644 --- a/src/pipedream/actions/raw_client.py +++ b/src/pipedream/actions/raw_client.py @@ -13,6 +13,7 @@ from ..core.serialization import convert_and_respect_annotation_metadata from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.get_component_response import GetComponentResponse from ..types.get_components_response import GetComponentsResponse from ..types.reload_props_response import ReloadPropsResponse @@ -155,7 +156,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -179,8 +180,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -210,7 +210,9 @@ def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -243,7 +245,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ReloadPropsResponse]: @@ -261,8 +263,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -282,7 +283,9 @@ def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ @@ -311,7 +314,7 @@ def run( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -327,8 +330,7 @@ def run( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the action + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -349,7 +351,9 @@ def run( json={ "id": id, "external_user_id": external_user_id, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "stash_id": convert_and_respect_annotation_metadata( object_=stash_id, annotation=RunActionOptsStashId, direction="write" @@ -512,7 +516,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -536,8 +540,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -567,7 +570,9 @@ async def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -600,7 +605,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ReloadPropsResponse]: @@ -618,8 +623,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -639,7 +643,9 @@ async def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ @@ -668,7 +674,7 @@ async def run( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, stash_id: typing.Optional[RunActionOptsStashId] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -684,8 +690,7 @@ async def run( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the action + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -706,7 +711,9 @@ async def run( json={ "id": id, "external_user_id": external_user_id, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "stash_id": convert_and_respect_annotation_metadata( object_=stash_id, annotation=RunActionOptsStashId, direction="write" diff --git a/src/pipedream/apps/__init__.py b/src/pipedream/apps/__init__.py index 66417f3..28a82cb 100644 --- a/src/pipedream/apps/__init__.py +++ b/src/pipedream/apps/__init__.py @@ -2,6 +2,31 @@ # isort: skip_file -from .types import AppsListRequestSortDirection, AppsListRequestSortKey +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import AppsListRequestSortDirection, AppsListRequestSortKey +_dynamic_imports: typing.Dict[str, str] = {"AppsListRequestSortDirection": ".types", "AppsListRequestSortKey": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["AppsListRequestSortDirection", "AppsListRequestSortKey"] diff --git a/src/pipedream/apps/types/__init__.py b/src/pipedream/apps/types/__init__.py index 87ed3b2..a6c7583 100644 --- a/src/pipedream/apps/types/__init__.py +++ b/src/pipedream/apps/types/__init__.py @@ -2,7 +2,35 @@ # isort: skip_file -from .apps_list_request_sort_direction import AppsListRequestSortDirection -from .apps_list_request_sort_key import AppsListRequestSortKey +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .apps_list_request_sort_direction import AppsListRequestSortDirection + from .apps_list_request_sort_key import AppsListRequestSortKey +_dynamic_imports: typing.Dict[str, str] = { + "AppsListRequestSortDirection": ".apps_list_request_sort_direction", + "AppsListRequestSortKey": ".apps_list_request_sort_key", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["AppsListRequestSortDirection", "AppsListRequestSortKey"] diff --git a/src/pipedream/client.py b/src/pipedream/client.py index 24d3539..0c2fbdd 100644 --- a/src/pipedream/client.py +++ b/src/pipedream/client.py @@ -1,26 +1,30 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import os import typing import httpx -from .types.project_environment import ProjectEnvironment -from .accounts.client import AccountsClient, AsyncAccountsClient -from .actions.client import ActionsClient, AsyncActionsClient -from .app_categories.client import AppCategoriesClient, AsyncAppCategoriesClient -from .apps.client import AppsClient, AsyncAppsClient -from .components.client import AsyncComponentsClient, ComponentsClient +from ._.types.project_environment import ProjectEnvironment from .core.api_error import ApiError from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .core.oauth_token_provider import OAuthTokenProvider -from .deployed_triggers.client import AsyncDeployedTriggersClient, DeployedTriggersClient from .environment import PipedreamEnvironment -from .oauth_tokens.client import AsyncOauthTokensClient, OauthTokensClient -from .projects.client import AsyncProjectsClient, ProjectsClient -from .proxy.client import AsyncProxyClient, ProxyClient -from .tokens.client import AsyncTokensClient, TokensClient -from .triggers.client import AsyncTriggersClient, TriggersClient -from .users.client import AsyncUsersClient, UsersClient + +if typing.TYPE_CHECKING: + from .accounts.client import AccountsClient, AsyncAccountsClient + from .actions.client import ActionsClient, AsyncActionsClient + from .app_categories.client import AppCategoriesClient, AsyncAppCategoriesClient + from .apps.client import AppsClient, AsyncAppsClient + from .components.client import AsyncComponentsClient, ComponentsClient + from .deployed_triggers.client import AsyncDeployedTriggersClient, DeployedTriggersClient + from .oauth_tokens.client import AsyncOauthTokensClient, OauthTokensClient + from .projects.client import AsyncProjectsClient, ProjectsClient + from .proxy.client import AsyncProxyClient, ProxyClient + from .tokens.client import AsyncTokensClient, TokensClient + from .triggers.client import AsyncTriggersClient, TriggersClient + from .users.client import AsyncUsersClient, UsersClient class Client: @@ -117,18 +121,114 @@ def __init__( else httpx.Client(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) - self.app_categories = AppCategoriesClient(client_wrapper=self._client_wrapper) - self.apps = AppsClient(client_wrapper=self._client_wrapper) - self.accounts = AccountsClient(client_wrapper=self._client_wrapper) - self.users = UsersClient(client_wrapper=self._client_wrapper) - self.components = ComponentsClient(client_wrapper=self._client_wrapper) - self.actions = ActionsClient(client_wrapper=self._client_wrapper) - self.triggers = TriggersClient(client_wrapper=self._client_wrapper) - self.deployed_triggers = DeployedTriggersClient(client_wrapper=self._client_wrapper) - self.projects = ProjectsClient(client_wrapper=self._client_wrapper) - self.proxy = ProxyClient(client_wrapper=self._client_wrapper) - self.tokens = TokensClient(client_wrapper=self._client_wrapper) - self.oauth_tokens = OauthTokensClient(client_wrapper=self._client_wrapper) + self._app_categories: typing.Optional[AppCategoriesClient] = None + self._apps: typing.Optional[AppsClient] = None + self._accounts: typing.Optional[AccountsClient] = None + self._users: typing.Optional[UsersClient] = None + self._components: typing.Optional[ComponentsClient] = None + self._actions: typing.Optional[ActionsClient] = None + self._triggers: typing.Optional[TriggersClient] = None + self._deployed_triggers: typing.Optional[DeployedTriggersClient] = None + self._projects: typing.Optional[ProjectsClient] = None + self._proxy: typing.Optional[ProxyClient] = None + self._tokens: typing.Optional[TokensClient] = None + self._oauth_tokens: typing.Optional[OauthTokensClient] = None + + @property + def app_categories(self): + if self._app_categories is None: + from .app_categories.client import AppCategoriesClient # noqa: E402 + + self._app_categories = AppCategoriesClient(client_wrapper=self._client_wrapper) + return self._app_categories + + @property + def apps(self): + if self._apps is None: + from .apps.client import AppsClient # noqa: E402 + + self._apps = AppsClient(client_wrapper=self._client_wrapper) + return self._apps + + @property + def accounts(self): + if self._accounts is None: + from .accounts.client import AccountsClient # noqa: E402 + + self._accounts = AccountsClient(client_wrapper=self._client_wrapper) + return self._accounts + + @property + def users(self): + if self._users is None: + from .users.client import UsersClient # noqa: E402 + + self._users = UsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def components(self): + if self._components is None: + from .components.client import ComponentsClient # noqa: E402 + + self._components = ComponentsClient(client_wrapper=self._client_wrapper) + return self._components + + @property + def actions(self): + if self._actions is None: + from .actions.client import ActionsClient # noqa: E402 + + self._actions = ActionsClient(client_wrapper=self._client_wrapper) + return self._actions + + @property + def triggers(self): + if self._triggers is None: + from .triggers.client import TriggersClient # noqa: E402 + + self._triggers = TriggersClient(client_wrapper=self._client_wrapper) + return self._triggers + + @property + def deployed_triggers(self): + if self._deployed_triggers is None: + from .deployed_triggers.client import DeployedTriggersClient # noqa: E402 + + self._deployed_triggers = DeployedTriggersClient(client_wrapper=self._client_wrapper) + return self._deployed_triggers + + @property + def projects(self): + if self._projects is None: + from .projects.client import ProjectsClient # noqa: E402 + + self._projects = ProjectsClient(client_wrapper=self._client_wrapper) + return self._projects + + @property + def proxy(self): + if self._proxy is None: + from .proxy.client import ProxyClient # noqa: E402 + + self._proxy = ProxyClient(client_wrapper=self._client_wrapper) + return self._proxy + + @property + def tokens(self): + if self._tokens is None: + from .tokens.client import TokensClient # noqa: E402 + + self._tokens = TokensClient(client_wrapper=self._client_wrapper) + return self._tokens + + @property + def oauth_tokens(self): + if self._oauth_tokens is None: + from .oauth_tokens.client import OauthTokensClient # noqa: E402 + + self._oauth_tokens = OauthTokensClient(client_wrapper=self._client_wrapper) + return self._oauth_tokens class AsyncClient: @@ -225,18 +325,114 @@ def __init__( else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) - self.app_categories = AsyncAppCategoriesClient(client_wrapper=self._client_wrapper) - self.apps = AsyncAppsClient(client_wrapper=self._client_wrapper) - self.accounts = AsyncAccountsClient(client_wrapper=self._client_wrapper) - self.users = AsyncUsersClient(client_wrapper=self._client_wrapper) - self.components = AsyncComponentsClient(client_wrapper=self._client_wrapper) - self.actions = AsyncActionsClient(client_wrapper=self._client_wrapper) - self.triggers = AsyncTriggersClient(client_wrapper=self._client_wrapper) - self.deployed_triggers = AsyncDeployedTriggersClient(client_wrapper=self._client_wrapper) - self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper) - self.proxy = AsyncProxyClient(client_wrapper=self._client_wrapper) - self.tokens = AsyncTokensClient(client_wrapper=self._client_wrapper) - self.oauth_tokens = AsyncOauthTokensClient(client_wrapper=self._client_wrapper) + self._app_categories: typing.Optional[AsyncAppCategoriesClient] = None + self._apps: typing.Optional[AsyncAppsClient] = None + self._accounts: typing.Optional[AsyncAccountsClient] = None + self._users: typing.Optional[AsyncUsersClient] = None + self._components: typing.Optional[AsyncComponentsClient] = None + self._actions: typing.Optional[AsyncActionsClient] = None + self._triggers: typing.Optional[AsyncTriggersClient] = None + self._deployed_triggers: typing.Optional[AsyncDeployedTriggersClient] = None + self._projects: typing.Optional[AsyncProjectsClient] = None + self._proxy: typing.Optional[AsyncProxyClient] = None + self._tokens: typing.Optional[AsyncTokensClient] = None + self._oauth_tokens: typing.Optional[AsyncOauthTokensClient] = None + + @property + def app_categories(self): + if self._app_categories is None: + from .app_categories.client import AsyncAppCategoriesClient # noqa: E402 + + self._app_categories = AsyncAppCategoriesClient(client_wrapper=self._client_wrapper) + return self._app_categories + + @property + def apps(self): + if self._apps is None: + from .apps.client import AsyncAppsClient # noqa: E402 + + self._apps = AsyncAppsClient(client_wrapper=self._client_wrapper) + return self._apps + + @property + def accounts(self): + if self._accounts is None: + from .accounts.client import AsyncAccountsClient # noqa: E402 + + self._accounts = AsyncAccountsClient(client_wrapper=self._client_wrapper) + return self._accounts + + @property + def users(self): + if self._users is None: + from .users.client import AsyncUsersClient # noqa: E402 + + self._users = AsyncUsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def components(self): + if self._components is None: + from .components.client import AsyncComponentsClient # noqa: E402 + + self._components = AsyncComponentsClient(client_wrapper=self._client_wrapper) + return self._components + + @property + def actions(self): + if self._actions is None: + from .actions.client import AsyncActionsClient # noqa: E402 + + self._actions = AsyncActionsClient(client_wrapper=self._client_wrapper) + return self._actions + + @property + def triggers(self): + if self._triggers is None: + from .triggers.client import AsyncTriggersClient # noqa: E402 + + self._triggers = AsyncTriggersClient(client_wrapper=self._client_wrapper) + return self._triggers + + @property + def deployed_triggers(self): + if self._deployed_triggers is None: + from .deployed_triggers.client import AsyncDeployedTriggersClient # noqa: E402 + + self._deployed_triggers = AsyncDeployedTriggersClient(client_wrapper=self._client_wrapper) + return self._deployed_triggers + + @property + def projects(self): + if self._projects is None: + from .projects.client import AsyncProjectsClient # noqa: E402 + + self._projects = AsyncProjectsClient(client_wrapper=self._client_wrapper) + return self._projects + + @property + def proxy(self): + if self._proxy is None: + from .proxy.client import AsyncProxyClient # noqa: E402 + + self._proxy = AsyncProxyClient(client_wrapper=self._client_wrapper) + return self._proxy + + @property + def tokens(self): + if self._tokens is None: + from .tokens.client import AsyncTokensClient # noqa: E402 + + self._tokens = AsyncTokensClient(client_wrapper=self._client_wrapper) + return self._tokens + + @property + def oauth_tokens(self): + if self._oauth_tokens is None: + from .oauth_tokens.client import AsyncOauthTokensClient # noqa: E402 + + self._oauth_tokens = AsyncOauthTokensClient(client_wrapper=self._client_wrapper) + return self._oauth_tokens def _get_base_url(*, base_url: typing.Optional[str] = None, environment: PipedreamEnvironment) -> str: diff --git a/src/pipedream/components/client.py b/src/pipedream/components/client.py index 24f78d8..c23cc5c 100644 --- a/src/pipedream/components/client.py +++ b/src/pipedream/components/client.py @@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.reload_props_response import ReloadPropsResponse from .raw_client import AsyncRawComponentsClient, RawComponentsClient @@ -129,7 +130,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -153,8 +154,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -212,7 +212,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -230,8 +230,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -404,7 +403,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -428,8 +427,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -495,7 +493,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -513,8 +511,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props diff --git a/src/pipedream/components/raw_client.py b/src/pipedream/components/raw_client.py index e64f04d..5065e8d 100644 --- a/src/pipedream/components/raw_client.py +++ b/src/pipedream/components/raw_client.py @@ -10,8 +10,10 @@ from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.get_component_response import GetComponentResponse from ..types.get_components_response import GetComponentsResponse from ..types.reload_props_response import ReloadPropsResponse @@ -152,7 +154,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -176,8 +178,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -207,7 +208,9 @@ def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -240,7 +243,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ReloadPropsResponse]: @@ -258,8 +261,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -279,7 +281,9 @@ def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ @@ -439,7 +443,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -463,8 +467,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -494,7 +497,9 @@ async def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -527,7 +532,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ReloadPropsResponse]: @@ -545,8 +550,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -566,7 +570,9 @@ async def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ diff --git a/src/pipedream/core/__init__.py b/src/pipedream/core/__init__.py index d1461de..f20f6b0 100644 --- a/src/pipedream/core/__init__.py +++ b/src/pipedream/core/__init__.py @@ -2,27 +2,80 @@ # isort: skip_file -from .api_error import ApiError -from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper -from .datetime_utils import serialize_datetime -from .file import File, convert_file_dict_to_httpx_tuples, with_content_type -from .http_client import AsyncHttpClient, HttpClient -from .http_response import AsyncHttpResponse, HttpResponse -from .jsonable_encoder import jsonable_encoder -from .pagination import AsyncPager, SyncPager -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, -) -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict -from .request_options import RequestOptions -from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .api_error import ApiError + from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper + from .datetime_utils import serialize_datetime + from .file import File, convert_file_dict_to_httpx_tuples, with_content_type + from .http_client import AsyncHttpClient, HttpClient + from .http_response import AsyncHttpResponse, HttpResponse + from .jsonable_encoder import jsonable_encoder + from .pagination import AsyncPager, SyncPager + from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, + ) + from .query_encoder import encode_query + from .remove_none_from_dict import remove_none_from_dict + from .request_options import RequestOptions + from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +_dynamic_imports: typing.Dict[str, str] = { + "ApiError": ".api_error", + "AsyncClientWrapper": ".client_wrapper", + "AsyncHttpClient": ".http_client", + "AsyncHttpResponse": ".http_response", + "AsyncPager": ".pagination", + "BaseClientWrapper": ".client_wrapper", + "FieldMetadata": ".serialization", + "File": ".file", + "HttpClient": ".http_client", + "HttpResponse": ".http_response", + "IS_PYDANTIC_V2": ".pydantic_utilities", + "RequestOptions": ".request_options", + "SyncClientWrapper": ".client_wrapper", + "SyncPager": ".pagination", + "UniversalBaseModel": ".pydantic_utilities", + "UniversalRootModel": ".pydantic_utilities", + "convert_and_respect_annotation_metadata": ".serialization", + "convert_file_dict_to_httpx_tuples": ".file", + "encode_query": ".query_encoder", + "jsonable_encoder": ".jsonable_encoder", + "parse_obj_as": ".pydantic_utilities", + "remove_none_from_dict": ".remove_none_from_dict", + "serialize_datetime": ".datetime_utils", + "universal_field_validator": ".pydantic_utilities", + "universal_root_validator": ".pydantic_utilities", + "update_forward_refs": ".pydantic_utilities", + "with_content_type": ".file", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ApiError", diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 6a68ab4..28625de 100644 --- a/src/pipedream/core/client_wrapper.py +++ b/src/pipedream/core/client_wrapper.py @@ -3,7 +3,7 @@ import typing import httpx -from ..types.project_environment import ProjectEnvironment +from .._.types.project_environment import ProjectEnvironment from .http_client import AsyncHttpClient, HttpClient @@ -27,10 +27,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "pipedream/1.0.5", + "User-Agent": "pipedream/1.0.6", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "1.0.5", + "X-Fern-SDK-Version": "1.0.6", **(self.get_custom_headers() or {}), } if self._project_environment is not None: diff --git a/src/pipedream/core/force_multipart.py b/src/pipedream/core/force_multipart.py index ae24ccf..5440913 100644 --- a/src/pipedream/core/force_multipart.py +++ b/src/pipedream/core/force_multipart.py @@ -1,7 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from typing import Any, Dict -class ForceMultipartDict(dict): + +class ForceMultipartDict(Dict[str, Any]): """ A dictionary subclass that always evaluates to True in boolean contexts. @@ -9,7 +11,7 @@ class ForceMultipartDict(dict): the dictionary is empty, which would normally evaluate to False. """ - def __bool__(self): + def __bool__(self) -> bool: return True diff --git a/src/pipedream/core/http_response.py b/src/pipedream/core/http_response.py index 48a1798..2479747 100644 --- a/src/pipedream/core/http_response.py +++ b/src/pipedream/core/http_response.py @@ -4,8 +4,8 @@ import httpx +# Generic to represent the underlying type of the data wrapped by the HTTP response. T = TypeVar("T") -"""Generic to represent the underlying type of the data wrapped by the HTTP response.""" class BaseHttpResponse: diff --git a/src/pipedream/core/pagination.py b/src/pipedream/core/pagination.py index 209a1ff..97bcb64 100644 --- a/src/pipedream/core/pagination.py +++ b/src/pipedream/core/pagination.py @@ -7,8 +7,8 @@ from .http_response import BaseHttpResponse +# Generic to represent the underlying type of the results within a page T = TypeVar("T") -"""Generic to represent the underlying type of the results within a page""" # SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type diff --git a/src/pipedream/core/pydantic_utilities.py b/src/pipedream/core/pydantic_utilities.py index 7db2950..dd7d89f 100644 --- a/src/pipedream/core/pydantic_utilities.py +++ b/src/pipedream/core/pydantic_utilities.py @@ -61,7 +61,7 @@ class UniversalBaseModel(pydantic.BaseModel): @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.model_dump() + serialized = self.model_dump() # type: ignore[attr-defined] data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} return data @@ -147,7 +147,10 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") + return cast( + Dict[str, Any], + convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), + ) def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: diff --git a/src/pipedream/deployed_triggers/client.py b/src/pipedream/deployed_triggers/client.py index f2f5a7d..9493eef 100644 --- a/src/pipedream/deployed_triggers/client.py +++ b/src/pipedream/deployed_triggers/client.py @@ -5,6 +5,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions +from ..types.configured_props import ConfiguredProps from ..types.deployed_component import DeployedComponent from ..types.emitted_event import EmittedEvent from ..types.get_trigger_webhooks_response import GetTriggerWebhooksResponse @@ -134,7 +135,7 @@ def update( *, external_user_id: str, active: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DeployedComponent: @@ -151,8 +152,7 @@ def update( active : typing.Optional[bool] Whether the trigger should be active - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] name : typing.Optional[str] The name of the trigger @@ -609,7 +609,7 @@ async def update( *, external_user_id: str, active: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DeployedComponent: @@ -626,8 +626,7 @@ async def update( active : typing.Optional[bool] Whether the trigger should be active - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] name : typing.Optional[str] The name of the trigger diff --git a/src/pipedream/deployed_triggers/raw_client.py b/src/pipedream/deployed_triggers/raw_client.py index d1ef703..9ff533b 100644 --- a/src/pipedream/deployed_triggers/raw_client.py +++ b/src/pipedream/deployed_triggers/raw_client.py @@ -10,6 +10,8 @@ from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata +from ..types.configured_props import ConfiguredProps from ..types.deployed_component import DeployedComponent from ..types.emitted_event import EmittedEvent from ..types.get_trigger_events_response import GetTriggerEventsResponse @@ -152,7 +154,7 @@ def update( *, external_user_id: str, active: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DeployedComponent]: @@ -169,8 +171,7 @@ def update( active : typing.Optional[bool] Whether the trigger should be active - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] name : typing.Optional[str] The name of the trigger @@ -191,7 +192,9 @@ def update( }, json={ "active": active, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "name": name, }, headers={ @@ -655,7 +658,7 @@ async def update( *, external_user_id: str, active: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DeployedComponent]: @@ -672,8 +675,7 @@ async def update( active : typing.Optional[bool] Whether the trigger should be active - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] name : typing.Optional[str] The name of the trigger @@ -694,7 +696,9 @@ async def update( }, json={ "active": active, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "name": name, }, headers={ diff --git a/src/pipedream/triggers/client.py b/src/pipedream/triggers/client.py index ecefa64..32bf25d 100644 --- a/src/pipedream/triggers/client.py +++ b/src/pipedream/triggers/client.py @@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.deployed_component import DeployedComponent from ..types.reload_props_response import ReloadPropsResponse from .raw_client import AsyncRawTriggersClient, RawTriggersClient @@ -130,7 +131,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -154,8 +155,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -213,7 +213,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -231,8 +231,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -275,7 +274,7 @@ def deploy( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -291,8 +290,7 @@ def deploy( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -468,7 +466,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -492,8 +490,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -559,7 +556,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ReloadPropsResponse: @@ -577,8 +574,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -629,7 +625,7 @@ async def deploy( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -645,8 +641,7 @@ async def deploy( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props diff --git a/src/pipedream/triggers/raw_client.py b/src/pipedream/triggers/raw_client.py index a83eb6f..e86b621 100644 --- a/src/pipedream/triggers/raw_client.py +++ b/src/pipedream/triggers/raw_client.py @@ -10,8 +10,10 @@ from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata from ..types.component import Component from ..types.configure_prop_response import ConfigurePropResponse +from ..types.configured_props import ConfiguredProps from ..types.deploy_trigger_response import DeployTriggerResponse from ..types.deployed_component import DeployedComponent from ..types.get_component_response import GetComponentResponse @@ -154,7 +156,7 @@ def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -178,8 +180,7 @@ def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -209,7 +210,9 @@ def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -242,7 +245,7 @@ def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ReloadPropsResponse]: @@ -260,8 +263,7 @@ def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -281,7 +283,9 @@ def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ @@ -310,7 +314,7 @@ def deploy( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -326,8 +330,7 @@ def deploy( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -349,7 +352,9 @@ def deploy( json={ "id": id, "external_user_id": external_user_id, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "webhook_url": webhook_url, }, @@ -511,7 +516,7 @@ async def configure_prop( external_user_id: str, prop_name: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, page: typing.Optional[float] = OMIT, prev_context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -535,8 +540,7 @@ async def configure_prop( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -566,7 +570,9 @@ async def configure_prop( "external_user_id": external_user_id, "prop_name": prop_name, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "page": page, "prev_context": prev_context, @@ -599,7 +605,7 @@ async def reload_props( id: str, external_user_id: str, blocking: typing.Optional[bool] = OMIT, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ReloadPropsResponse]: @@ -617,8 +623,7 @@ async def reload_props( blocking : typing.Optional[bool] Whether this operation should block until completion - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the component + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -638,7 +643,9 @@ async def reload_props( "id": id, "external_user_id": external_user_id, "blocking": blocking, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, }, headers={ @@ -667,7 +674,7 @@ async def deploy( *, id: str, external_user_id: str, - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + configured_props: typing.Optional[ConfiguredProps] = OMIT, dynamic_props_id: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -683,8 +690,7 @@ async def deploy( external_user_id : str The external user ID - configured_props : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] - The configured properties for the trigger + configured_props : typing.Optional[ConfiguredProps] dynamic_props_id : typing.Optional[str] The ID for dynamic props @@ -706,7 +712,9 @@ async def deploy( json={ "id": id, "external_user_id": external_user_id, - "configured_props": configured_props, + "configured_props": convert_and_respect_annotation_metadata( + object_=configured_props, annotation=ConfiguredProps, direction="write" + ), "dynamic_props_id": dynamic_props_id, "webhook_url": webhook_url, }, diff --git a/src/pipedream/types/__init__.py b/src/pipedream/types/__init__.py index 44d94d6..25b2c4c 100644 --- a/src/pipedream/types/__init__.py +++ b/src/pipedream/types/__init__.py @@ -2,84 +2,220 @@ # isort: skip_file -from .account import Account -from .app import App -from .app_auth_type import AppAuthType -from .app_category import AppCategory -from .backend_client_opts import BackendClientOpts -from .client_opts import ClientOpts -from .component import Component -from .component_stash import ComponentStash -from .configurable_prop import ConfigurableProp -from .configurable_prop_airtable_base_id import ConfigurablePropAirtableBaseId -from .configurable_prop_airtable_field_id import ConfigurablePropAirtableFieldId -from .configurable_prop_airtable_table_id import ConfigurablePropAirtableTableId -from .configurable_prop_airtable_view_id import ConfigurablePropAirtableViewId -from .configurable_prop_alert import ConfigurablePropAlert -from .configurable_prop_alert_type import ConfigurablePropAlertType -from .configurable_prop_any import ConfigurablePropAny -from .configurable_prop_app import ConfigurablePropApp -from .configurable_prop_apphook import ConfigurablePropApphook -from .configurable_prop_boolean import ConfigurablePropBoolean -from .configurable_prop_db import ConfigurablePropDb -from .configurable_prop_discord import ConfigurablePropDiscord -from .configurable_prop_discord_channel import ConfigurablePropDiscordChannel -from .configurable_prop_discord_channel_array import ConfigurablePropDiscordChannelArray -from .configurable_prop_http import ConfigurablePropHttp -from .configurable_prop_integer import ConfigurablePropInteger -from .configurable_prop_integer_array import ConfigurablePropIntegerArray -from .configurable_prop_object import ConfigurablePropObject -from .configurable_prop_sql import ConfigurablePropSql -from .configurable_prop_sql_auth import ConfigurablePropSqlAuth -from .configurable_prop_string import ConfigurablePropString -from .configurable_prop_string_array import ConfigurablePropStringArray -from .configurable_prop_timer import ConfigurablePropTimer -from .configurable_prop_timer_default import ConfigurablePropTimerDefault -from .configurable_prop_timer_option import ConfigurablePropTimerOption -from .configurable_prop_timer_static import ConfigurablePropTimerStatic -from .configure_prop_opts import ConfigurePropOpts -from .configure_prop_response import ConfigurePropResponse -from .connect_token import ConnectToken -from .create_o_auth_token_response import CreateOAuthTokenResponse -from .create_token_response import CreateTokenResponse -from .delete_trigger_opts import DeleteTriggerOpts -from .deploy_trigger_response import DeployTriggerResponse -from .deployed_component import DeployedComponent -from .dynamic_props import DynamicProps -from .emitted_event import EmittedEvent -from .error_response import ErrorResponse -from .get_accounts_response import GetAccountsResponse -from .get_app_category_response import GetAppCategoryResponse -from .get_app_response import GetAppResponse -from .get_apps_response import GetAppsResponse -from .get_component_response import GetComponentResponse -from .get_components_response import GetComponentsResponse -from .get_trigger_events_response import GetTriggerEventsResponse -from .get_trigger_response import GetTriggerResponse -from .get_trigger_webhooks_response import GetTriggerWebhooksResponse -from .get_trigger_workflows_response import GetTriggerWorkflowsResponse -from .get_triggers_response import GetTriggersResponse -from .list_accounts_response import ListAccountsResponse -from .list_app_categories_response import ListAppCategoriesResponse -from .list_apps_response import ListAppsResponse -from .page_info import PageInfo -from .project_environment import ProjectEnvironment -from .project_info_response import ProjectInfoResponse -from .project_info_response_app import ProjectInfoResponseApp -from .prop_option import PropOption -from .proxy_response import ProxyResponse -from .reload_props_opts import ReloadPropsOpts -from .reload_props_response import ReloadPropsResponse -from .run_action_opts_stash_id import RunActionOptsStashId -from .run_action_response import RunActionResponse -from .start_connect_opts import StartConnectOpts -from .stash_id import StashId -from .timer_cron import TimerCron -from .timer_interval import TimerInterval -from .validate_token_response import ValidateTokenResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .account import Account + from .account_id import AccountId + from .app import App + from .app_auth_type import AppAuthType + from .app_category import AppCategory + from .backend_client_opts import BackendClientOpts + from .client_opts import ClientOpts + from .component import Component + from .component_stash import ComponentStash + from .configurable_prop import ConfigurableProp + from .configurable_prop_airtable_base_id import ConfigurablePropAirtableBaseId + from .configurable_prop_airtable_field_id import ConfigurablePropAirtableFieldId + from .configurable_prop_airtable_table_id import ConfigurablePropAirtableTableId + from .configurable_prop_airtable_view_id import ConfigurablePropAirtableViewId + from .configurable_prop_alert import ConfigurablePropAlert + from .configurable_prop_alert_type import ConfigurablePropAlertType + from .configurable_prop_any import ConfigurablePropAny + from .configurable_prop_app import ConfigurablePropApp + from .configurable_prop_apphook import ConfigurablePropApphook + from .configurable_prop_boolean import ConfigurablePropBoolean + from .configurable_prop_db import ConfigurablePropDb + from .configurable_prop_discord import ConfigurablePropDiscord + from .configurable_prop_discord_channel import ConfigurablePropDiscordChannel + from .configurable_prop_discord_channel_array import ConfigurablePropDiscordChannelArray + from .configurable_prop_http import ConfigurablePropHttp + from .configurable_prop_integer import ConfigurablePropInteger + from .configurable_prop_integer_array import ConfigurablePropIntegerArray + from .configurable_prop_object import ConfigurablePropObject + from .configurable_prop_sql import ConfigurablePropSql + from .configurable_prop_sql_auth import ConfigurablePropSqlAuth + from .configurable_prop_string import ConfigurablePropString + from .configurable_prop_string_array import ConfigurablePropStringArray + from .configurable_prop_timer import ConfigurablePropTimer + from .configurable_prop_timer_default import ConfigurablePropTimerDefault + from .configurable_prop_timer_option import ConfigurablePropTimerOption + from .configurable_prop_timer_static import ConfigurablePropTimerStatic + from .configurable_prop_type import ConfigurablePropType + from .configure_prop_options import ConfigurePropOptions + from .configure_prop_options_item import ConfigurePropOptionsItem + from .configure_prop_opts import ConfigurePropOpts + from .configure_prop_response import ConfigurePropResponse + from .configured_prop_value import ConfiguredPropValue + from .configured_prop_value_any import ConfiguredPropValueAny + from .configured_prop_value_app import ConfiguredPropValueApp + from .configured_prop_value_boolean import ConfiguredPropValueBoolean + from .configured_prop_value_integer import ConfiguredPropValueInteger + from .configured_prop_value_object import ConfiguredPropValueObject + from .configured_prop_value_sql import ConfiguredPropValueSql + from .configured_prop_value_string import ConfiguredPropValueString + from .configured_prop_value_string_array import ConfiguredPropValueStringArray + from .configured_props import ConfiguredProps + from .connect_token import ConnectToken + from .create_o_auth_token_response import CreateOAuthTokenResponse + from .create_token_response import CreateTokenResponse + from .delete_trigger_opts import DeleteTriggerOpts + from .deploy_trigger_response import DeployTriggerResponse + from .deployed_component import DeployedComponent + from .dynamic_props import DynamicProps + from .emitted_event import EmittedEvent + from .error_response import ErrorResponse + from .get_accounts_response import GetAccountsResponse + from .get_app_category_response import GetAppCategoryResponse + from .get_app_response import GetAppResponse + from .get_apps_response import GetAppsResponse + from .get_component_response import GetComponentResponse + from .get_components_response import GetComponentsResponse + from .get_trigger_events_response import GetTriggerEventsResponse + from .get_trigger_response import GetTriggerResponse + from .get_trigger_webhooks_response import GetTriggerWebhooksResponse + from .get_trigger_workflows_response import GetTriggerWorkflowsResponse + from .get_triggers_response import GetTriggersResponse + from .list_accounts_response import ListAccountsResponse + from .list_app_categories_response import ListAppCategoriesResponse + from .list_apps_response import ListAppsResponse + from .observation import Observation + from .observation_error import ObservationError + from .page_info import PageInfo + from .project_environment import ProjectEnvironment + from .project_info_response import ProjectInfoResponse + from .project_info_response_app import ProjectInfoResponseApp + from .prop_option import PropOption + from .prop_option_nested import PropOptionNested + from .proxy_response import ProxyResponse + from .reload_props_opts import ReloadPropsOpts + from .reload_props_response import ReloadPropsResponse + from .run_action_opts_stash_id import RunActionOptsStashId + from .run_action_response import RunActionResponse + from .start_connect_opts import StartConnectOpts + from .stash_id import StashId + from .timer_cron import TimerCron + from .timer_interval import TimerInterval + from .validate_token_response import ValidateTokenResponse +_dynamic_imports: typing.Dict[str, str] = { + "Account": ".account", + "AccountId": ".account_id", + "App": ".app", + "AppAuthType": ".app_auth_type", + "AppCategory": ".app_category", + "BackendClientOpts": ".backend_client_opts", + "ClientOpts": ".client_opts", + "Component": ".component", + "ComponentStash": ".component_stash", + "ConfigurableProp": ".configurable_prop", + "ConfigurablePropAirtableBaseId": ".configurable_prop_airtable_base_id", + "ConfigurablePropAirtableFieldId": ".configurable_prop_airtable_field_id", + "ConfigurablePropAirtableTableId": ".configurable_prop_airtable_table_id", + "ConfigurablePropAirtableViewId": ".configurable_prop_airtable_view_id", + "ConfigurablePropAlert": ".configurable_prop_alert", + "ConfigurablePropAlertType": ".configurable_prop_alert_type", + "ConfigurablePropAny": ".configurable_prop_any", + "ConfigurablePropApp": ".configurable_prop_app", + "ConfigurablePropApphook": ".configurable_prop_apphook", + "ConfigurablePropBoolean": ".configurable_prop_boolean", + "ConfigurablePropDb": ".configurable_prop_db", + "ConfigurablePropDiscord": ".configurable_prop_discord", + "ConfigurablePropDiscordChannel": ".configurable_prop_discord_channel", + "ConfigurablePropDiscordChannelArray": ".configurable_prop_discord_channel_array", + "ConfigurablePropHttp": ".configurable_prop_http", + "ConfigurablePropInteger": ".configurable_prop_integer", + "ConfigurablePropIntegerArray": ".configurable_prop_integer_array", + "ConfigurablePropObject": ".configurable_prop_object", + "ConfigurablePropSql": ".configurable_prop_sql", + "ConfigurablePropSqlAuth": ".configurable_prop_sql_auth", + "ConfigurablePropString": ".configurable_prop_string", + "ConfigurablePropStringArray": ".configurable_prop_string_array", + "ConfigurablePropTimer": ".configurable_prop_timer", + "ConfigurablePropTimerDefault": ".configurable_prop_timer_default", + "ConfigurablePropTimerOption": ".configurable_prop_timer_option", + "ConfigurablePropTimerStatic": ".configurable_prop_timer_static", + "ConfigurablePropType": ".configurable_prop_type", + "ConfigurePropOptions": ".configure_prop_options", + "ConfigurePropOptionsItem": ".configure_prop_options_item", + "ConfigurePropOpts": ".configure_prop_opts", + "ConfigurePropResponse": ".configure_prop_response", + "ConfiguredPropValue": ".configured_prop_value", + "ConfiguredPropValueAny": ".configured_prop_value_any", + "ConfiguredPropValueApp": ".configured_prop_value_app", + "ConfiguredPropValueBoolean": ".configured_prop_value_boolean", + "ConfiguredPropValueInteger": ".configured_prop_value_integer", + "ConfiguredPropValueObject": ".configured_prop_value_object", + "ConfiguredPropValueSql": ".configured_prop_value_sql", + "ConfiguredPropValueString": ".configured_prop_value_string", + "ConfiguredPropValueStringArray": ".configured_prop_value_string_array", + "ConfiguredProps": ".configured_props", + "ConnectToken": ".connect_token", + "CreateOAuthTokenResponse": ".create_o_auth_token_response", + "CreateTokenResponse": ".create_token_response", + "DeleteTriggerOpts": ".delete_trigger_opts", + "DeployTriggerResponse": ".deploy_trigger_response", + "DeployedComponent": ".deployed_component", + "DynamicProps": ".dynamic_props", + "EmittedEvent": ".emitted_event", + "ErrorResponse": ".error_response", + "GetAccountsResponse": ".get_accounts_response", + "GetAppCategoryResponse": ".get_app_category_response", + "GetAppResponse": ".get_app_response", + "GetAppsResponse": ".get_apps_response", + "GetComponentResponse": ".get_component_response", + "GetComponentsResponse": ".get_components_response", + "GetTriggerEventsResponse": ".get_trigger_events_response", + "GetTriggerResponse": ".get_trigger_response", + "GetTriggerWebhooksResponse": ".get_trigger_webhooks_response", + "GetTriggerWorkflowsResponse": ".get_trigger_workflows_response", + "GetTriggersResponse": ".get_triggers_response", + "ListAccountsResponse": ".list_accounts_response", + "ListAppCategoriesResponse": ".list_app_categories_response", + "ListAppsResponse": ".list_apps_response", + "Observation": ".observation", + "ObservationError": ".observation_error", + "PageInfo": ".page_info", + "ProjectEnvironment": ".project_environment", + "ProjectInfoResponse": ".project_info_response", + "ProjectInfoResponseApp": ".project_info_response_app", + "PropOption": ".prop_option", + "PropOptionNested": ".prop_option_nested", + "ProxyResponse": ".proxy_response", + "ReloadPropsOpts": ".reload_props_opts", + "ReloadPropsResponse": ".reload_props_response", + "RunActionOptsStashId": ".run_action_opts_stash_id", + "RunActionResponse": ".run_action_response", + "StartConnectOpts": ".start_connect_opts", + "StashId": ".stash_id", + "TimerCron": ".timer_cron", + "TimerInterval": ".timer_interval", + "ValidateTokenResponse": ".validate_token_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "Account", + "AccountId", "App", "AppAuthType", "AppCategory", @@ -114,8 +250,21 @@ "ConfigurablePropTimerDefault", "ConfigurablePropTimerOption", "ConfigurablePropTimerStatic", + "ConfigurablePropType", + "ConfigurePropOptions", + "ConfigurePropOptionsItem", "ConfigurePropOpts", "ConfigurePropResponse", + "ConfiguredPropValue", + "ConfiguredPropValueAny", + "ConfiguredPropValueApp", + "ConfiguredPropValueBoolean", + "ConfiguredPropValueInteger", + "ConfiguredPropValueObject", + "ConfiguredPropValueSql", + "ConfiguredPropValueString", + "ConfiguredPropValueStringArray", + "ConfiguredProps", "ConnectToken", "CreateOAuthTokenResponse", "CreateTokenResponse", @@ -139,11 +288,14 @@ "ListAccountsResponse", "ListAppCategoriesResponse", "ListAppsResponse", + "Observation", + "ObservationError", "PageInfo", "ProjectEnvironment", "ProjectInfoResponse", "ProjectInfoResponseApp", "PropOption", + "PropOptionNested", "ProxyResponse", "ReloadPropsOpts", "ReloadPropsResponse", diff --git a/src/pipedream/types/account.py b/src/pipedream/types/account.py index 7d1dd3f..2627d08 100644 --- a/src/pipedream/types/account.py +++ b/src/pipedream/types/account.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .account_id import AccountId from .app import App @@ -13,11 +14,7 @@ class Account(UniversalBaseModel): End user account data, returned from the API. """ - id: str = pydantic.Field() - """ - The unique ID of the account. - """ - + id: AccountId name: typing.Optional[str] = pydantic.Field(default=None) """ The custom name of the account if set. diff --git a/src/pipedream/types/account_id.py b/src/pipedream/types/account_id.py new file mode 100644 index 0000000..6a6390c --- /dev/null +++ b/src/pipedream/types/account_id.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +AccountId = str diff --git a/src/pipedream/types/configurable_prop.py b/src/pipedream/types/configurable_prop.py index 37d4394..5f5308b 100644 --- a/src/pipedream/types/configurable_prop.py +++ b/src/pipedream/types/configurable_prop.py @@ -6,6 +6,7 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .configurable_prop_type import ConfigurablePropType class ConfigurableProp(UniversalBaseModel): @@ -18,7 +19,7 @@ class ConfigurableProp(UniversalBaseModel): When building `configuredProps`, make sure to use this field as the key when setting the prop value """ - type: typing.Optional[str] = None + type: ConfigurablePropType label: typing.Optional[str] = pydantic.Field(default=None) """ Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. diff --git a/src/pipedream/types/configurable_prop_airtable_base_id.py b/src/pipedream/types/configurable_prop_airtable_base_id.py index f4dca84..45340cd 100644 --- a/src/pipedream/types/configurable_prop_airtable_base_id.py +++ b/src/pipedream/types/configurable_prop_airtable_base_id.py @@ -9,10 +9,8 @@ class ConfigurablePropAirtableBaseId(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.airtable.baseId"]] = None - app_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="appProp")] = pydantic.Field( - default=None - ) + type: typing.Literal["$.airtable.baseId"] = "$.airtable.baseId" + app_prop: typing_extensions.Annotated[str, FieldMetadata(alias="appProp")] = pydantic.Field() """ The name of the app prop that provides Airtable authentication """ diff --git a/src/pipedream/types/configurable_prop_airtable_field_id.py b/src/pipedream/types/configurable_prop_airtable_field_id.py index 51844f5..f9bc3a3 100644 --- a/src/pipedream/types/configurable_prop_airtable_field_id.py +++ b/src/pipedream/types/configurable_prop_airtable_field_id.py @@ -9,10 +9,8 @@ class ConfigurablePropAirtableFieldId(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.airtable.fieldId"]] = None - table_id_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tableIdProp")] = ( - pydantic.Field(default=None) - ) + type: typing.Literal["$.airtable.fieldId"] = "$.airtable.fieldId" + table_id_prop: typing_extensions.Annotated[str, FieldMetadata(alias="tableIdProp")] = pydantic.Field() """ The name of the prop that provides the Airtable table ID """ diff --git a/src/pipedream/types/configurable_prop_airtable_table_id.py b/src/pipedream/types/configurable_prop_airtable_table_id.py index 819a13c..4124a1e 100644 --- a/src/pipedream/types/configurable_prop_airtable_table_id.py +++ b/src/pipedream/types/configurable_prop_airtable_table_id.py @@ -9,10 +9,8 @@ class ConfigurablePropAirtableTableId(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.airtable.tableId"]] = None - base_id_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="baseIdProp")] = pydantic.Field( - default=None - ) + type: typing.Literal["$.airtable.tableId"] = "$.airtable.tableId" + base_id_prop: typing_extensions.Annotated[str, FieldMetadata(alias="baseIdProp")] = pydantic.Field() """ The name of the prop that provides the Airtable base ID """ diff --git a/src/pipedream/types/configurable_prop_airtable_view_id.py b/src/pipedream/types/configurable_prop_airtable_view_id.py index af771e3..02bf679 100644 --- a/src/pipedream/types/configurable_prop_airtable_view_id.py +++ b/src/pipedream/types/configurable_prop_airtable_view_id.py @@ -9,10 +9,8 @@ class ConfigurablePropAirtableViewId(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.airtable.viewId"]] = None - table_id_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tableIdProp")] = ( - pydantic.Field(default=None) - ) + type: typing.Literal["$.airtable.viewId"] = "$.airtable.viewId" + table_id_prop: typing_extensions.Annotated[str, FieldMetadata(alias="tableIdProp")] = pydantic.Field() """ The name of the prop that provides the Airtable table ID """ diff --git a/src/pipedream/types/configurable_prop_alert.py b/src/pipedream/types/configurable_prop_alert.py index acd7ea7..f0eff88 100644 --- a/src/pipedream/types/configurable_prop_alert.py +++ b/src/pipedream/types/configurable_prop_alert.py @@ -10,11 +10,11 @@ class ConfigurablePropAlert(UniversalBaseModel): - type: typing.Optional[typing.Literal["alert"]] = None + type: typing.Literal["alert"] = "alert" alert_type: typing_extensions.Annotated[ typing.Optional[ConfigurablePropAlertType], FieldMetadata(alias="alertType") ] = None - content: typing.Optional[str] = pydantic.Field(default=None) + content: str = pydantic.Field() """ The content of the alert, which can include HTML or plain text. """ diff --git a/src/pipedream/types/configurable_prop_any.py b/src/pipedream/types/configurable_prop_any.py index aed6dd5..2b1fe36 100644 --- a/src/pipedream/types/configurable_prop_any.py +++ b/src/pipedream/types/configurable_prop_any.py @@ -9,7 +9,7 @@ class ConfigurablePropAny(UniversalBaseModel): - type: typing.Optional[typing.Literal["any"]] = None + type: typing.Literal["any"] = "any" name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_app.py b/src/pipedream/types/configurable_prop_app.py index 8c1d154..514dbfa 100644 --- a/src/pipedream/types/configurable_prop_app.py +++ b/src/pipedream/types/configurable_prop_app.py @@ -9,8 +9,8 @@ class ConfigurablePropApp(UniversalBaseModel): - type: typing.Optional[typing.Literal["app"]] = None - app: typing.Optional[str] = pydantic.Field(default=None) + type: typing.Literal["app"] = "app" + app: str = pydantic.Field() """ The name slug of the app, e.g. 'github', 'slack', etc. This is used to identify the app for which the account is being configured. """ diff --git a/src/pipedream/types/configurable_prop_apphook.py b/src/pipedream/types/configurable_prop_apphook.py index 8dedabf..a2688c2 100644 --- a/src/pipedream/types/configurable_prop_apphook.py +++ b/src/pipedream/types/configurable_prop_apphook.py @@ -9,10 +9,8 @@ class ConfigurablePropApphook(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.interface.apphook"]] = None - app_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="appProp")] = pydantic.Field( - default=None - ) + type: typing.Literal["$.interface.apphook"] = "$.interface.apphook" + app_prop: typing_extensions.Annotated[str, FieldMetadata(alias="appProp")] = pydantic.Field() """ The name of the app prop that this apphook depends on """ diff --git a/src/pipedream/types/configurable_prop_boolean.py b/src/pipedream/types/configurable_prop_boolean.py index eda5c42..08fcc1c 100644 --- a/src/pipedream/types/configurable_prop_boolean.py +++ b/src/pipedream/types/configurable_prop_boolean.py @@ -9,7 +9,7 @@ class ConfigurablePropBoolean(UniversalBaseModel): - type: typing.Optional[typing.Literal["boolean"]] = None + type: typing.Literal["boolean"] = "boolean" name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_db.py b/src/pipedream/types/configurable_prop_db.py index 0f28108..63bbf57 100644 --- a/src/pipedream/types/configurable_prop_db.py +++ b/src/pipedream/types/configurable_prop_db.py @@ -9,7 +9,7 @@ class ConfigurablePropDb(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.service.db"]] = None + type: typing.Literal["$.service.db"] = "$.service.db" name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_discord.py b/src/pipedream/types/configurable_prop_discord.py index a1a8fb2..a8e26a6 100644 --- a/src/pipedream/types/configurable_prop_discord.py +++ b/src/pipedream/types/configurable_prop_discord.py @@ -9,7 +9,7 @@ class ConfigurablePropDiscord(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.discord.channel"]] = None + type: typing.Literal["$.discord.channel"] = "$.discord.channel" name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_discord_channel.py b/src/pipedream/types/configurable_prop_discord_channel.py index 8da21a2..358f0a7 100644 --- a/src/pipedream/types/configurable_prop_discord_channel.py +++ b/src/pipedream/types/configurable_prop_discord_channel.py @@ -9,10 +9,8 @@ class ConfigurablePropDiscordChannel(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.discord.channel"]] = None - app_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="appProp")] = pydantic.Field( - default=None - ) + type: typing.Literal["$.discord.channel"] = "$.discord.channel" + app_prop: typing_extensions.Annotated[str, FieldMetadata(alias="appProp")] = pydantic.Field() """ The name of the app prop that provides Discord authentication """ diff --git a/src/pipedream/types/configurable_prop_discord_channel_array.py b/src/pipedream/types/configurable_prop_discord_channel_array.py index b67a467..3e3cb64 100644 --- a/src/pipedream/types/configurable_prop_discord_channel_array.py +++ b/src/pipedream/types/configurable_prop_discord_channel_array.py @@ -9,7 +9,7 @@ class ConfigurablePropDiscordChannelArray(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.discord.channel[]"]] = None + type: typing.Literal["$.discord.channel[]"] = "$.discord.channel[]" app_prop: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="appProp")] = pydantic.Field( default=None ) diff --git a/src/pipedream/types/configurable_prop_http.py b/src/pipedream/types/configurable_prop_http.py index 37e98dd..18eb86d 100644 --- a/src/pipedream/types/configurable_prop_http.py +++ b/src/pipedream/types/configurable_prop_http.py @@ -9,7 +9,7 @@ class ConfigurablePropHttp(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.interface.http"]] = None + type: typing.Literal["$.interface.http"] = "$.interface.http" custom_response: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="customResponse")] = ( pydantic.Field(default=None) ) diff --git a/src/pipedream/types/configurable_prop_integer.py b/src/pipedream/types/configurable_prop_integer.py index 8ffdd1b..557a182 100644 --- a/src/pipedream/types/configurable_prop_integer.py +++ b/src/pipedream/types/configurable_prop_integer.py @@ -9,7 +9,7 @@ class ConfigurablePropInteger(UniversalBaseModel): - type: typing.Optional[typing.Literal["integer"]] = None + type: typing.Literal["integer"] = "integer" min: typing.Optional[int] = pydantic.Field(default=None) """ The minimum value for this integer prop. diff --git a/src/pipedream/types/configurable_prop_integer_array.py b/src/pipedream/types/configurable_prop_integer_array.py index a50d899..d06dd4a 100644 --- a/src/pipedream/types/configurable_prop_integer_array.py +++ b/src/pipedream/types/configurable_prop_integer_array.py @@ -9,7 +9,7 @@ class ConfigurablePropIntegerArray(UniversalBaseModel): - type: typing.Optional[typing.Literal["integer[]"]] = None + type: typing.Literal["integer[]"] = "integer[]" min: typing.Optional[int] = pydantic.Field(default=None) """ The minimum value for integers in this array diff --git a/src/pipedream/types/configurable_prop_object.py b/src/pipedream/types/configurable_prop_object.py index 0bc4e66..f4c6cb2 100644 --- a/src/pipedream/types/configurable_prop_object.py +++ b/src/pipedream/types/configurable_prop_object.py @@ -9,7 +9,7 @@ class ConfigurablePropObject(UniversalBaseModel): - type: typing.Optional[typing.Literal["object"]] = None + type: typing.Literal["object"] = "object" name: str = pydantic.Field() """ When building `configuredProps`, make sure to use this field as the key when setting the prop value diff --git a/src/pipedream/types/configurable_prop_sql.py b/src/pipedream/types/configurable_prop_sql.py index f41481d..1537845 100644 --- a/src/pipedream/types/configurable_prop_sql.py +++ b/src/pipedream/types/configurable_prop_sql.py @@ -10,7 +10,7 @@ class ConfigurablePropSql(UniversalBaseModel): - type: typing.Optional[typing.Literal["sql"]] = None + type: typing.Literal["sql"] = "sql" auth: typing.Optional[ConfigurablePropSqlAuth] = None default: typing.Optional[str] = pydantic.Field(default=None) """ diff --git a/src/pipedream/types/configurable_prop_string.py b/src/pipedream/types/configurable_prop_string.py index 1b8fc0d..13f98b7 100644 --- a/src/pipedream/types/configurable_prop_string.py +++ b/src/pipedream/types/configurable_prop_string.py @@ -9,7 +9,7 @@ class ConfigurablePropString(UniversalBaseModel): - type: typing.Optional[typing.Literal["string"]] = None + type: typing.Literal["string"] = "string" secret: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this prop is a secret and should not be displayed in plain text. diff --git a/src/pipedream/types/configurable_prop_string_array.py b/src/pipedream/types/configurable_prop_string_array.py index 558ec33..168c4c1 100644 --- a/src/pipedream/types/configurable_prop_string_array.py +++ b/src/pipedream/types/configurable_prop_string_array.py @@ -9,7 +9,7 @@ class ConfigurablePropStringArray(UniversalBaseModel): - type: typing.Optional[typing.Literal["string[]"]] = None + type: typing.Literal["string[]"] = "string[]" secret: typing.Optional[bool] = pydantic.Field(default=None) """ If true, this prop is a secret and should not be displayed in plain text. diff --git a/src/pipedream/types/configurable_prop_timer.py b/src/pipedream/types/configurable_prop_timer.py index 7d472bf..34da42c 100644 --- a/src/pipedream/types/configurable_prop_timer.py +++ b/src/pipedream/types/configurable_prop_timer.py @@ -12,7 +12,7 @@ class ConfigurablePropTimer(UniversalBaseModel): - type: typing.Optional[typing.Literal["$.interface.timer"]] = None + type: typing.Literal["$.interface.timer"] = "$.interface.timer" static: typing.Optional[ConfigurablePropTimerStatic] = None default: typing.Optional[ConfigurablePropTimerDefault] = None options: typing.Optional[typing.List[typing.Optional[ConfigurablePropTimerOption]]] = pydantic.Field(default=None) diff --git a/src/pipedream/types/configurable_prop_type.py b/src/pipedream/types/configurable_prop_type.py new file mode 100644 index 0000000..f87ec6d --- /dev/null +++ b/src/pipedream/types/configurable_prop_type.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConfigurablePropType = typing.Union[ + typing.Literal[ + "$.airtable.baseId", + "$.airtable.fieldId", + "$.airtable.tableId", + "$.airtable.viewId", + "$.discord.channel", + "$.interface.apphook", + "$.interface.http", + "$.interface.timer", + "$.service.db", + "alert", + "any", + "app", + "boolean", + "data_store", + "dir", + "http_request", + "integer", + "object", + "sql", + "string", + ], + typing.Any, +] diff --git a/src/pipedream/types/configure_prop_options.py b/src/pipedream/types/configure_prop_options.py new file mode 100644 index 0000000..2200a16 --- /dev/null +++ b/src/pipedream/types/configure_prop_options.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .configure_prop_options_item import ConfigurePropOptionsItem + +ConfigurePropOptions = typing.Optional[typing.List[ConfigurePropOptionsItem]] diff --git a/src/pipedream/types/configure_prop_options_item.py b/src/pipedream/types/configure_prop_options_item.py new file mode 100644 index 0000000..c413487 --- /dev/null +++ b/src/pipedream/types/configure_prop_options_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .prop_option import PropOption +from .prop_option_nested import PropOptionNested + +ConfigurePropOptionsItem = typing.Union[PropOption, PropOptionNested] diff --git a/src/pipedream/types/configure_prop_opts.py b/src/pipedream/types/configure_prop_opts.py index f24a4e0..2566173 100644 --- a/src/pipedream/types/configure_prop_opts.py +++ b/src/pipedream/types/configure_prop_opts.py @@ -4,6 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .configured_props import ConfiguredProps class ConfigurePropOpts(UniversalBaseModel): @@ -31,11 +32,7 @@ class ConfigurePropOpts(UniversalBaseModel): Whether this operation should block until completion """ - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) - """ - The configured properties for the component - """ - + configured_props: typing.Optional[ConfiguredProps] = None dynamic_props_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID for dynamic props diff --git a/src/pipedream/types/configure_prop_response.py b/src/pipedream/types/configure_prop_response.py index c2423d9..188645d 100644 --- a/src/pipedream/types/configure_prop_response.py +++ b/src/pipedream/types/configure_prop_response.py @@ -4,7 +4,8 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .prop_option import PropOption +from .configure_prop_options import ConfigurePropOptions +from .observation import Observation class ConfigurePropResponse(UniversalBaseModel): @@ -12,21 +13,13 @@ class ConfigurePropResponse(UniversalBaseModel): Response received after configuring a component's prop """ - options: typing.Optional[typing.List[PropOption]] = pydantic.Field(default=None) - """ - Available options (with labels) for the configured prop - """ - + options: typing.Optional[ConfigurePropOptions] = None string_options: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Available options for the configured prop """ - observations: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) - """ - Any logs produced during the configuration of the prop - """ - + observations: typing.Optional[typing.List[Observation]] = None context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) """ New context after configuring the prop diff --git a/src/pipedream/types/configured_prop_value.py b/src/pipedream/types/configured_prop_value.py new file mode 100644 index 0000000..0266ac2 --- /dev/null +++ b/src/pipedream/types/configured_prop_value.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .configured_prop_value_any import ConfiguredPropValueAny +from .configured_prop_value_app import ConfiguredPropValueApp +from .configured_prop_value_boolean import ConfiguredPropValueBoolean +from .configured_prop_value_integer import ConfiguredPropValueInteger +from .configured_prop_value_object import ConfiguredPropValueObject +from .configured_prop_value_sql import ConfiguredPropValueSql +from .configured_prop_value_string import ConfiguredPropValueString +from .configured_prop_value_string_array import ConfiguredPropValueStringArray + +ConfiguredPropValue = typing.Union[ + ConfiguredPropValueAny, + ConfiguredPropValueApp, + ConfiguredPropValueBoolean, + ConfiguredPropValueInteger, + ConfiguredPropValueObject, + ConfiguredPropValueSql, + ConfiguredPropValueString, + ConfiguredPropValueStringArray, +] diff --git a/src/pipedream/types/configured_prop_value_any.py b/src/pipedream/types/configured_prop_value_any.py new file mode 100644 index 0000000..98361e0 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_any.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConfiguredPropValueAny = typing.Optional[typing.Any] diff --git a/src/pipedream/types/configured_prop_value_app.py b/src/pipedream/types/configured_prop_value_app.py new file mode 100644 index 0000000..acafb83 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_app.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .account_id import AccountId + + +class ConfiguredPropValueApp(UniversalBaseModel): + auth_provision_id: typing_extensions.Annotated[AccountId, FieldMetadata(alias="authProvisionId")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/configured_prop_value_boolean.py b/src/pipedream/types/configured_prop_value_boolean.py new file mode 100644 index 0000000..9d6f6e1 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_boolean.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +ConfiguredPropValueBoolean = bool diff --git a/src/pipedream/types/configured_prop_value_integer.py b/src/pipedream/types/configured_prop_value_integer.py new file mode 100644 index 0000000..600d5e2 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_integer.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +ConfiguredPropValueInteger = float diff --git a/src/pipedream/types/configured_prop_value_object.py b/src/pipedream/types/configured_prop_value_object.py new file mode 100644 index 0000000..3cab1eb --- /dev/null +++ b/src/pipedream/types/configured_prop_value_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConfiguredPropValueObject = typing.Dict[str, typing.Optional[typing.Any]] diff --git a/src/pipedream/types/configured_prop_value_sql.py b/src/pipedream/types/configured_prop_value_sql.py new file mode 100644 index 0000000..81eb9ad --- /dev/null +++ b/src/pipedream/types/configured_prop_value_sql.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata + + +class ConfiguredPropValueSql(UniversalBaseModel): + value: str = pydantic.Field() + """ + The raw SQL query, as provided by the user + """ + + query: str = pydantic.Field() + """ + The SQL query to execute + """ + + params: typing.List[str] = pydantic.Field() + """ + The list of parameters for the prepared statement + """ + + use_prepared_statements: typing_extensions.Annotated[bool, FieldMetadata(alias="usePreparedStatements")] = ( + pydantic.Field() + ) + """ + Whether to use prepared statements for the query or not + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/configured_prop_value_string.py b/src/pipedream/types/configured_prop_value_string.py new file mode 100644 index 0000000..1bbe935 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_string.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +ConfiguredPropValueString = str diff --git a/src/pipedream/types/configured_prop_value_string_array.py b/src/pipedream/types/configured_prop_value_string_array.py new file mode 100644 index 0000000..45af143 --- /dev/null +++ b/src/pipedream/types/configured_prop_value_string_array.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConfiguredPropValueStringArray = typing.List[str] diff --git a/src/pipedream/types/configured_props.py b/src/pipedream/types/configured_props.py new file mode 100644 index 0000000..230b292 --- /dev/null +++ b/src/pipedream/types/configured_props.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .configured_prop_value import ConfiguredPropValue + +ConfiguredProps = typing.Dict[str, ConfiguredPropValue] diff --git a/src/pipedream/types/deployed_component.py b/src/pipedream/types/deployed_component.py index 7413f3f..9cbbe8a 100644 --- a/src/pipedream/types/deployed_component.py +++ b/src/pipedream/types/deployed_component.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .configurable_prop import ConfigurableProp +from .configured_props import ConfiguredProps class DeployedComponent(UniversalBaseModel): @@ -32,11 +33,7 @@ class DeployedComponent(UniversalBaseModel): The configurable properties of the component """ - configured_props: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() - """ - The configured properties of the component - """ - + configured_props: ConfiguredProps active: bool = pydantic.Field() """ Whether the deployed component is active diff --git a/src/pipedream/types/observation.py b/src/pipedream/types/observation.py new file mode 100644 index 0000000..83235d3 --- /dev/null +++ b/src/pipedream/types/observation.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .observation_error import ObservationError + + +class Observation(UniversalBaseModel): + """ + Any logs produced during the configuration of the prop + """ + + err: typing.Optional[ObservationError] = None + k: str = pydantic.Field() + """ + The source of the log (e.g. `console.log`) + """ + + msg: typing.Optional[str] = pydantic.Field(default=None) + """ + The log message + """ + + ts: float = pydantic.Field() + """ + The time at which the log was produced, as milliseconds since the epoch + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/observation_error.py b/src/pipedream/types/observation_error.py new file mode 100644 index 0000000..11ada30 --- /dev/null +++ b/src/pipedream/types/observation_error.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ObservationError(UniversalBaseModel): + """ + Details about an observed error message + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the error/exception + """ + + message: typing.Optional[str] = pydantic.Field(default=None) + """ + The error message + """ + + stack: typing.Optional[str] = pydantic.Field(default=None) + """ + The stack trace of the error + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/prop_option_nested.py b/src/pipedream/types/prop_option_nested.py new file mode 100644 index 0000000..806bf7c --- /dev/null +++ b/src/pipedream/types/prop_option_nested.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .prop_option import PropOption + + +class PropOptionNested(UniversalBaseModel): + """ + A configuration option for a component's prop (nested under `__lv`) + """ + + lv: typing_extensions.Annotated[PropOption, FieldMetadata(alias="__lv")] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/pipedream/types/reload_props_opts.py b/src/pipedream/types/reload_props_opts.py index 909833f..124eb34 100644 --- a/src/pipedream/types/reload_props_opts.py +++ b/src/pipedream/types/reload_props_opts.py @@ -4,6 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .configured_props import ConfiguredProps class ReloadPropsOpts(UniversalBaseModel): @@ -26,11 +27,7 @@ class ReloadPropsOpts(UniversalBaseModel): Whether this operation should block until completion """ - configured_props: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) - """ - The configured properties for the component - """ - + configured_props: typing.Optional[ConfiguredProps] = None dynamic_props_id: typing.Optional[str] = pydantic.Field(default=None) """ The ID for dynamic props diff --git a/src/pipedream/types/reload_props_response.py b/src/pipedream/types/reload_props_response.py index bb7e53c..6a138c5 100644 --- a/src/pipedream/types/reload_props_response.py +++ b/src/pipedream/types/reload_props_response.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata from .dynamic_props import DynamicProps +from .observation import Observation class ReloadPropsResponse(UniversalBaseModel): @@ -14,11 +15,7 @@ class ReloadPropsResponse(UniversalBaseModel): Response from reloading component props """ - observations: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) - """ - Any logs produced during the configuration of the prop - """ - + observations: typing.Optional[typing.List[Observation]] = None errors: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Any errors that occurred during configuration