# This file was auto-generated by Fern from our API Definition.

import typing

from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.execution_return_mode import ExecutionReturnMode
from ..types.git_sync_response import GitSyncResponse
from ..types.git_upload_response import GitUploadResponse
from ..types.manual_upload_response import ManualUploadResponse
from ..types.streamline_automation_list_response import StreamlineAutomationListResponse
from ..types.streamline_automation_response import StreamlineAutomationResponse
from ..types.streamline_execution_list_response import StreamlineExecutionListResponse
from ..types.streamline_execution_response import StreamlineExecutionResponse
from ..types.streamline_git_sync_job_list_response import StreamlineGitSyncJobListResponse
from .raw_client import AsyncRawStreamlineClient, RawStreamlineClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class StreamlineClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawStreamlineClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawStreamlineClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawStreamlineClient
        """
        return self._raw_client

    def list_automations(
        self,
        *,
        organization_id: str,
        include_inactive: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineAutomationListResponse:
        """
        List automations for organization.

        Parameters
        ----------
        organization_id : str

        include_inactive : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.list_automations(
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.list_automations(
            organization_id=organization_id, include_inactive=include_inactive, request_options=request_options
        )
        return _response.data

    def get_automation(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineAutomationResponse:
        """
        Get automation details.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_automation(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.get_automation(automation_id, request_options=request_options)
        return _response.data

    def delete_automation(self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.delete_automation(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.delete_automation(automation_id, request_options=request_options)
        return _response.data

    def toggle_schedule(
        self, automation_id: str, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineAutomationResponse:
        """
        Enable/disable automation schedule.

        Parameters
        ----------
        automation_id : str

        enabled : bool
            Whether to enable or disable schedule

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.toggle_schedule(
            automation_id="automation_id",
            enabled=True,
        )
        """
        _response = self._raw_client.toggle_schedule(automation_id, enabled=enabled, request_options=request_options)
        return _response.data

    def get_sync_jobs(
        self,
        automation_id: str,
        *,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineGitSyncJobListResponse:
        """
        Get Git sync history for an automation.

        Parameters
        ----------
        automation_id : str

        limit : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineGitSyncJobListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_sync_jobs(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.get_sync_jobs(automation_id, limit=limit, request_options=request_options)
        return _response.data

    def get_executions(
        self,
        automation_id: str,
        *,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineExecutionListResponse:
        """
        Get execution history for an automation.

        Parameters
        ----------
        automation_id : str

        limit : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineExecutionListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_executions(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.get_executions(automation_id, limit=limit, request_options=request_options)
        return _response.data

    def upload_from_git(
        self,
        *,
        organization_id: str,
        git_url: str,
        automation_name: str,
        branch: typing.Optional[str] = OMIT,
        git_access_token: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GitUploadResponse:
        """
        Upload automation from Git repository.

        Parameters
        ----------
        organization_id : str

        git_url : str
            Git repository URL

        automation_name : str
            Automation name

        branch : typing.Optional[str]
            Git branch

        git_access_token : typing.Optional[str]
            Git access token for private repositories

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GitUploadResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.upload_from_git(
            organization_id="organization_id",
            git_url="git_url",
            automation_name="automation_name",
        )
        """
        _response = self._raw_client.upload_from_git(
            organization_id=organization_id,
            git_url=git_url,
            automation_name=automation_name,
            branch=branch,
            git_access_token=git_access_token,
            request_options=request_options,
        )
        return _response.data

    def sync_git_automation(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GitSyncResponse:
        """
        Manually trigger Git sync for automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GitSyncResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.sync_git_automation(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.sync_git_automation(automation_id, request_options=request_options)
        return _response.data

    def upload_manual(
        self,
        *,
        file: core.File,
        automation_name: str,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ManualUploadResponse:
        """
        Upload automation via ZIP file.

        Parameters
        ----------
        file : core.File
            See core.File for more documentation

        automation_name : str

        organization_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ManualUploadResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.upload_manual(
            automation_name="automation_name",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.upload_manual(
            file=file, automation_name=automation_name, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def get_project_template(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
        """
        Download a ZIP file of the Streamline project template.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_project_template()
        """
        _response = self._raw_client.get_project_template(request_options=request_options)
        return _response.data

    def get_repository_template(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
        """
        Download a ZIP file of the Streamline repository template (multi-automation).

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_repository_template()
        """
        _response = self._raw_client.get_repository_template(request_options=request_options)
        return _response.data

    def execute_automation(
        self,
        automation_id: str,
        *,
        parameters: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        return_mode: typing.Optional[ExecutionReturnMode] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Execute automation with parameters.

        Supports two return modes:
        - poll (default): Returns 202 Accepted with execution_id for polling
        - wait: Waits for completion and returns 200 OK with result

        Parameters
        ----------
        automation_id : str

        parameters : typing.Optional[typing.Dict[str, typing.Any]]
            Execution parameters

        return_mode : typing.Optional[ExecutionReturnMode]
            Return mode: poll (async 202) or wait (sync 200)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.execute_automation(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.execute_automation(
            automation_id, parameters=parameters, return_mode=return_mode, request_options=request_options
        )
        return _response.data

    def get_execution(
        self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineExecutionResponse:
        """
        Get execution details by ID.

        Parameters
        ----------
        execution_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineExecutionResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.get_execution(
            execution_id="execution_id",
        )
        """
        _response = self._raw_client.get_execution(execution_id, request_options=request_options)
        return _response.data

    def set_schedule(
        self,
        automation_id: str,
        *,
        cron_expression: str,
        timezone: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineAutomationResponse:
        """
        Set cron schedule for automation.

        The automation will be executed automatically based on the cron expression.

        Parameters
        ----------
        automation_id : str

        cron_expression : str
            Cron expression (e.g., '0 9 * * *' for daily at 9am)

        timezone : typing.Optional[str]
            Timezone for schedule (e.g., 'America/New_York')

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.set_schedule(
            automation_id="automation_id",
            cron_expression="cron_expression",
        )
        """
        _response = self._raw_client.set_schedule(
            automation_id, cron_expression=cron_expression, timezone=timezone, request_options=request_options
        )
        return _response.data

    def remove_schedule(self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Remove schedule from automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.streamline.remove_schedule(
            automation_id="automation_id",
        )
        """
        _response = self._raw_client.remove_schedule(automation_id, request_options=request_options)
        return _response.data


class AsyncStreamlineClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawStreamlineClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawStreamlineClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawStreamlineClient
        """
        return self._raw_client

    async def list_automations(
        self,
        *,
        organization_id: str,
        include_inactive: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineAutomationListResponse:
        """
        List automations for organization.

        Parameters
        ----------
        organization_id : str

        include_inactive : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.list_automations(
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_automations(
            organization_id=organization_id, include_inactive=include_inactive, request_options=request_options
        )
        return _response.data

    async def get_automation(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineAutomationResponse:
        """
        Get automation details.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_automation(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_automation(automation_id, request_options=request_options)
        return _response.data

    async def delete_automation(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Delete automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.delete_automation(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete_automation(automation_id, request_options=request_options)
        return _response.data

    async def toggle_schedule(
        self, automation_id: str, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineAutomationResponse:
        """
        Enable/disable automation schedule.

        Parameters
        ----------
        automation_id : str

        enabled : bool
            Whether to enable or disable schedule

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.toggle_schedule(
                automation_id="automation_id",
                enabled=True,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.toggle_schedule(
            automation_id, enabled=enabled, request_options=request_options
        )
        return _response.data

    async def get_sync_jobs(
        self,
        automation_id: str,
        *,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineGitSyncJobListResponse:
        """
        Get Git sync history for an automation.

        Parameters
        ----------
        automation_id : str

        limit : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineGitSyncJobListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_sync_jobs(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_sync_jobs(automation_id, limit=limit, request_options=request_options)
        return _response.data

    async def get_executions(
        self,
        automation_id: str,
        *,
        limit: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineExecutionListResponse:
        """
        Get execution history for an automation.

        Parameters
        ----------
        automation_id : str

        limit : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineExecutionListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_executions(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_executions(automation_id, limit=limit, request_options=request_options)
        return _response.data

    async def upload_from_git(
        self,
        *,
        organization_id: str,
        git_url: str,
        automation_name: str,
        branch: typing.Optional[str] = OMIT,
        git_access_token: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GitUploadResponse:
        """
        Upload automation from Git repository.

        Parameters
        ----------
        organization_id : str

        git_url : str
            Git repository URL

        automation_name : str
            Automation name

        branch : typing.Optional[str]
            Git branch

        git_access_token : typing.Optional[str]
            Git access token for private repositories

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GitUploadResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.upload_from_git(
                organization_id="organization_id",
                git_url="git_url",
                automation_name="automation_name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.upload_from_git(
            organization_id=organization_id,
            git_url=git_url,
            automation_name=automation_name,
            branch=branch,
            git_access_token=git_access_token,
            request_options=request_options,
        )
        return _response.data

    async def sync_git_automation(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GitSyncResponse:
        """
        Manually trigger Git sync for automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GitSyncResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.sync_git_automation(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.sync_git_automation(automation_id, request_options=request_options)
        return _response.data

    async def upload_manual(
        self,
        *,
        file: core.File,
        automation_name: str,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ManualUploadResponse:
        """
        Upload automation via ZIP file.

        Parameters
        ----------
        file : core.File
            See core.File for more documentation

        automation_name : str

        organization_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ManualUploadResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.upload_manual(
                automation_name="automation_name",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.upload_manual(
            file=file, automation_name=automation_name, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def get_project_template(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
        """
        Download a ZIP file of the Streamline project template.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_project_template()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_project_template(request_options=request_options)
        return _response.data

    async def get_repository_template(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
        """
        Download a ZIP file of the Streamline repository template (multi-automation).

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_repository_template()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_repository_template(request_options=request_options)
        return _response.data

    async def execute_automation(
        self,
        automation_id: str,
        *,
        parameters: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        return_mode: typing.Optional[ExecutionReturnMode] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Execute automation with parameters.

        Supports two return modes:
        - poll (default): Returns 202 Accepted with execution_id for polling
        - wait: Waits for completion and returns 200 OK with result

        Parameters
        ----------
        automation_id : str

        parameters : typing.Optional[typing.Dict[str, typing.Any]]
            Execution parameters

        return_mode : typing.Optional[ExecutionReturnMode]
            Return mode: poll (async 202) or wait (sync 200)

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.execute_automation(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.execute_automation(
            automation_id, parameters=parameters, return_mode=return_mode, request_options=request_options
        )
        return _response.data

    async def get_execution(
        self, execution_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> StreamlineExecutionResponse:
        """
        Get execution details by ID.

        Parameters
        ----------
        execution_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineExecutionResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.get_execution(
                execution_id="execution_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_execution(execution_id, request_options=request_options)
        return _response.data

    async def set_schedule(
        self,
        automation_id: str,
        *,
        cron_expression: str,
        timezone: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> StreamlineAutomationResponse:
        """
        Set cron schedule for automation.

        The automation will be executed automatically based on the cron expression.

        Parameters
        ----------
        automation_id : str

        cron_expression : str
            Cron expression (e.g., '0 9 * * *' for daily at 9am)

        timezone : typing.Optional[str]
            Timezone for schedule (e.g., 'America/New_York')

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        StreamlineAutomationResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.set_schedule(
                automation_id="automation_id",
                cron_expression="cron_expression",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.set_schedule(
            automation_id, cron_expression=cron_expression, timezone=timezone, request_options=request_options
        )
        return _response.data

    async def remove_schedule(
        self, automation_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove schedule from automation.

        Parameters
        ----------
        automation_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.streamline.remove_schedule(
                automation_id="automation_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.remove_schedule(automation_id, request_options=request_options)
        return _response.data
