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

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.src_handlers_update_workflow_revision_response import SrcHandlersUpdateWorkflowRevisionResponse
from .raw_client import AsyncRawWorkflowRevisionsClient, RawWorkflowRevisionsClient

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


class WorkflowRevisionsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawWorkflowRevisionsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawWorkflowRevisionsClient
        """
        return self._raw_client

    def update(
        self,
        workflow_id: str,
        revision_id: str,
        *,
        name: str,
        description: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SrcHandlersUpdateWorkflowRevisionResponse:
        """
        Parameters
        ----------
        workflow_id : str

        revision_id : str

        name : str

        description : typing.Optional[str]

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

        Returns
        -------
        SrcHandlersUpdateWorkflowRevisionResponse
            Successful Response

        Examples
        --------
        from scoutos import Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.workflow_revisions.update(
            workflow_id="workflow_id",
            revision_id="revision_id",
            name="name",
        )
        """
        _response = self._raw_client.update(
            workflow_id, revision_id, name=name, description=description, request_options=request_options
        )
        return _response.data


class AsyncWorkflowRevisionsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawWorkflowRevisionsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawWorkflowRevisionsClient
        """
        return self._raw_client

    async def update(
        self,
        workflow_id: str,
        revision_id: str,
        *,
        name: str,
        description: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SrcHandlersUpdateWorkflowRevisionResponse:
        """
        Parameters
        ----------
        workflow_id : str

        revision_id : str

        name : str

        description : typing.Optional[str]

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

        Returns
        -------
        SrcHandlersUpdateWorkflowRevisionResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.workflow_revisions.update(
                workflow_id="workflow_id",
                revision_id="revision_id",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            workflow_id, revision_id, name=name, description=description, request_options=request_options
        )
        return _response.data
