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

import typing
from ..core.client_wrapper import SyncClientWrapper
from .raw_client import RawTeamMembersClient
from .wage_setting.client import WageSettingClient
from ..requests.team_member import TeamMemberParams
from ..core.request_options import RequestOptions
from ..types.create_team_member_response import CreateTeamMemberResponse
from ..requests.create_team_member_request import CreateTeamMemberRequestParams
from ..types.batch_create_team_members_response import BatchCreateTeamMembersResponse
from ..requests.update_team_member_request import UpdateTeamMemberRequestParams
from ..types.batch_update_team_members_response import BatchUpdateTeamMembersResponse
from ..requests.search_team_members_query import SearchTeamMembersQueryParams
from ..types.search_team_members_response import SearchTeamMembersResponse
from ..types.get_team_member_response import GetTeamMemberResponse
from ..types.update_team_member_response import UpdateTeamMemberResponse
from ..core.client_wrapper import AsyncClientWrapper
from .raw_client import AsyncRawTeamMembersClient
from .wage_setting.client import AsyncWageSettingClient

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


class TeamMembersClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawTeamMembersClient(client_wrapper=client_wrapper)
        self.wage_setting = WageSettingClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawTeamMembersClient
        """
        return self._raw_client

    def create(
        self,
        *,
        idempotency_key: typing.Optional[str] = OMIT,
        team_member: typing.Optional[TeamMemberParams] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateTeamMemberResponse:
        """
        Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates.
        You must provide the following values in your request to this endpoint:
        - `given_name`
        - `family_name`

        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember).

        Parameters
        ----------
        idempotency_key : typing.Optional[str]
            A unique string that identifies this `CreateTeamMember` request.
            Keys can be any valid string, but must be unique for every request.
            For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).

            The minimum length is 1 and the maximum length is 45.

        team_member : typing.Optional[TeamMemberParams]
            **Required** The data used to create the `TeamMember` object. If you include `wage_setting`, you must provide
            `job_id` for each job assignment. To get job IDs, call [ListJobs](api-endpoint:Team-ListJobs).

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

        Returns
        -------
        CreateTeamMemberResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.create(
            idempotency_key="idempotency-key-0",
            team_member={
                "reference_id": "reference_id_1",
                "status": "ACTIVE",
                "given_name": "Joe",
                "family_name": "Doe",
                "email_address": "joe_doe@gmail.com",
                "phone_number": "+14159283333",
                "assigned_locations": {
                    "assignment_type": "EXPLICIT_LOCATIONS",
                    "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                },
                "wage_setting": {
                    "job_assignments": [
                        {
                            "pay_type": "SALARY",
                            "annual_rate": {"amount": 3000000, "currency": "USD"},
                            "weekly_hours": 40,
                            "job_id": "FjS8x95cqHiMenw4f1NAUH4P",
                        },
                        {
                            "pay_type": "HOURLY",
                            "hourly_rate": {"amount": 2000, "currency": "USD"},
                            "job_id": "VDNpRv8da51NU8qZFC5zDWpF",
                        },
                    ],
                    "is_overtime_exempt": True,
                },
            },
        )
        """
        response = self._raw_client.create(
            idempotency_key=idempotency_key, team_member=team_member, request_options=request_options
        )
        return response.data

    def batch_create(
        self,
        *,
        team_members: typing.Dict[str, CreateTeamMemberRequestParams],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BatchCreateTeamMembersResponse:
        """
        Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates.
        This process is non-transactional and processes as much of the request as possible. If one of the creates in
        the request cannot be successfully processed, the request is not marked as failed, but the body of the response
        contains explicit error information for the failed create.

        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members).

        Parameters
        ----------
        team_members : typing.Dict[str, CreateTeamMemberRequestParams]
            The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.
            The maximum number of create objects is 25.

            If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,
            call [ListJobs](api-endpoint:Team-ListJobs).

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

        Returns
        -------
        BatchCreateTeamMembersResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.batch_create(
            team_members={
                "idempotency-key-1": {
                    "team_member": {
                        "reference_id": "reference_id_1",
                        "given_name": "Joe",
                        "family_name": "Doe",
                        "email_address": "joe_doe@gmail.com",
                        "phone_number": "+14159283333",
                        "assigned_locations": {
                            "assignment_type": "EXPLICIT_LOCATIONS",
                            "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                        },
                    }
                },
                "idempotency-key-2": {
                    "team_member": {
                        "reference_id": "reference_id_2",
                        "given_name": "Jane",
                        "family_name": "Smith",
                        "email_address": "jane_smith@gmail.com",
                        "phone_number": "+14159223334",
                        "assigned_locations": {
                            "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS"
                        },
                    }
                },
            },
        )
        """
        response = self._raw_client.batch_create(team_members=team_members, request_options=request_options)
        return response.data

    def batch_update(
        self,
        *,
        team_members: typing.Dict[str, UpdateTeamMemberRequestParams],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BatchUpdateTeamMembersResponse:
        """
        Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates.
        This process is non-transactional and processes as much of the request as possible. If one of the updates in
        the request cannot be successfully processed, the request is not marked as failed, but the body of the response
        contains explicit error information for the failed update.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members).

        Parameters
        ----------
        team_members : typing.Dict[str, UpdateTeamMemberRequestParams]
            The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`.
            The maximum number of update objects is 25.

            For each team member, include the fields to add, change, or clear. Fields can be cleared using a null value.
            To update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed,
            call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.

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

        Returns
        -------
        BatchUpdateTeamMembersResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.batch_update(
            team_members={
                "AFMwA08kR-MIF-3Vs0OE": {
                    "team_member": {
                        "reference_id": "reference_id_2",
                        "is_owner": False,
                        "status": "ACTIVE",
                        "given_name": "Jane",
                        "family_name": "Smith",
                        "email_address": "jane_smith@gmail.com",
                        "phone_number": "+14159223334",
                        "assigned_locations": {
                            "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS"
                        },
                    }
                },
                "fpgteZNMaf0qOK-a4t6P": {
                    "team_member": {
                        "reference_id": "reference_id_1",
                        "is_owner": False,
                        "status": "ACTIVE",
                        "given_name": "Joe",
                        "family_name": "Doe",
                        "email_address": "joe_doe@gmail.com",
                        "phone_number": "+14159283333",
                        "assigned_locations": {
                            "assignment_type": "EXPLICIT_LOCATIONS",
                            "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                        },
                    }
                },
            },
        )
        """
        response = self._raw_client.batch_update(team_members=team_members, request_options=request_options)
        return response.data

    def search(
        self,
        *,
        query: typing.Optional[SearchTeamMembersQueryParams] = OMIT,
        limit: typing.Optional[int] = OMIT,
        cursor: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SearchTeamMembersResponse:
        """
        Returns a paginated list of `TeamMember` objects for a business.
        The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether
        the team member is the Square account owner.

        Parameters
        ----------
        query : typing.Optional[SearchTeamMembersQueryParams]
            The query parameters.

        limit : typing.Optional[int]
            The maximum number of `TeamMember` objects in a page (100 by default).

        cursor : typing.Optional[str]
            The opaque cursor for fetching the next page. For more information, see
            [pagination](https://developer.squareup.com/docs/working-with-apis/pagination).

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

        Returns
        -------
        SearchTeamMembersResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.search(
            query={"filter": {"location_ids": ["0G5P3VGACMMQZ"], "status": "ACTIVE"}},
            limit=10,
        )
        """
        response = self._raw_client.search(query=query, limit=limit, cursor=cursor, request_options=request_options)
        return response.data

    def get(
        self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetTeamMemberResponse:
        """
        Retrieves a `TeamMember` object for the given `TeamMember.id`.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member).

        Parameters
        ----------
        team_member_id : str
            The ID of the team member to retrieve.

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

        Returns
        -------
        GetTeamMemberResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.get(
            team_member_id="team_member_id",
        )
        """
        response = self._raw_client.get(team_member_id, request_options=request_options)
        return response.data

    def update(
        self,
        team_member_id: str,
        *,
        team_member: typing.Optional[TeamMemberParams] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateTeamMemberResponse:
        """
        Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member).

        Parameters
        ----------
        team_member_id : str
            The ID of the team member to update.

        team_member : typing.Optional[TeamMemberParams]
            The team member fields to add, change, or clear. Fields can be cleared using a null value. To update
            `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed, call
            [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.

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

        Returns
        -------
        UpdateTeamMemberResponse
            Success

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

        client = Square(
            token="YOUR_TOKEN",
        )
        client.team_members.update(
            team_member_id="team_member_id",
            team_member={
                "reference_id": "reference_id_1",
                "status": "ACTIVE",
                "given_name": "Joe",
                "family_name": "Doe",
                "email_address": "joe_doe@gmail.com",
                "phone_number": "+14159283333",
                "assigned_locations": {
                    "assignment_type": "EXPLICIT_LOCATIONS",
                    "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                },
                "wage_setting": {
                    "job_assignments": [
                        {
                            "pay_type": "SALARY",
                            "annual_rate": {"amount": 3000000, "currency": "USD"},
                            "weekly_hours": 40,
                            "job_id": "FjS8x95cqHiMenw4f1NAUH4P",
                        },
                        {
                            "pay_type": "HOURLY",
                            "hourly_rate": {"amount": 1200, "currency": "USD"},
                            "job_id": "VDNpRv8da51NU8qZFC5zDWpF",
                        },
                    ],
                    "is_overtime_exempt": True,
                },
            },
        )
        """
        response = self._raw_client.update(team_member_id, team_member=team_member, request_options=request_options)
        return response.data


class AsyncTeamMembersClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawTeamMembersClient(client_wrapper=client_wrapper)
        self.wage_setting = AsyncWageSettingClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawTeamMembersClient
        """
        return self._raw_client

    async def create(
        self,
        *,
        idempotency_key: typing.Optional[str] = OMIT,
        team_member: typing.Optional[TeamMemberParams] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CreateTeamMemberResponse:
        """
        Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates.
        You must provide the following values in your request to this endpoint:
        - `given_name`
        - `family_name`

        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember).

        Parameters
        ----------
        idempotency_key : typing.Optional[str]
            A unique string that identifies this `CreateTeamMember` request.
            Keys can be any valid string, but must be unique for every request.
            For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).

            The minimum length is 1 and the maximum length is 45.

        team_member : typing.Optional[TeamMemberParams]
            **Required** The data used to create the `TeamMember` object. If you include `wage_setting`, you must provide
            `job_id` for each job assignment. To get job IDs, call [ListJobs](api-endpoint:Team-ListJobs).

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

        Returns
        -------
        CreateTeamMemberResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.team_members.create(
                idempotency_key="idempotency-key-0",
                team_member={
                    "reference_id": "reference_id_1",
                    "status": "ACTIVE",
                    "given_name": "Joe",
                    "family_name": "Doe",
                    "email_address": "joe_doe@gmail.com",
                    "phone_number": "+14159283333",
                    "assigned_locations": {
                        "assignment_type": "EXPLICIT_LOCATIONS",
                        "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                    },
                    "wage_setting": {
                        "job_assignments": [
                            {
                                "pay_type": "SALARY",
                                "annual_rate": {"amount": 3000000, "currency": "USD"},
                                "weekly_hours": 40,
                                "job_id": "FjS8x95cqHiMenw4f1NAUH4P",
                            },
                            {
                                "pay_type": "HOURLY",
                                "hourly_rate": {"amount": 2000, "currency": "USD"},
                                "job_id": "VDNpRv8da51NU8qZFC5zDWpF",
                            },
                        ],
                        "is_overtime_exempt": True,
                    },
                },
            )


        asyncio.run(main())
        """
        response = await self._raw_client.create(
            idempotency_key=idempotency_key, team_member=team_member, request_options=request_options
        )
        return response.data

    async def batch_create(
        self,
        *,
        team_members: typing.Dict[str, CreateTeamMemberRequestParams],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BatchCreateTeamMembersResponse:
        """
        Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates.
        This process is non-transactional and processes as much of the request as possible. If one of the creates in
        the request cannot be successfully processed, the request is not marked as failed, but the body of the response
        contains explicit error information for the failed create.

        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members).

        Parameters
        ----------
        team_members : typing.Dict[str, CreateTeamMemberRequestParams]
            The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.
            The maximum number of create objects is 25.

            If you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,
            call [ListJobs](api-endpoint:Team-ListJobs).

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

        Returns
        -------
        BatchCreateTeamMembersResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.team_members.batch_create(
                team_members={
                    "idempotency-key-1": {
                        "team_member": {
                            "reference_id": "reference_id_1",
                            "given_name": "Joe",
                            "family_name": "Doe",
                            "email_address": "joe_doe@gmail.com",
                            "phone_number": "+14159283333",
                            "assigned_locations": {
                                "assignment_type": "EXPLICIT_LOCATIONS",
                                "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                            },
                        }
                    },
                    "idempotency-key-2": {
                        "team_member": {
                            "reference_id": "reference_id_2",
                            "given_name": "Jane",
                            "family_name": "Smith",
                            "email_address": "jane_smith@gmail.com",
                            "phone_number": "+14159223334",
                            "assigned_locations": {
                                "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS"
                            },
                        }
                    },
                },
            )


        asyncio.run(main())
        """
        response = await self._raw_client.batch_create(team_members=team_members, request_options=request_options)
        return response.data

    async def batch_update(
        self,
        *,
        team_members: typing.Dict[str, UpdateTeamMemberRequestParams],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BatchUpdateTeamMembersResponse:
        """
        Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates.
        This process is non-transactional and processes as much of the request as possible. If one of the updates in
        the request cannot be successfully processed, the request is not marked as failed, but the body of the response
        contains explicit error information for the failed update.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members).

        Parameters
        ----------
        team_members : typing.Dict[str, UpdateTeamMemberRequestParams]
            The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`.
            The maximum number of update objects is 25.

            For each team member, include the fields to add, change, or clear. Fields can be cleared using a null value.
            To update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed,
            call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.

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

        Returns
        -------
        BatchUpdateTeamMembersResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.team_members.batch_update(
                team_members={
                    "AFMwA08kR-MIF-3Vs0OE": {
                        "team_member": {
                            "reference_id": "reference_id_2",
                            "is_owner": False,
                            "status": "ACTIVE",
                            "given_name": "Jane",
                            "family_name": "Smith",
                            "email_address": "jane_smith@gmail.com",
                            "phone_number": "+14159223334",
                            "assigned_locations": {
                                "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS"
                            },
                        }
                    },
                    "fpgteZNMaf0qOK-a4t6P": {
                        "team_member": {
                            "reference_id": "reference_id_1",
                            "is_owner": False,
                            "status": "ACTIVE",
                            "given_name": "Joe",
                            "family_name": "Doe",
                            "email_address": "joe_doe@gmail.com",
                            "phone_number": "+14159283333",
                            "assigned_locations": {
                                "assignment_type": "EXPLICIT_LOCATIONS",
                                "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                            },
                        }
                    },
                },
            )


        asyncio.run(main())
        """
        response = await self._raw_client.batch_update(team_members=team_members, request_options=request_options)
        return response.data

    async def search(
        self,
        *,
        query: typing.Optional[SearchTeamMembersQueryParams] = OMIT,
        limit: typing.Optional[int] = OMIT,
        cursor: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SearchTeamMembersResponse:
        """
        Returns a paginated list of `TeamMember` objects for a business.
        The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether
        the team member is the Square account owner.

        Parameters
        ----------
        query : typing.Optional[SearchTeamMembersQueryParams]
            The query parameters.

        limit : typing.Optional[int]
            The maximum number of `TeamMember` objects in a page (100 by default).

        cursor : typing.Optional[str]
            The opaque cursor for fetching the next page. For more information, see
            [pagination](https://developer.squareup.com/docs/working-with-apis/pagination).

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

        Returns
        -------
        SearchTeamMembersResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.team_members.search(
                query={
                    "filter": {"location_ids": ["0G5P3VGACMMQZ"], "status": "ACTIVE"}
                },
                limit=10,
            )


        asyncio.run(main())
        """
        response = await self._raw_client.search(
            query=query, limit=limit, cursor=cursor, request_options=request_options
        )
        return response.data

    async def get(
        self, team_member_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetTeamMemberResponse:
        """
        Retrieves a `TeamMember` object for the given `TeamMember.id`.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member).

        Parameters
        ----------
        team_member_id : str
            The ID of the team member to retrieve.

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

        Returns
        -------
        GetTeamMemberResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


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


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

    async def update(
        self,
        team_member_id: str,
        *,
        team_member: typing.Optional[TeamMemberParams] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdateTeamMemberResponse:
        """
        Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates.
        Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member).

        Parameters
        ----------
        team_member_id : str
            The ID of the team member to update.

        team_member : typing.Optional[TeamMemberParams]
            The team member fields to add, change, or clear. Fields can be cleared using a null value. To update
            `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed, call
            [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.

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

        Returns
        -------
        UpdateTeamMemberResponse
            Success

        Examples
        --------
        import asyncio

        from square import AsyncSquare

        client = AsyncSquare(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.team_members.update(
                team_member_id="team_member_id",
                team_member={
                    "reference_id": "reference_id_1",
                    "status": "ACTIVE",
                    "given_name": "Joe",
                    "family_name": "Doe",
                    "email_address": "joe_doe@gmail.com",
                    "phone_number": "+14159283333",
                    "assigned_locations": {
                        "assignment_type": "EXPLICIT_LOCATIONS",
                        "location_ids": ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"],
                    },
                    "wage_setting": {
                        "job_assignments": [
                            {
                                "pay_type": "SALARY",
                                "annual_rate": {"amount": 3000000, "currency": "USD"},
                                "weekly_hours": 40,
                                "job_id": "FjS8x95cqHiMenw4f1NAUH4P",
                            },
                            {
                                "pay_type": "HOURLY",
                                "hourly_rate": {"amount": 1200, "currency": "USD"},
                                "job_id": "VDNpRv8da51NU8qZFC5zDWpF",
                            },
                        ],
                        "is_overtime_exempt": True,
                    },
                },
            )


        asyncio.run(main())
        """
        response = await self._raw_client.update(
            team_member_id, team_member=team_member, request_options=request_options
        )
        return response.data
