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

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.employee import Employee
from ..types.employee_status import EmployeeStatus
from ..types.get_employee_response import GetEmployeeResponse
from .raw_client import AsyncRawEmployeesClient, RawEmployeesClient


class EmployeesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawEmployeesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawEmployeesClient
        """
        return self._raw_client

    def list(
        self,
        *,
        location_id: typing.Optional[str] = None,
        status: typing.Optional[EmployeeStatus] = None,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SyncPager[Employee]:
        """


        Parameters
        ----------
        location_id : typing.Optional[str]


        status : typing.Optional[EmployeeStatus]
            Specifies the EmployeeStatus to filter the employee by.

        limit : typing.Optional[int]
            The number of employees to be returned on each page.

        cursor : typing.Optional[str]
            The token required to retrieve the specified page of results.

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

        Returns
        -------
        SyncPager[Employee]
            Success

        Examples
        --------
        from square import Square

        client = Square(
            token="YOUR_TOKEN",
        )
        response = client.employees.list()
        for item in response:
            yield item
        # alternatively, you can paginate page-by-page
        for page in response.iter_pages():
            yield page
        """
        return self._raw_client.list(
            location_id=location_id, status=status, limit=limit, cursor=cursor, request_options=request_options
        )

    def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeResponse:
        """


        Parameters
        ----------
        id : str
            UUID for the employee that was requested.

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

        Returns
        -------
        GetEmployeeResponse
            Success

        Examples
        --------
        from square import Square

        client = Square(
            token="YOUR_TOKEN",
        )
        client.employees.get(
            id="id",
        )
        """
        _response = self._raw_client.get(id, request_options=request_options)
        return _response.data


class AsyncEmployeesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawEmployeesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawEmployeesClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        location_id: typing.Optional[str] = None,
        status: typing.Optional[EmployeeStatus] = None,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncPager[Employee]:
        """


        Parameters
        ----------
        location_id : typing.Optional[str]


        status : typing.Optional[EmployeeStatus]
            Specifies the EmployeeStatus to filter the employee by.

        limit : typing.Optional[int]
            The number of employees to be returned on each page.

        cursor : typing.Optional[str]
            The token required to retrieve the specified page of results.

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

        Returns
        -------
        AsyncPager[Employee]
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            response = await client.employees.list()
            async for item in response:
                yield item

            # alternatively, you can paginate page-by-page
            async for page in response.iter_pages():
                yield page


        asyncio.run(main())
        """
        return await self._raw_client.list(
            location_id=location_id, status=status, limit=limit, cursor=cursor, request_options=request_options
        )

    async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetEmployeeResponse:
        """


        Parameters
        ----------
        id : str
            UUID for the employee that was requested.

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

        Returns
        -------
        GetEmployeeResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.employees.get(
                id="id",
            )


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