"""mindbodypublicapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: D410, E501, E101, D206
from apimatic_core.authentication.multiple.single_auth import (
    Single,
)
from apimatic_core.request_builder import RequestBuilder
from apimatic_core.response_handler import ResponseHandler
from apimatic_core.types.parameter import Parameter

from mindbodypublicapi.api_helper import APIHelper
from mindbodypublicapi.configuration import (
    Server,
)
from mindbodypublicapi.controllers.base_controller import (
    BaseController,
)
from mindbodypublicapi.http.http_method_enum import (
    HttpMethodEnum,
)
from mindbodypublicapi.models.add_arrival_response import (
    AddArrivalResponse,
)
from mindbodypublicapi.models.add_client_direct_debit_info_response import (
    AddClientDirectDebitInfoResponse,
)
from mindbodypublicapi.models.add_client_response import (
    AddClientResponse,
)
from mindbodypublicapi.models.contact_log import (
    ContactLog,
)
from mindbodypublicapi.models.contract import (
    Contract,
)
from mindbodypublicapi.models.direct_debit_info import (
    DirectDebitInfo,
)
from mindbodypublicapi.models.formula_note_response import (
    FormulaNoteResponse,
)
from mindbodypublicapi.models.get_active_client_memberships_response import (
    GetActiveClientMembershipsResponse,
)
from mindbodypublicapi.models.get_active_clients_memberships_response import (
    GetActiveClientsMembershipsResponse,
)
from mindbodypublicapi.models.get_client_account_balances_response import (
    GetClientAccountBalancesResponse,
)
from mindbodypublicapi.models.get_client_complete_info_response import (
    GetClientCompleteInfoResponse,
)
from mindbodypublicapi.models.get_client_contracts_response import (
    GetClientContractsResponse,
)
from mindbodypublicapi.models.get_client_duplicates_response import (
    GetClientDuplicatesResponse,
)
from mindbodypublicapi.models.get_client_formula_notes_response import (
    GetClientFormulaNotesResponse,
)
from mindbodypublicapi.models.get_client_indexes_response import (
    GetClientIndexesResponse,
)
from mindbodypublicapi.models.get_client_purchases_response import (
    GetClientPurchasesResponse,
)
from mindbodypublicapi.models.get_client_referral_types_response import (
    GetClientReferralTypesResponse,
)
from mindbodypublicapi.models.get_client_rewards_response import (
    GetClientRewardsResponse,
)
from mindbodypublicapi.models.get_client_schedule_response import (
    GetClientScheduleResponse,
)
from mindbodypublicapi.models.get_client_services_response import (
    GetClientServicesResponse,
)
from mindbodypublicapi.models.get_client_visits_response import (
    GetClientVisitsResponse,
)
from mindbodypublicapi.models.get_clients_response import (
    GetClientsResponse,
)
from mindbodypublicapi.models.get_contact_log_types_response import (
    GetContactLogTypesResponse,
)
from mindbodypublicapi.models.get_contact_logs_response import (
    GetContactLogsResponse,
)
from mindbodypublicapi.models.get_cross_regional_client_associations_response import (
    GetCrossRegionalClientAssociationsResponse,
)
from mindbodypublicapi.models.get_custom_client_fields_response import (
    GetCustomClientFieldsResponse,
)
from mindbodypublicapi.models.get_required_client_fields_response import (
    GetRequiredClientFieldsResponse,
)
from mindbodypublicapi.models.suspend_contract_response import (
    SuspendContractResponse,
)
from mindbodypublicapi.models.terminate_contract_response import (
    TerminateContractResponse,
)
from mindbodypublicapi.models.update_client_response import (
    UpdateClientResponse,
)
from mindbodypublicapi.models.update_client_service_response import (
    UpdateClientServiceResponse,
)
from mindbodypublicapi.models.update_client_visit_response import (
    UpdateClientVisitResponse,
)
from mindbodypublicapi.models.upload_client_document_response import (
    UploadClientDocumentResponse,
)
from mindbodypublicapi.models.upload_client_photo_response import (
    UploadClientPhotoResponse,
)


class ClientController(BaseController):
    """A Controller to access Endpoints in the mindbodypublicapi API."""

    def __init__(self, config):
        """Initialize ClientController object."""
        super(ClientController, self).__init__(config)

    def get_active_client_memberships(self,
                                      version,
                                      request_client_id,
                                      site_id,
                                      authorization=None,
                                      request_client_associated_sites_offset=None,
                                      request_cross_regional_lookup=None,
                                      request_limit=None,
                                      request_location_id=None,
                                      request_offset=None,
                                      request_unique_client_id=None):
        """Perform a GET request to
        /public/v{version}/client/activeclientmemberships.

        Please note that client memberships with location restrictions can only be
        used to pay for scheduled services at the site to which they belong.
        Memberships with location restrictions can not be used to pay for scheduled
        services at other sites within an organization.

        Args:
            version (str): version of the api.
            request_client_id (str): The ID of the client for whom memberships are
                returned.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_associated_sites_offset (int, optional): Used to retrieve
                a client’s memberships from multiple sites within an organization
                when the client is associated with more than ten sites. To change
                which ten sites are searched, change this offset value. A value of 0
                means that no sites are skipped and the first ten sites are returned.
                You can use the `CrossRegionalClientAssociations` value from `GET
                CrossRegionalClientAssociations` to determine how many sites the
                client is associated with. Note that you must always have
                `CrossRegionalLookup` set to `true` to use this parameter.<br />
                Default: **0**    For example, if a client is associated with 25
                sites, you need to call GET `ActiveClientMemberships` three times, as
                follows:  * Use GET `CrossRegionalClientAssociations` to determine
                how many sites a client is associated with, which tells you how many
                additional calls you need to make.  * Either omit
                `ClientAssociatedSitesOffset` or set it to 0 to return the client’s
                memberships from sites 1-10  * Set `ClientAssociatedSitesOffset` to
                10 to return the client’s memberships from sites 11-20  * Set
                `ClientAssociatedSitesOffset` to 20 to return the client’s
                memberships from sites 21-25
            request_cross_regional_lookup (bool, optional): Used to retrieve a
                client’s memberships from multiple sites within an organization. When
                included and set to `true`, it searches a maximum of ten sites with
                which this client is associated. When a client is associated with
                more than ten sites, use `ClientAssociatedSitesOffset` as many times
                as needed to search the additional sites with which the client is
                associated. You can use the `CrossRegionalClientAssociations` value
                from `GET CrossRegionalClientAssociations` to determine how many
                sites the client is associated with. Note that a `SiteID` is returned
                and populated in the `ClientServices` response when
                `CrossRegionalLookup` is set to `true`.  Default: **false**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_location_id (int, optional): Filters results to memberships that
                can be used to pay for scheduled services at that location. This
                parameter can not be passed when `CrossRegionalLookup` is `true`.
            request_offset (int, optional): Page offset, defaults to 0.
            request_unique_client_id (int, optional): The Unique ID of the client for
                whom memberships are returned. Note that UniqueClientId takes
                precedence over ClientId if both are provided.

        Returns:
            GetActiveClientMembershipsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/activeclientmemberships")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.locationId")
                .value(request_location_id))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetActiveClientMembershipsResponse.from_dictionary),
        ).execute()

    def get_active_clients_memberships(self,
                                       version,
                                       request_client_ids,
                                       site_id,
                                       authorization=None,
                                       request_client_associated_sites_offset=None,
                                       request_cross_regional_lookup=None,
                                       request_limit=None,
                                       request_location_id=None,
                                       request_offset=None):
        """Perform a GET request to
        /public/v{version}/client/activeclientsmemberships.

        The endpoint returns a list of memberships for multiple clients we pass in
        query parameter. Please note that clients memberships with location
        restrictions can only be used to pay for scheduled services at the site to
        which they belong. Memberships with location restrictions can not be used to
        pay for scheduled services at other sites within an organization.

        Args:
            version (str): version of the api.
            request_client_ids (List[str]): The ID of the client for whom memberships
                are returned. Maximum allowed : 200.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_associated_sites_offset (int, optional): Used to retrieve
                a client’s memberships from multiple sites within an organization
                when the client is associated with more than ten sites. To change
                which ten sites are searched, change this offset value. A value of 0
                means that no sites are skipped and the first ten sites are returned.
                You can use the `CrossRegionalClientAssociations` value from `GET
                CrossRegionalClientAssociations` to determine how many sites the
                client is associated with. Note that you must always have
                `CrossRegionalLookup` set to `true` to use this parameter.<br />
                Default: **0**    For example, if a client is associated with 25
                sites, you need to call `GetClientServices` three times, as follows:
                * Use `GET CrossRegionalClientAssociations` to determine how many
                sites a client is associated with, which tells you how many
                additional calls you need to make.  * Either omit
                `ClientAssociatedSitesOffset` or set it to 0 to return the client’s
                services (pricing options) from sites 1-10.  * Set
                `ClientAssociatedSitesOffset` to 10 to return the client pricing
                options from sites 11-20  * Set `ClientAssociatedSitesOffset` to 20
                to return the client pricing options from sites 21-25
            request_cross_regional_lookup (bool, optional): Used to retrieve a
                client’s memberships from multiple sites within an organization. When
                included and set to `true`, it searches a maximum of ten sites with
                which this client is associated. When a client is associated with
                more than ten sites, use `ClientAssociatedSitesOffset` as many times
                as needed to search the additional sites with which the client is
                associated. You can use the `CrossRegionalClientAssociations` value
                from `GET CrossRegionalClientAssociations` to determine how many
                sites the client is associated with. Note that a `SiteID` is returned
                and populated in the `ClientServices` response when
                `CrossRegionalLookup` is set to `true`.  Default: **false**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_location_id (int, optional): Filters results to memberships that
                can be used to pay for scheduled services at that location. This
                parameter can not be passed when `CrossRegionalLookup` is `true`.
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetActiveClientsMembershipsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/activeclientsmemberships")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientIds")
                .value(request_client_ids))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.locationId")
                .value(request_location_id))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetActiveClientsMembershipsResponse.from_dictionary),
        ).execute()

    def get_client_account_balances(self,
                                    version,
                                    request_client_ids,
                                    site_id,
                                    authorization=None,
                                    request_balance_date=None,
                                    request_class_id=None,
                                    request_limit=None,
                                    request_offset=None):
        """Perform a GET request to
        /public/v{version}/client/clientaccountbalances.

        Get account balance information for one or more client(s).

        Args:
            version (str): version of the api.
            request_client_ids (List[str]): The list of clients IDs for which you
                want account balances.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_balance_date (datetime, optional): The date you want a balance
                relative to.   Default: **the current date**
            request_class_id (int, optional): The class ID of the event for which you
                want a balance.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetClientAccountBalancesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientaccountbalances")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientIds")
                .value(request_client_ids))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.balanceDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_balance_date)))
            .query_param(Parameter()
                .key("request.classId")
                .value(request_class_id))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientAccountBalancesResponse.from_dictionary),
        ).execute()

    def get_client_complete_info(self,
                                 version,
                                 request_client_id,
                                 site_id,
                                 authorization=None,
                                 consumer_identity_token=None,
                                 request_client_associated_sites_offset=None,
                                 request_cross_regional_lookup=None,
                                 request_end_date=None,
                                 request_exclude_inactive_sites=None,
                                 request_required_client_data=None,
                                 request_show_active_only=None,
                                 request_start_date=None,
                                 request_unique_client_id=None,
                                 request_use_activate_date=None):
        """Perform a GET request to
        /public/v{version}/client/clientcompleteinfo.

        This endpoint returns complete client information along with list of
        purchased services, contract details, membership details and arrival programs
        for a specific client.

        Args:
            version (str): version of the api.
            request_client_id (str): Filters results to client with these ID.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            consumer_identity_token (str, optional): A consumers authorization token
                to replace the need of clientId in the request.
            request_client_associated_sites_offset (int, optional): Used to retrieve
                a client’s pricing options from multiple sites within an organization
                when the client is associated with more than ten sites. To change
                which ten sites are searched, change this offset value. A value of 0
                means that no sites are skipped and the first ten sites are returned.
                You can use the `CrossRegionalClientAssociations` value from `GET
                CrossRegionalClientAssociations` to determine how many sites the
                client is associated with. Note that you must always have
                `CrossRegionalLookup` set to `true` to use this parameter.<br />
                Default: **0**    For example, if a client is associated with 25
                sites, you need to call `GetClientServices` three times, as follows:
                * Use `GET CrossRegionalClientAssociations` to determine how many
                sites a client is associated with, which tells you how many
                additional calls you need to make.  * Either omit
                `ClientAssociatedSitesOffset` or set it to 0 to return the client’s
                services (pricing options) from sites 1-10.  * Set
                `ClientAssociatedSitesOffset` to 10 to return the client pricing
                options from sites 11-20  * Set `ClientAssociatedSitesOffset` to 20
                to return the client pricing options from sites 21-25
            request_cross_regional_lookup (bool, optional): Used to retrieve a
                clients pricing options from multiple sites within an
                organization.When included and set to `true`,  it searches a maximum
                of ten sites with which this client is associated.When a client is
                associated with more than ten sites, use
                `ClientAssociatedSitesOffset` as many times as needed to search the
                additional sites with which the client is associated.  You can use
                the `CrossRegionalClientAssociations` value from `GET
                CrossRegionalClientAssociations` to determine how many sites the
                client is associated with.   Note that a `SiteID` is returned and
                populated in the `ClientServices` response when `CrossRegionalLookup`
                is set to `true`.   Default: **false**
            request_end_date (datetime, optional): Filters results to pricing options
                that are purchased on or before this date.   Default: **today’s
                date**.
            request_exclude_inactive_sites (bool, optional): When this flag is set to
                `true`, will exclude inactive sites from the response  Default:
                **false**
            request_required_client_data (List[str], optional): Used to retrieve list
                of purchased services, contract details, membership details and
                arrival programs for a specific client.   Default `ClientServices`,
                `ClientContracts`, `ClientMemberships` and `ClientArrivals` will be
                returned when `RequiredClientDatais` not set.   When
                `RequiredClientData` is set to `Contracts` then only
                `ClientContracts` will be returned in the response.   When
                `RequiredClientData` is set to Services then only `ClientServices`
                will be returned in the response.  When `RequiredClientData` is set
                to `Memberships` then only `ClientMemberships` will be returned in
                the response.   When `RequiredClientData` is set to `ArrivalPrograms`
                then only `ClientArrivals` will be returned in the response.
            request_show_active_only (bool, optional): When `true`, includes active
                services only. Set this field to `true` when trying to determine if a
                client has a   service that can pay for a class or appointment.
                Default: **false**
            request_start_date (datetime, optional): Filters results to pricing
                options that are purchased on or after this date.   Default:
                **today’s date**.
            request_unique_client_id (int, optional): The unique ID of the client who
                is viewing this class list.
            request_use_activate_date (bool, optional): When this flag is set to
                `true`, the date filtering will use activate date to filter the
                pricing options.  When this flag is set to `false`, the date
                filtering will use purchase date to filter the pricing options.
                Default: **false**

        Returns:
            GetClientCompleteInfoResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientcompleteinfo")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("consumer-identity-token")
                .value(consumer_identity_token))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.excludeInactiveSites")
                .value(request_exclude_inactive_sites))
            .query_param(Parameter()
                .key("request.requiredClientData")
                .value(request_required_client_data))
            .query_param(Parameter()
                .key("request.showActiveOnly")
                .value(request_show_active_only))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .query_param(Parameter()
                .key("request.useActivateDate")
                .value(request_use_activate_date))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientCompleteInfoResponse.from_dictionary),
        ).execute()

    def get_client_contracts(self,
                             version,
                             request_client_id,
                             site_id,
                             authorization=None,
                             request_client_associated_sites_offset=None,
                             request_cross_regional_lookup=None,
                             request_limit=None,
                             request_offset=None,
                             request_unique_client_id=None):
        """Perform a GET request to /public/v{version}/client/clientcontracts.

        Get contracts that a client has purchased.

        Args:
            version (str): version of the api.
            request_client_id (str): The ID of the client (RssId).
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_associated_sites_offset (int, optional): Determines how
                many sites are skipped over when retrieving a client’s cross regional
                contracts. Used when a client ID is linked to more than ten sites in
                an organization. Only a maximum of ten site databases are queried
                when this call is made and `CrossRegionalLookup` is set to `true`. To
                change which sites are queried, change this offset value.  Default:
                **0**
            request_cross_regional_lookup (bool, optional): When `true`, indicates
                that the requesting client’s cross regional contracts are returned,
                if any.<br />  When `false`, indicates that cross regional contracts
                are not returned.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_unique_client_id (int, optional): The unique ID of the requested
                client.

        Returns:
            GetClientContractsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientcontracts")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientContractsResponse.from_dictionary),
        ).execute()

    def get_direct_debit_info(self,
                              version,
                              site_id,
                              authorization=None,
                              client_id=None):
        """Perform a GET request to
        /public/v{version}/client/clientdirectdebitinfo.

        This endpoint returns direct debit info stored on a client's account. This
        endpoint requires staff user credentials.

        A null response from this endpoint indicates that the client has no usable
        direct debit information on their account.Use the POST
        AddClientDirectDebitInfo endpoint to add direct debit information to a
        client’s account.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            client_id (str, optional): The ID of the client.

        Returns:
            DirectDebitInfo: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientdirectdebitinfo")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("clientId")
                .value(client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(DirectDebitInfo.from_dictionary),
        ).execute()

    def delete_direct_debit_info(self,
                                 version,
                                 site_id,
                                 authorization=None,
                                 client_id=None):
        """Perform a DELETE request to
        /public/v{version}/client/clientdirectdebitinfo.

        This endpoint deletes direct debit info from a client’s account. This
        endpoint requires staff user credentials.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            client_id (str, optional): The ID of the client.

        Returns:
            Any: Response from the API. This endpoint does not return a response.
                If a call to this endpoint results in a 200 OK HTTP status code,
                then the call was successful.

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientdirectdebitinfo")
            .http_method(HttpMethodEnum.DELETE)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("clientId")
                .value(client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()

    def get_client_duplicates(self,
                              version,
                              site_id,
                              authorization=None,
                              request_email=None,
                              request_first_name=None,
                              request_last_name=None,
                              request_limit=None,
                              request_offset=None):
        """Perform a GET request to /public/v{version}/client/clientduplicates.

        This endpoint gets client records that would be considered duplicates based
        on case-insensitive matching of the client's first name, last name, and
        email. For there to be results, all three parameters must match a client
        record. This endpoint requires staff user credentials.

        An empty `ClientDuplicates` object in the response from this endpoint
        indicates that there were no client records found that match the first name,
        last name, and email fields passed in.

        If one client record is returned, it is not a duplicate itself, but no other
        client record can be created or updated that would match this client's first
        name, last name, and email combination.

        If more than one client record is returned, these clients are duplicates of
        each other.We recommend discussing with the business how they would like to
        resolve duplicate records in the event the response contains more than one
        client record.Businesses can use the Merge Duplicate Clients tool in the Core
        Business Mode software to resolve the duplicate client records.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_email (str, optional): The client email to match on when
                searching for duplicates.
            request_first_name (str, optional): The client first name to match on
                when searching for duplicates.
            request_last_name (str, optional): The client last name to match on when
                searching for duplicates.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetClientDuplicatesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientduplicates")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.email")
                .value(request_email))
            .query_param(Parameter()
                .key("request.firstName")
                .value(request_first_name))
            .query_param(Parameter()
                .key("request.lastName")
                .value(request_last_name))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientDuplicatesResponse.from_dictionary),
        ).execute()

    def get_client_formula_notes(self,
                                 version,
                                 site_id,
                                 authorization=None,
                                 request_appointment_id=None,
                                 request_client_id=None,
                                 request_limit=None,
                                 request_offset=None):
        """Perform a GET request to
        /public/v{version}/client/clientformulanotes.

        ***QueryParams***: Enables to retrieve cross regional formula notes for a
        client, or for a specific appointment. The two parameters are optional,
        however at least one must be provided. This endpoint supports pagination.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_appointment_id (int, optional): The appointment ID of an
                appointment in the studio specified in the header of the request.
            request_client_id (str, optional): The client ID of the client whose
                formula notes are being requested.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetClientFormulaNotesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientformulanotes")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.appointmentId")
                .value(request_appointment_id))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientFormulaNotesResponse.from_dictionary),
        ).execute()

    def get_client_indexes(self,
                           version,
                           site_id,
                           authorization=None,
                           request_required_only=None):
        """Perform a GET request to /public/v{version}/client/clientindexes.

        Client indexes are used to analyze client demographics. A business owner can
        set up different categories with sets of values which they can assign to each
        client. Client indexes are used in client searches, for tagging clients so
        that the owner can send mass emails to similar groups, and for many reports.
        For more information, see Client Indexes and [Client Index Values (video
        tutorial)](https://support.mindbodyonline.com/s/article/203261653-Client-index
        es-and-client-index-values-video-tutorial?language=en_USclient).

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_required_only (bool, optional): When `true`, filters the results
                to only indexes that are required on creation.<br />  When `false` or
                omitted, returns all of the client indexes.

        Returns:
            GetClientIndexesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientindexes")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.requiredOnly")
                .value(request_required_only))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientIndexesResponse.from_dictionary),
        ).execute()

    def get_client_purchases(self,
                             version,
                             request_client_id,
                             site_id,
                             authorization=None,
                             request_end_date=None,
                             request_limit=None,
                             request_offset=None,
                             request_sale_id=None,
                             request_start_date=None,
                             request_unique_client_id=None):
        """Perform a GET request to /public/v{version}/client/clientpurchases.

        Gets a list of purchases made by a specific client.

        Args:
            version (str): version of the api.
            request_client_id (str): The ID of the client you are querying for
                purchases.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_end_date (datetime, optional): Filters results to purchases made
                before this timestamp.<br />  Default: **end of today**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_sale_id (int, optional): Filters results to the single record
                associated with this ID.
            request_start_date (datetime, optional): Filters results to purchases
                made on or after this timestamp.<br />  Default: **now**
            request_unique_client_id (int, optional): The unique ID of the requested
                client.

        Returns:
            GetClientPurchasesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientpurchases")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.saleId")
                .value(request_sale_id))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientPurchasesResponse.from_dictionary),
        ).execute()

    def get_client_referral_types(self,
                                  version,
                                  site_id,
                                  authorization=None,
                                  request_include_inactive=None):
        """Perform a GET request to
        /public/v{version}/client/clientreferraltypes.

        Gets a list of referral types. Referral types are options that new clients
        can choose to identify how they learned about the business. Referral types
        are typically used for the sign-up process.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_include_inactive (bool, optional): When `true`, filters the
                results to include subtypes and inactive referral types.<br />  When
                `false`, includes no subtypes and only active types.
                Default:**false**

        Returns:
            GetClientReferralTypesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientreferraltypes")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.includeInactive")
                .value(request_include_inactive))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientReferralTypesResponse.from_dictionary),
        ).execute()

    def get_client_rewards(self,
                           version,
                           request_client_id,
                           site_id,
                           authorization=None,
                           request_end_date=None,
                           request_limit=None,
                           request_offset=None,
                           request_start_date=None):
        """Perform a GET request to /public/v{version}/client/clientrewards.

        Gets the client rewards.

        Args:
            version (str): version of the api.
            request_client_id (str): The ID of the client.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_end_date (datetime, optional): The end date of transaction.
                Default: **StartDate**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_start_date (datetime, optional): The start date of transaction.
                Default: **today**

        Returns:
            GetClientRewardsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientrewards")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientRewardsResponse.from_dictionary),
        ).execute()

    def update_client_rewards(self,
                              version,
                              request,
                              site_id,
                              authorization=None):
        """Perform a POST request to /public/v{version}/client/clientrewards.

        Earns or redeems rewards points for a given client, based on site settings.
        Cross regional rewards are not supported at this time.

        Args:
            version (str): version of the api.
            request (UpdateClientRewardsRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            GetClientRewardsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientrewards")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientRewardsResponse.from_dictionary),
        ).execute()

    def get_clients(self,
                    version,
                    site_id,
                    authorization=None,
                    request_client_i_ds=None,
                    request_include_inactive=None,
                    request_is_prospect=None,
                    request_last_modified_date=None,
                    request_limit=None,
                    request_offset=None,
                    request_search_text=None,
                    request_unique_ids=None):
        """Perform a GET request to /public/v{version}/client/clients.

        This endpoint requires staff user credentials. This endpoint supports
        pagination. See Pagination for a description of the Pagination information.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_i_ds (List[str], optional): The requested client IDs.
                Default: **all IDs** that the authenticated user’s access level
                allows.<br />  Note: You can fetch information for maximum 20 clients
                at once.
            request_include_inactive (bool, optional): When `true`, indicates the
                results to include active and inactive clients.<br />  When `false`,
                indicates that only those clients who are marked as active should be
                returned.  Default: **false**
            request_is_prospect (bool, optional): When `true`, filters the results to
                include only those clients marked as prospects for the business.<br
                />  When `false`, indicates that only those clients who are not
                marked prospects should be returned.
            request_last_modified_date (datetime, optional): Filters the results to
                include only the clients that have been modified on or after this
                date.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_search_text (str, optional): Text to use in the search. Can
                include FirstName, LastName, and Email. Note that user credentials
                must be provided.
            request_unique_ids (List[int], optional): Filters results to clients with
                these `UniqueIDs`. This parameter cannot be used with `ClientIDs` or
                `SearchText`.  Default: **all UniqueIDs** that the authenticated
                user’s access level allows.

        Returns:
            GetClientsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clients")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientIDs")
                .value(request_client_i_ds))
            .query_param(Parameter()
                .key("request.includeInactive")
                .value(request_include_inactive))
            .query_param(Parameter()
                .key("request.isProspect")
                .value(request_is_prospect))
            .query_param(Parameter()
                .key("request.lastModifiedDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_last_modified_date)))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.searchText")
                .value(request_search_text))
            .query_param(Parameter()
                .key("request.uniqueIds")
                .value(request_unique_ids))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientsResponse.from_dictionary),
        ).execute()

    def get_client_schedule(self,
                            version,
                            site_id,
                            authorization=None,
                            request_client_associated_sites_offset=None,
                            request_client_id=None,
                            request_cross_regional_lookup=None,
                            request_end_date=None,
                            request_include_waitlist_entries=None,
                            request_limit=None,
                            request_offset=None,
                            request_start_date=None,
                            request_unique_client_id=None):
        """Perform a GET request to /public/v{version}/client/clientschedule.

        This endpoint can be utilized to retrieve scheduled visits which is
        associated with the requested client.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_associated_sites_offset (int, optional): The number of
                sites to skip when returning the site associated with a client.
            request_client_id (str, optional): The ID of the requested client.
            request_cross_regional_lookup (bool, optional): When `true`, indicates
                that past and scheduled client visits across all sites in the region
                are returned.  When `false`, indicates that only visits at the
                current site are returned.
            request_end_date (datetime, optional): The date past which class visits
                are not returned.  Default is today’s date
            request_include_waitlist_entries (bool, optional): When `true`, waitlist
                entries are included in the response.  When `false`, waitlist entries
                are removed from the response.  Default: **false**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_start_date (datetime, optional): The date before which class
                visits are not returned.  Default is the end date
            request_unique_client_id (int, optional): The unique ID of the requested
                client.  Note: you need to provide the 'UniqueClientId' OR the
                'ClientId'. If both are provided, the 'UniqueClientId' takes
                precedence.

        Returns:
            GetClientScheduleResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientschedule")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.includeWaitlistEntries")
                .value(request_include_waitlist_entries))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientScheduleResponse.from_dictionary),
        ).execute()

    def get_client_services(self,
                            version,
                            site_id,
                            authorization=None,
                            request_class_id=None,
                            request_class_schedule_id=None,
                            request_client_associated_sites_offset=None,
                            request_client_id=None,
                            request_client_ids=None,
                            request_cross_regional_lookup=None,
                            request_end_date=None,
                            request_exclude_inactive_sites=None,
                            request_ignore_cross_regional_site_limit=None,
                            request_limit=None,
                            request_location_ids=None,
                            request_offset=None,
                            request_program_ids=None,
                            request_session_type_id=None,
                            request_show_active_only=None,
                            request_start_date=None,
                            request_unique_client_id=None,
                            request_unique_client_ids=None,
                            request_use_activate_date=None,
                            request_visit_count=None):
        """Perform a GET request to /public/v{version}/client/clientservices.

        Get pricing options that a client has purchased.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_class_id (int, optional): Filters results to only those pricing
                options that can be used to pay for this class.
            request_class_schedule_id (List[int], optional): Filters results to
                pricing options which are associated with one of the ClassScheduleIDs
            request_client_associated_sites_offset (int, optional): Used to retrieve
                a client’s pricing options from multiple sites within an organization
                when the client is associated with more than ten sites. To change
                which ten sites are searched, change this offset value. A value of 0
                means that no sites are skipped and the first ten sites are returned.
                You can use the `CrossRegionalClientAssociations` value from `GET
                CrossRegionalClientAssociations` to determine how many sites the
                client is associated with. Note that you must always have
                `CrossRegionalLookup` set to `true` to use this parameter.<br />
                Default: **0**    For example, if a client is associated with 25
                sites, you need to call `GetClientServices` three times, as follows:
                * Use `GET CrossRegionalClientAssociations` to determine how many
                sites a client is associated with, which tells you how many
                additional calls you need to make.  * Either omit
                `ClientAssociatedSitesOffset` or set it to 0 to return the client’s
                services (pricing options) from sites 1-10.  * Set
                `ClientAssociatedSitesOffset` to 10 to return the client pricing
                options from sites 11-20  * Set `ClientAssociatedSitesOffset` to 20
                to return the client pricing options from sites 21-25
            request_client_id (str, optional): The ID of the client to query. The
                results are a list of pricing options that the client has purchased.
                Note that “service” and “pricing option” are synonymous in this
                section of the documentation.
            request_client_ids (List[str], optional): The IDs of the clients to
                query. The results are a list of pricing options that the clients
                have purchased.  ClientId parameter takes priority over ClientIds due
                to backward compatibility.  So if you want to use ClientIds, then
                ClientId needs to be empty.  Either of ClientId or ClientIds need to
                be specified
            request_cross_regional_lookup (bool, optional): Used to retrieve a
                client’s pricing options from multiple sites within an organization.
                When included and set to `true`, it searches a maximum of ten sites
                with which this client is associated. When a client is associated
                with more than ten sites, use `ClientAssociatedSitesOffset` as many
                times as needed to search the additional sites with which the client
                is associated. You can use the `CrossRegionalClientAssociations`
                value from `GET CrossRegionalClientAssociations` to determine how
                many sites the client is associated with. Note that a `SiteID` is
                returned and populated in the `ClientServices` response when
                `CrossRegionalLookup` is set to `true`.  Default: **false**
            request_end_date (datetime, optional): Filters results to pricing options
                that are purchased on or before this date.   Default: **today’s date**
            request_exclude_inactive_sites (bool, optional): When this flag is set to
                `true`, will exclude inactive sites from the response.  Default:
                **false**
            request_ignore_cross_regional_site_limit (bool, optional): Used to
                specify if the number of cross regional sites used to search for
                client’s pricing options should be ignored.   Default: **false**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_location_ids (List[int], optional): Filters results to pricing
                options that can be used at the listed location IDs.
            request_offset (int, optional): Page offset, defaults to 0.
            request_program_ids (List[int], optional): Filters results to pricing
                options that belong to one of the given program IDs.
            request_session_type_id (int, optional): Filters results to pricing
                options that will pay for the given session type ID. Use this to find
                pricing options that will pay for a specific appointment type.
            request_show_active_only (bool, optional): When `true`, includes active
                services only.  Default: **false**
            request_start_date (datetime, optional): Filters results to pricing
                options that are purchased on or after this date.  Default: **today’s
                date**
            request_unique_client_id (int, optional): The unique ID of the client to
                query. Note that UniqueClientId takes precedence over ClientId.
            request_unique_client_ids (List[int], optional): The Unique IDs of the
                clients to query. Note that UniqueClientIds collection takes
                precedence over ClientIds collection.
            request_use_activate_date (bool, optional): When this flag is set to
                `true`, the date filtering will use activate date to filter the
                pricing options.  When this flag is set to `false`, the date
                filtering will use purchase date to filter the pricing options.
                Default: **false**
            request_visit_count (int, optional): A filter on the minimum number of
                visits a service can pay for.

        Returns:
            GetClientServicesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientservices")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.classId")
                .value(request_class_id))
            .query_param(Parameter()
                .key("request.classScheduleID")
                .value(request_class_schedule_id))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.clientIds")
                .value(request_client_ids))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.excludeInactiveSites")
                .value(request_exclude_inactive_sites))
            .query_param(Parameter()
                .key("request.ignoreCrossRegionalSiteLimit")
                .value(request_ignore_cross_regional_site_limit))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.locationIds")
                .value(request_location_ids))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.programIds")
                .value(request_program_ids))
            .query_param(Parameter()
                .key("request.sessionTypeId")
                .value(request_session_type_id))
            .query_param(Parameter()
                .key("request.showActiveOnly")
                .value(request_show_active_only))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .query_param(Parameter()
                .key("request.uniqueClientIds")
                .value(request_unique_client_ids))
            .query_param(Parameter()
                .key("request.useActivateDate")
                .value(request_use_activate_date))
            .query_param(Parameter()
                .key("request.visitCount")
                .value(request_visit_count))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientServicesResponse.from_dictionary),
        ).execute()

    def get_client_visits(self,
                          version,
                          site_id,
                          authorization=None,
                          request_client_associated_sites_offset=None,
                          request_client_id=None,
                          request_cross_regional_lookup=None,
                          request_end_date=None,
                          request_limit=None,
                          request_offset=None,
                          request_start_date=None,
                          request_unique_client_id=None,
                          request_unpaids_only=None):
        """Perform a GET request to /public/v{version}/client/clientvisits.

        Gets the Client Visits for a specific client.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_associated_sites_offset (int, optional): The number of
                sites to skip when returning the site associated with a client.
            request_client_id (str, optional): The ID of the requested client.
            request_cross_regional_lookup (bool, optional): When `true`, indicates
                that past and scheduled client visits across all sites in the region
                are returned.<br />  When `false`, indicates that only visits at the
                current site are returned.
            request_end_date (datetime, optional): The date past which class visits
                are not returned.  Default: **today's date**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_start_date (datetime, optional): The date before which class
                visits are not returned.  Default: **the end date**
            request_unique_client_id (int, optional): The unique ID of the requested
                client.  Note: you need to provide the 'UniqueClientId' OR the
                'ClientId'. If both are provided, the 'UniqueClientId' takes
                precedence.
            request_unpaids_only (bool, optional): When `true`, indicates that only
                visits that have not been paid for are returned.<br />  When `false`,
                indicates that all visits are returned, regardless of whether they
                have been paid for.<br />  Default: **false**

        Returns:
            GetClientVisitsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientvisits")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientAssociatedSitesOffset")
                .value(request_client_associated_sites_offset))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.crossRegionalLookup")
                .value(request_cross_regional_lookup))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .query_param(Parameter()
                .key("request.unpaidsOnly")
                .value(request_unpaids_only))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetClientVisitsResponse.from_dictionary),
        ).execute()

    def get_contact_logs(self,
                         version,
                         request_client_id,
                         site_id,
                         authorization=None,
                         request_end_date=None,
                         request_limit=None,
                         request_offset=None,
                         request_show_system_generated=None,
                         request_staff_ids=None,
                         request_start_date=None,
                         request_subtype_ids=None,
                         request_type_ids=None):
        """Perform a GET request to /public/v{version}/client/contactlogs.

        This endpoint contains a variety of filters that can return not just all
        contact logs, but also system-generated contact logs, contact logs assigned
        to specific staff members, and contact logs of specific types or subtypes.

        Args:
            version (str): version of the api.
            request_client_id (str): The ID of the client whose contact logs are
                being requested.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_end_date (datetime, optional): Filters the results to contact
                logs created before this date.<br />  Default: **the start date**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_show_system_generated (bool, optional): When `true`,
                system-generated contact logs are returned in the results.<br />
                Default: **false**
            request_staff_ids (List[int], optional): Filters the results to return
                contact logs assigned to one or more staff IDs.
            request_start_date (datetime, optional): Filters the results to contact
                logs created on or after this date.<br />  Default: **the current
                date**
            request_subtype_ids (List[int], optional): Filters the results to contact
                logs assigned one or more of these subtype IDs.
            request_type_ids (List[int], optional): Filters the results to contact
                logs assigned one or more of these type IDs.

        Returns:
            GetContactLogsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/contactlogs")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.showSystemGenerated")
                .value(request_show_system_generated))
            .query_param(Parameter()
                .key("request.staffIds")
                .value(request_staff_ids))
            .query_param(Parameter()
                .key("request.startDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_start_date)))
            .query_param(Parameter()
                .key("request.subtypeIds")
                .value(request_subtype_ids))
            .query_param(Parameter()
                .key("request.typeIds")
                .value(request_type_ids))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetContactLogsResponse.from_dictionary),
        ).execute()

    def get_contact_log_types(self,
                              version,
                              site_id,
                              authorization=None,
                              request_contact_log_type_id=None,
                              request_limit=None,
                              request_offset=None):
        """Perform a GET request to /public/v{version}/client/contactlogtypes.

        This endpoint contains a variety of filters that can return not just all
        contact logs, but also system-generated contact logs, contact logs assigned
        to specific staff members, and contact logs of specific types or subtypes.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_contact_log_type_id (int, optional): The requested ContactLogType
                ID.  Default: **all** IDs that the authenticated user’s access level
                allows.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetContactLogTypesResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/contactlogtypes")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.contactLogTypeId")
                .value(request_contact_log_type_id))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetContactLogTypesResponse.from_dictionary),
        ).execute()

    def get_cross_regional_client_associations(self,
                                               version,
                                               site_id,
                                               authorization=None,
                                               request_client_id=None,
                                               request_email=None,
                                               request_exclude_inactive_sites=None,
                                               request_first_name=None,
                                               request_last_name=None,
                                               request_limit=None,
                                               request_offset=None,
                                               request_unique_client_id=None,
                                               request_v_2=None):
        """Perform a GET request to
        /public/v{version}/client/crossregionalclientassociations.

        Returns a list of sites that a particular client ID (also referred to as an
        RSSID) or a client email address is associated with in a cross-regional
        organization. Either the `ClientID` or `Email` parameter is required. If both
        are provided, the `ClientID` is used.
        Use this endpoint to retrieve information for other Public API endpoints,
        about the same client at multiple sites within an organization. To use this
        endpoint, your developer account must have been granted permission to the
        site's entire organization.
        Note that this endpoint does not work on the Developer Sandbox site, as it is
        not set up for cross-regional use cases.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_client_id (str, optional): Looks up the cross regional
                associations by the client’s ID.
            request_email (str, optional): Looks up the cross regional associations
                by the client’s email address.
            request_exclude_inactive_sites (bool, optional): Used to exclude inactive
                and deleted sites from the results.  When this flag is set to `true`,
                client profiles associated with inactive and deleted sites are not
                getting returned.  When this flag is set to `false`,client profiles
                associated with inactive and deleted sites are getting returned.
                Default: **true**
            request_first_name (str, optional): First name (used for email queries)
            request_last_name (str, optional): Last name (used for email queries)
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_unique_client_id (int, optional): Looks up the cross regional
                associations by the unique client’s ID.  Note: you need to provide
                the 'UniqueClientId' OR the 'ClientId' OR the 'Email'.
                'UniqueClientId' takes precedence when provided. If not, but both
                'ClientId' and 'Email' are provided, 'ClientId' is used by default.
            request_v_2 (bool, optional): Use newer method

        Returns:
            GetCrossRegionalClientAssociationsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/crossregionalclientassociations")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.email")
                .value(request_email))
            .query_param(Parameter()
                .key("request.excludeInactiveSites")
                .value(request_exclude_inactive_sites))
            .query_param(Parameter()
                .key("request.firstName")
                .value(request_first_name))
            .query_param(Parameter()
                .key("request.lastName")
                .value(request_last_name))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.uniqueClientId")
                .value(request_unique_client_id))
            .query_param(Parameter()
                .key("request.v2")
                .value(request_v_2))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetCrossRegionalClientAssociationsResponse.from_dictionary),
        ).execute()

    def get_custom_client_fields(self,
                                 version,
                                 site_id,
                                 authorization=None,
                                 request_limit=None,
                                 request_offset=None):
        """Perform a GET request to
        /public/v{version}/client/customclientfields.

        Get a site's configured custom client fields.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetCustomClientFieldsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/customclientfields")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetCustomClientFieldsResponse.from_dictionary),
        ).execute()

    def get_required_client_fields(self,
                                   version,
                                   site_id,
                                   authorization=None):
        """Perform a GET request to
        /public/v{version}/client/requiredclientfields.

        Gets the list of fields that a new client has to fill out in business mode,
        specifically for the sign-up process. `AddClient` and `UpdateClient` validate
        against these fields.
        This endpoint has no query parameters.

        Args:
            version (str): version of the api.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            GetRequiredClientFieldsResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/requiredclientfields")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetRequiredClientFieldsResponse.from_dictionary),
        ).execute()

    def add_arrival(self,
                    version,
                    request,
                    site_id,
                    authorization=None):
        """Perform a POST request to /public/v{version}/client/addarrival.

        Marks a client as arrived for a specified location. A staff user token must
        be included with staff assigned the LaunchSignInScreen permission.

        When used on a site that is part of a region, the following additional logic
        will apply:

        * When a client exists within the region but not at the studio where the
        arrival is being logged, a local client record will be automatically created.
        * If the local client does not have an applicable local membership or pricing
        option, a membership or pricing option will be automatically used if it
        exists elsewhere within the region.

        Args:
            version (str): version of the api.
            request (AddArrivalRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            AddArrivalResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/addarrival")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(AddArrivalResponse.from_dictionary),
        ).execute()

    def add_client(self,
                   version,
                   request,
                   site_id,
                   authorization=None):
        """Perform a POST request to /public/v{version}/client/addclient.

        Starting the week of May 11th, 2020 all versions of the Public API will no
        longer allow duplicate clients to be created. This applies to both adding a
        client and updating a client record. A duplicate client is created when two
        profiles have the same first name, last name and email.<br />
        Creates a new client record at the specified business.Passing a User Token as
        Authorization will create a client and respect Business Mode required
        fields.Omitting the token will create a client and respect Consumer Mode
        required fi elds. To make sure you are collecting all required pieces of
        information, first run GetRequired ClientFields.<br />
        If you have purchased an Ultimate tier then this endpoint will automatically
        start showing new opportunity on Sales Pipeline.

        Args:
            version (str): version of the api.
            request (AddClientRequest): The `FirstName` and `LastName` parameters are
                always required in this request.               All other parameters
                are optional, but note that any of the optional parameters could be
                required by a particular business,              depending on how the
                business has configured the site settings. If
                `GetRequiredClientFields` returns `EmergContact` in the list of
                required fields,              then all emergency contact parameters
                are required, which includes `EmergencyContactInfoEmail`,
                `EmergencyContactInfoName`, `EmergencyContactInfoPhone`, and
                `EmergencyContactInfoRelationship`.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            AddClientResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/addclient")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(AddClientResponse.from_dictionary),
        ).execute()

    def add_client_direct_debit_info(self,
                                     version,
                                     request,
                                     site_id,
                                     authorization=None):
        """Perform a POST request to
        /public/v{version}/client/addclientdirectdebitinfo.

        This endpoint adds direct debit info to a client’s account. This endpoint
        requires staff user credentials.

        Args:
            version (str): version of the api.
            request (AddClientDirectDebitInfoRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            AddClientDirectDebitInfoResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/addclientdirectdebitinfo")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(AddClientDirectDebitInfoResponse.from_dictionary),
        ).execute()

    def add_formula_note(self,
                         version,
                         request,
                         site_id,
                         authorization=None):
        """Perform a POST request to
        /public/v{version}/client/addclientformulanote.

        This endpoint adds a formula note for a specified client or specified client
        appointment. A staff user token must be included with staff assigned
        permission to view client profile or have both ViewAppointmentDetails and
        ModifyAppointment permissions.

        Args:
            version (str): version of the api.
            request (AddFormulaNoteRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            FormulaNoteResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/addclientformulanote")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(FormulaNoteResponse.from_dictionary),
        ).execute()

    def add_contact_log(self,
                        version,
                        request,
                        site_id,
                        authorization=None):
        """Perform a POST request to /public/v{version}/client/addcontactlog.

        Add a contact log to a client's account.

        Args:
            version (str): version of the api.
            request (AddContactLogRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            ContactLog: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/addcontactlog")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(ContactLog.from_dictionary),
        ).execute()

    def merge_client(self,
                     version,
                     request,
                     site_id,
                     authorization=None):
        """Perform a POST request to /public/v{version}/client/mergeclients.

        This endpoint helps to merge clients.

        Args:
            version (str): version of the api.
            request (MergeClientsRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            Any: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/mergeclients")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()

    def send_auto_email(self,
                        version,
                        request,
                        site_id,
                        authorization=None):
        """Perform a POST request to /public/v{version}/client/sendautoemail.

        This endpoint requires staff user credentials.

        Args:
            version (str): version of the api.
            request (SendAutoEmailRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            Any: Response from the API. This endpoint causes auto email to be sent to
                the requested client.            Email type passed in request needs
                to be enabled in the core software.            This endpoint does not
                return a response.            If a call to this endpoint results in a
                200 OK HTTP status code, then the call was successful.

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/sendautoemail")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()

    def send_password_reset_email(self,
                                  version,
                                  request,
                                  site_id,
                                  authorization=None):
        """Perform a POST request to
        /public/v{version}/client/sendpasswordresetemail.

        Send a password reset email to a client.

        Args:
            version (str): version of the api.
            request (SendPasswordResetEmailRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            Any: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/sendpasswordresetemail")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()

    def suspend_contract(self,
                         version,
                         request,
                         site_id,
                         authorization=None):
        """Perform a POST request to /public/v{version}/client/suspendcontract.

        Suspend client contract

        Args:
            version (str): version of the api.
            request (SuspendContractRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            SuspendContractResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/suspendcontract")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(SuspendContractResponse.from_dictionary),
        ).execute()

    def terminate_contract(self,
                           version,
                           request,
                           site_id,
                           authorization=None):
        """Perform a POST request to
        /public/v{version}/client/terminatecontract.

        This endpoint terminates a client contract. This endpoint requires staff user
        credentials with TerminateClientContract permission.

        Args:
            version (str): version of the api.
            request (TerminateContractRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            TerminateContractResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/terminatecontract")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(TerminateContractResponse.from_dictionary),
        ).execute()

    def update_client(self,
                      version,
                      request,
                      site_id,
                      authorization=None):
        """Perform a POST request to /public/v{version}/client/updateclient.

        Starting the week of May 11th, 2020 all versions of the Public API will no
        longer allow duplicate clients to be created. This applies to both adding a
        client and updating a client record. A duplicate client is created when two
        profiles have the same first name, last name and email.<br />
        Updates an existing client for a specific subscriber.Passing a User Token as
        Authorization respects Business Mode required fields.Omitting the token
        respects Consumer Mode required fields.To make sure you are collecting all
        required pieces of information, first run GetRequiredClientFields.
        <br />.
        Use this endpoint as follows:
        * If you need to update the `ReferredBy` parameter, use this endpoint after
        calling `GET ClientReferralTypes`.
        * When updating a client's home location, use after calling `GET Locations`.
        * If you are updating a client's stored credit card, use after calling `GET
        AcceptedCardTypes` so that you can make sure the card is a type that is
        accepted at the subscriber.
        * If this endpoint is used on a cross-regional site, passing in a client's
        RSSID and email address creates a cross-regional link. This means that the
        client is created in cross-regional sites where the client does not exist and
        `GET CrossRegionalClientAssociations` returns all appropriate cross-regional
        sites.
        * When `CrossRegionalUpdate` is omitted or set to `true`, the client's
        updated information is propagated to all of the region's sites. If
        `CrossRegionalUpdate` is set to `false`, only the local client is updated.
        * Important: Starting in June 2025, the fields RSSID, Prefix, Name, Email,
        Birthday, Phone, and Address will automatically update cross-regionally when
        changed, regardless of the CrossRegionalUpdate setting. The update is rolling
        out on a per customer basis and is expected to complete to all customers by
        September 2025.
        Note that the following items cannot be updated for a cross-regional client:
        * `ClientIndexes`
        * `ClientRelationships`
        * `CustomClientFields`
        * `SalesReps`
        * `SendAccountEmails`
        * `SendAccountTexts`
        * `SendPromotionalEmails`
        * `SendPromotionalTexts`
        * `SendScheduleEmails`
        * `SendScheduleTexts`
        * `Gender` (for site custom values)
        Custom client Gender options can only be created with non-cross-regional
        requests.

        If you have purchased an Ultimate tier then this endpoint will automatically
        start showing a new opportunity on Sales Pipeline.It will create a new
        opportunity if the current request modify the contact as follows::

        * You need to update the `IsProspect` parameter, to `true`.
        * You need to update the `ProspectStage`.`Description parameter`, to `New
        Lead`.<br />
        Updates made to any inactive clients will automatically reactivate the client
        unless the `Acive` property is explicitly set to `false` in the request body.

        Args:
            version (str): version of the api.
            request (UpdateClientRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            UpdateClientResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/updateclient")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UpdateClientResponse.from_dictionary),
        ).execute()

    def update_client_contract_autopays(self,
                                        version,
                                        request,
                                        site_id,
                                        authorization=None):
        """Perform a POST request to
        /public/v{version}/client/updateclientcontractautopays.

        This endpoint can be used to update the amount and/or the item of a client’s
        autopay schedule.

        Args:
            version (str): version of the api.
            request (UpdateClientContractAutopaysRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            Contract: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/updateclientcontractautopays")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(Contract.from_dictionary),
        ).execute()

    def update_client_service(self,
                              version,
                              request,
                              site_id,
                              authorization=None):
        """Perform a POST request to
        /public/v{version}/client/updateclientservice.

        Updates the active date and/or expiration date of a client pricing option.
        This request requires staff user credentials. If the active date is modified,
        the expiration date is also modified accordingly. If the expiration date is
        modified, the active date is unchanged.

        Args:
            version (str): version of the api.
            request (UpdateClientServiceRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            UpdateClientServiceResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/updateclientservice")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UpdateClientServiceResponse.from_dictionary),
        ).execute()

    def update_client_visit(self,
                            version,
                            request,
                            site_id,
                            authorization=None):
        """Perform a POST request to
        /public/v{version}/client/updateclientvisit.

        Updates the status of the specified visit.

        Args:
            version (str): version of the api.
            request (UpdateClientVisitRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            UpdateClientVisitResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/updateclientvisit")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UpdateClientVisitResponse.from_dictionary),
        ).execute()

    def update_contact_log(self,
                           version,
                           request,
                           site_id,
                           authorization=None):
        """Perform a POST request to
        /public/v{version}/client/updatecontactlog.

        Update a contact log on a client's account.

        Args:
            version (str): version of the api.
            request (UpdateContactLogRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            ContactLog: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/updatecontactlog")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(ContactLog.from_dictionary),
        ).execute()

    def upload_client_document(self,
                               version,
                               request,
                               site_id,
                               authorization=None):
        """Perform a POST request to
        /public/v{version}/client/uploadclientdocument.

        Uploads a document file for a specific client. Returns a string
        representation of the image byte array. The maximum size file that can be
        uploaded is **4MB**.

        Args:
            version (str): version of the api.
            request (UploadClientDocumentRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            UploadClientDocumentResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/uploadclientdocument")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UploadClientDocumentResponse.from_dictionary),
        ).execute()

    def upload_client_photo(self,
                            version,
                            request,
                            site_id,
                            authorization=None):
        """Perform a POST request to
        /public/v{version}/client/uploadclientphoto.

        Uploads a client’s profile photo. The maximum file size is 4 MB and
        acceptable file types are:
        * bmp
        * jpeg
        * gif
        * tiff
        * png

        Args:
            version (str): version of the api.
            request (UploadClientPhotoRequest): The request body parameter.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.

        Returns:
            UploadClientPhotoResponse: Response from the API. OK

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/uploadclientphoto")
            .http_method(HttpMethodEnum.POST)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .body_param(Parameter()
                .value(request))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("Content-Type")
                .value("application/json"))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UploadClientPhotoResponse.from_dictionary),
        ).execute()

    def delete_client_formula_note(self,
                                   version,
                                   request_client_id,
                                   request_formula_note_id,
                                   site_id,
                                   authorization=None,
                                   request_limit=None,
                                   request_offset=None):
        """Perform a DELETE request to
        /public/v{version}/client/clientformulanote.

        This endpoint deletes an existing formula note. A staff user token must be
        included with staff assigned permission to view client profile or have both
        ViewAppointmentDetails and ModifyAppointment permissions.

        Args:
            version (str): version of the api.
            request_client_id (str): The client ID of the client whose formula note
                needs to be deleted.
            request_formula_note_id (int): The formula note ID for the note to be
                deleted.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            void: Response from the API. NoContent

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/clientformulanote")
            .http_method(HttpMethodEnum.DELETE)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.formulaNoteId")
                .value(request_formula_note_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .auth(Single("API-Key")),
        ).execute()

    def delete_contact_log(self,
                           version,
                           request_client_id,
                           request_contact_log_id,
                           site_id,
                           authorization=None,
                           request_test=None):
        """Perform a DELETE request to
        /public/v{version}/client/deletecontactlog.

        This endpoint deletes contactlog of client. This endpoint requires staff user
        credentials.

        Args:
            version (str): version of the api.
            request_client_id (str): The client ID of the client whose Contact Log is
                being deleted.
            request_contact_log_id (int): The Contact Log ID.
            site_id (str): ID of the site from which to pull data.
            authorization (str, optional): A staff user authorization token.
            request_test (bool, optional): When `true`, indicates that this is a test
                request and no data is inserted into the subscriber’s database.  When
                `false`, the database is updated.

        Returns:
            Any: Response from the API. This endpoint does not return a response. If
                a call to this endpoint results in a 200 OK HTTP status code, then
                the call was successful.

        Raises:
            APIException: When an error occurs while fetching the data from the
                remote API. This exception includes the HTTP Response code, an error
                message, and the HTTP body that was received in the request.

        """
        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.DEFAULT)
            .path("/public/v{version}/client/deletecontactlog")
            .http_method(HttpMethodEnum.DELETE)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .query_param(Parameter()
                .key("request.clientId")
                .value(request_client_id))
            .query_param(Parameter()
                .key("request.contactLogId")
                .value(request_contact_log_id))
            .header_param(Parameter()
                .key("siteId")
                .value(site_id))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.test")
                .value(request_test))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()
