"""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_promo_code_response import (
    AddPromoCodeResponse,
)
from mindbodypublicapi.models.add_site_client_index_response import (
    AddSiteClientIndexResponse,
)
from mindbodypublicapi.models.get_activation_code_response import (
    GetActivationCodeResponse,
)
from mindbodypublicapi.models.get_categories_response import (
    GetCategoriesResponse,
)
from mindbodypublicapi.models.get_genders_response import (
    GetGendersResponse,
)
from mindbodypublicapi.models.get_liability_waiver_response import (
    GetLiabilityWaiverResponse,
)
from mindbodypublicapi.models.get_locations_response import (
    GetLocationsResponse,
)
from mindbodypublicapi.models.get_memberships_response import (
    GetMembershipsResponse,
)
from mindbodypublicapi.models.get_mobile_providers_response import (
    GetMobileProvidersResponse,
)
from mindbodypublicapi.models.get_payment_types_response import (
    GetPaymentTypesResponse,
)
from mindbodypublicapi.models.get_programs_response import (
    GetProgramsResponse,
)
from mindbodypublicapi.models.get_promo_codes_response import (
    GetPromoCodesResponse,
)
from mindbodypublicapi.models.get_prospect_stages_response import (
    GetProspectStagesResponse,
)
from mindbodypublicapi.models.get_relationships_response import (
    GetRelationshipsResponse,
)
from mindbodypublicapi.models.get_resources_response import (
    GetResourcesResponse,
)
from mindbodypublicapi.models.get_session_types_response import (
    GetSessionTypesResponse,
)
from mindbodypublicapi.models.get_sites_response import (
    GetSitesResponse,
)
from mindbodypublicapi.models.update_site_client_index_response import (
    UpdateSiteClientIndexResponse,
)


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

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

    def get_activation_code(self,
                            version,
                            authorization=None):
        """Perform a GET request to /public/v{version}/site/activationcode.

        Before you can use this endpoint, MINDBODY must approve your developer
        account for live access. If you have finished testing in the sandbox and are
        ready to begin working with MINDBODY customers, log into your account and
        request to go live.
        See [Accessing Business Data From
        MINDBODY](https://developers.mindbodyonline.com/PublicDocumentation/V6#accessi
        ng-business-data) for more information about the activation code and how to
        use it.
        Once you are approved, this endpoint returns an activation code.This endpoint
        supports only one site per call.

        Args:
            version (str): version of the api.
            authorization (str, optional): A staff user authorization token.

        Returns:
            GetActivationCodeResponse: 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}/site/activationcode")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .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(GetActivationCodeResponse.from_dictionary),
        ).execute()

    def get_categories(self,
                       version,
                       site_id,
                       authorization=None,
                       request_active=None,
                       request_category_ids=None,
                       request_limit=None,
                       request_offset=None,
                       request_service=None,
                       request_sub_category_ids=None):
        """Perform a GET request to /public/v{version}/site/categories.

        Gets the categories.

        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_active (bool, optional): When `true`, the response only contains
                categories which are activated.   When `false`, only deactivated
                categories are returned.  Default: **All Categories**
            request_category_ids (List[int], optional): When included, the response
                only contains details about the specified category Ids.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_service (bool, optional): When `true`, the response only contains
                details about Revenue Categories.  When `false`, only Product Revenue
                Categories are returned.  Default: **All Categories**
            request_sub_category_ids (List[int], optional): When included, the
                response only contains details about the specified subcategory Ids.

        Returns:
            GetCategoriesResponse: 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}/site/categories")
            .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.active")
                .value(request_active))
            .query_param(Parameter()
                .key("request.categoryIds")
                .value(request_category_ids))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.service")
                .value(request_service))
            .query_param(Parameter()
                .key("request.subCategoryIds")
                .value(request_sub_category_ids))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetCategoriesResponse.from_dictionary),
        ).execute()

    def get_genders(self,
                    version,
                    site_id,
                    authorization=None):
        """Perform a GET request to /public/v{version}/site/genders.

        The endpoint returns a list of configured client gender options for a site.
        Custom gender options are assignable to client genders only. Currently,
        custom values returned from this endpoint cannot be used as input for other
        endpoints to specify the genders of staff or client preferences.

        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:
            GetGendersResponse: 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}/site/genders")
            .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(GetGendersResponse.from_dictionary),
        ).execute()

    def get_liability_waiver(self,
                             version,
                             site_id,
                             authorization=None):
        """Perform a GET request to /public/v{version}/site/liabilitywaiver.

        Gets Liability Waiver content at the specified business.
        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.

        Returns:
            GetLiabilityWaiverResponse: 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}/site/liabilitywaiver")
            .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(GetLiabilityWaiverResponse.from_dictionary),
        ).execute()

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

        Get locations for a site.

        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:
            GetLocationsResponse: 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}/site/locations")
            .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(GetLocationsResponse.from_dictionary),
        ).execute()

    def get_memberships(self,
                        version,
                        site_id,
                        authorization=None,
                        request_membership_ids=None):
        """Perform a GET request to /public/v{version}/site/memberships.

        Get the memberships at a site.

        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_membership_ids (List[int], optional): The requested membership
                IDs.<br />  Default: **all** IDs that the authenticated user’s access
                level allows.

        Returns:
            GetMembershipsResponse: 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}/site/memberships")
            .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.membershipIds")
                .value(request_membership_ids))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetMembershipsResponse.from_dictionary),
        ).execute()

    def get_mobile_providers(self,
                             version,
                             site_id,
                             authorization=None,
                             request_active=None):
        """Perform a GET request to /public/v{version}/site/mobileproviders.

        Get the list of mobile providers that are supported by the business.

        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_active (bool, optional): When `true`, the response only contains
                mobile providers which are activated.   When `false`, only
                deactivated mobile providers are returned.  Default: **All Mobile
                Providers**

        Returns:
            GetMobileProvidersResponse: 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}/site/mobileproviders")
            .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.active")
                .value(request_active))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetMobileProvidersResponse.from_dictionary),
        ).execute()

    def get_payment_types(self,
                          version,
                          site_id,
                          authorization=None,
                          request_active=None):
        """Perform a GET request to /public/v{version}/site/paymenttypes.

        Get payment types for a site.

        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_active (bool, optional): When `true`, the response only contains
                payment types which are activated.  When `false`, only deactivated
                payment types are returned.  Default: **All Payment Types**

        Returns:
            GetPaymentTypesResponse: 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}/site/paymenttypes")
            .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.active")
                .value(request_active))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetPaymentTypesResponse.from_dictionary),
        ).execute()

    def get_programs(self,
                     version,
                     site_id,
                     authorization=None,
                     request_limit=None,
                     request_offset=None,
                     request_online_only=None,
                     request_program_ids=None,
                     request_schedule_type=None):
        """Perform a GET request to /public/v{version}/site/programs.

        Get service categories offered at a site.

        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.
            request_online_only (bool, optional): If `true`, filters results to show
                only those programs that are shown online.<br />  If `false`, all
                programs are returned.<br />  Default: **false**
            request_program_ids (List[int], optional): Program Ids to filter for
            request_schedule_type (RequestScheduleTypeEnum, optional): A schedule
                type used to filter the returned results. Possible values are:  * All
                * Class  * Enrollment  * Appointment  * Resource  * Media  * Arrival

        Returns:
            GetProgramsResponse: 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}/site/programs")
            .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))
            .query_param(Parameter()
                .key("request.onlineOnly")
                .value(request_online_only))
            .query_param(Parameter()
                .key("request.programIds")
                .value(request_program_ids))
            .query_param(Parameter()
                .key("request.scheduleType")
                .value(request_schedule_type))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetProgramsResponse.from_dictionary),
        ).execute()

    def get_promo_codes(self,
                        version,
                        site_id,
                        authorization=None,
                        request_active_only=None,
                        request_end_date=None,
                        request_last_modified_date=None,
                        request_limit=None,
                        request_offset=None,
                        request_online_only=None,
                        request_start_date=None):
        """Perform a GET request to /public/v{version}/site/promocodes.

        Gets a list of promocodes at the specified business. This endpoint requires
        staff user credentials.
        This staff member should have enabled the Set up promotions / **Semester
        discounts** staff permission.

        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_active_only (bool, optional): If true, filters results to show
                only promocodes that are active. If **false**, all promocodes are
                returned.  Default: **true**
            request_end_date (datetime, optional): Filters results to promocodes that
                were activated before this date.
            request_last_modified_date (datetime, optional): Filters results to
                promocodes that were 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_online_only (bool, optional): If `true`, filters results to show
                only promocodes that can be used for online sale.  If `false`, all
                promocodes are returned.  Default: **false**
            request_start_date (datetime, optional): Filters results to promocodes
                that were activated after this date.

        Returns:
            GetPromoCodesResponse: 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}/site/promocodes")
            .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.activeOnly")
                .value(request_active_only))
            .query_param(Parameter()
                .key("request.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .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.onlineOnly")
                .value(request_online_only))
            .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(GetPromoCodesResponse.from_dictionary),
        ).execute()

    def get_prospect_stages(self,
                            version,
                            site_id,
                            authorization=None,
                            request_active=None):
        """Perform a GET request to /public/v{version}/site/prospectstages.

        Get the list of prospect stages that represent the prospect stage options for
        prospective clients.

        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_active (bool, optional): When `true`, the response only contains
                prospect stages which are activated.  When `false`, only deactivated
                prospect stages are returned.  Default: **All Prospect Stages**

        Returns:
            GetProspectStagesResponse: 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}/site/prospectstages")
            .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.active")
                .value(request_active))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetProspectStagesResponse.from_dictionary),
        ).execute()

    def get_relationships(self,
                          version,
                          site_id,
                          authorization=None,
                          request_active=None,
                          request_limit=None,
                          request_offset=None):
        """Perform a GET request to /public/v{version}/site/relationships.

        This endpoint retrieves the business site relationships.

        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_active (bool, optional): When `true`, the response only contains
                relationships which are activated.  When `false`, only deactivated
                relationships are returned.  Default: **All Relationships**
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.

        Returns:
            GetRelationshipsResponse: 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}/site/relationships")
            .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.active")
                .value(request_active))
            .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(GetRelationshipsResponse.from_dictionary),
        ).execute()

    def get_resource_availabilities(self,
                                    version,
                                    site_id,
                                    authorization=None,
                                    request_end_date=None,
                                    request_limit=None,
                                    request_location_ids=None,
                                    request_offset=None,
                                    request_program_ids=None,
                                    request_resource_ids=None,
                                    request_schedule_types=None,
                                    request_start_date=None):
        """Perform a GET request to
        /public/v{version}/site/resourceavailabilities.

        Get resource availabilities used at a site.

        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_end_date (datetime, optional): End date. If default, StartDate is
                used.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_location_ids (List[int], optional): Filter by location ids
                (optional)
            request_offset (int, optional): Page offset, defaults to 0.
            request_program_ids (List[int], optional): Filter by program ids
                (optional)
            request_resource_ids (List[int], optional): Filter on resourceIds
            request_schedule_types (List[RequestScheduleTypeEnum], optional): Filter
                by schedule types (optional)
            request_start_date (datetime, optional): Start time

        Returns:
            GetResourcesResponse: 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}/site/resourceavailabilities")
            .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.endDate")
                .value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
                    request_end_date)))
            .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.resourceIds")
                .value(request_resource_ids))
            .query_param(Parameter()
                .key("request.scheduleTypes")
                .value(request_schedule_types))
            .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(GetResourcesResponse.from_dictionary),
        ).execute()

    def get_resources(self,
                      version,
                      site_id,
                      authorization=None,
                      request_include_inactive=None,
                      request_limit=None,
                      request_location_ids=None,
                      request_offset=None,
                      request_program_ids=None,
                      request_resource_ids=None,
                      request_schedule_types=None):
        """Perform a GET request to /public/v{version}/site/resources.

        Get resources used at a site.

        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): Enable to include inactive
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_location_ids (List[int], optional): Filter by location ids
                (optional)
            request_offset (int, optional): Page offset, defaults to 0.
            request_program_ids (List[int], optional): Filter by program ids
                (optional)
            request_resource_ids (List[int], optional): Filter on resourceIds
            request_schedule_types (List[RequestScheduleTypeEnum], optional): Filter
                by schedule types (optional)

        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}/site/resources")
            .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))
            .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.resourceIds")
                .value(request_resource_ids))
            .query_param(Parameter()
                .key("request.scheduleTypes")
                .value(request_schedule_types))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize),
        ).execute()

    def get_session_types(self,
                          version,
                          site_id,
                          authorization=None,
                          request_limit=None,
                          request_offset=None,
                          request_online_only=None,
                          request_program_i_ds=None):
        """Perform a GET request to /public/v{version}/site/sessiontypes.

        Get the session types used at a site.

        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.
            request_online_only (bool, optional): When `true`, indicates that only
                the session types that can be booked online should be returned.<br />
                Default: **false**
            request_program_i_ds (List[int], optional): Filters results to session
                types that belong to one of the given program IDs. If omitted, all
                program IDs return.

        Returns:
            GetSessionTypesResponse: 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}/site/sessiontypes")
            .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))
            .query_param(Parameter()
                .key("request.onlineOnly")
                .value(request_online_only))
            .query_param(Parameter()
                .key("request.programIDs")
                .value(request_program_i_ds))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetSessionTypesResponse.from_dictionary),
        ).execute()

    def get_sites(self,
                  version,
                  authorization=None,
                  request_include_lead_channels=None,
                  request_include_per_staff_pricing=None,
                  request_limit=None,
                  request_offset=None,
                  request_site_ids=None):
        """Perform a GET request to /public/v{version}/site/sites.

        Gets a list of sites that the developer has permission to view.
        * Passing in no `SiteIds` returns all sites that the developer has access to.
        * Passing in one `SiteIds` returns more detailed information about the
        specified site.
        Important Behavior Notice:
        When calling GetSites without specifying a SiteId, or when passing multiple
        SiteIds, the response will include only limited data for each site. This is
        expected behavior designed to help identify accessible sites without
        returning full site-level configuration details.
        To retrieve complete information for a specific site, please make a separate
        GetSites request using a single SiteId.
        This design helps reduce payload size for multi-site queries, but we
        recognize it may require additional requests when full detail is needed. If
        your integration depends on full site-level data, we recommend retrieving the
        list of site IDs first, then querying each one individually as needed.

        Args:
            version (str): version of the api.
            authorization (str, optional): A staff user authorization token.
            request_include_lead_channels (bool, optional): This is an optional
                parameter to get lead channels for a Site.
            request_include_per_staff_pricing (bool, optional): Include whether or
                not studios have per staff pricing enabled.
            request_limit (int, optional): Number of results to include, defaults to
                100
            request_offset (int, optional): Page offset, defaults to 0.
            request_site_ids (List[int], optional): List of the requested site IDs.
                When omitted, returns all sites that the source has access to.

        Returns:
            GetSitesResponse: 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}/site/sites")
            .http_method(HttpMethodEnum.GET)
            .template_param(Parameter()
                .key("version")
                .value(version)
                .should_encode(True))
            .header_param(Parameter()
                .key("authorization")
                .value(authorization))
            .query_param(Parameter()
                .key("request.includeLeadChannels")
                .value(request_include_lead_channels))
            .query_param(Parameter()
                .key("request.includePerStaffPricing")
                .value(request_include_per_staff_pricing))
            .query_param(Parameter()
                .key("request.limit")
                .value(request_limit))
            .query_param(Parameter()
                .key("request.offset")
                .value(request_offset))
            .query_param(Parameter()
                .key("request.siteIds")
                .value(request_site_ids))
            .header_param(Parameter()
                .key("accept")
                .value("application/json"))
            .auth(Single("API-Key")),
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(GetSitesResponse.from_dictionary),
        ).execute()

    def add_client_index(self,
                         version,
                         request,
                         site_id,
                         authorization=None):
        """Perform a POST request to /public/v{version}/site/addclientindex.

        Creates a new client index record at the specified business.
        This endpoint requires staff user credentials.

        Args:
            version (str): version of the api.
            request (AddSiteClientIndexRequest): 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:
            AddSiteClientIndexResponse: 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}/site/addclientindex")
            .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(AddSiteClientIndexResponse.from_dictionary),
        ).execute()

    def add_promo_code(self,
                       version,
                       request,
                       site_id,
                       authorization=None):
        """Perform a POST request to /public/v{version}/site/addpromocode.

        Creates a new promocode record at the specified business.
        This endpoint requires staff user credentials. This staff memeber should have
        enabled the **Set up promotions / Semester discounts** staff permission.

        Args:
            version (str): version of the api.
            request (AddPromoCodeRequest): 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:
            AddPromoCodeResponse: 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}/site/addpromocode")
            .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(AddPromoCodeResponse.from_dictionary),
        ).execute()

    def deactivate_promo_code(self,
                              version,
                              request,
                              site_id,
                              authorization=None):
        """Perform a POST request to
        /public/v{version}/site/deactivatepromocode.

        Deactivates an existing promocode record at the specified business.
        This endpoint requires staff user credentials. This staff memeber should have
        enabled the **Set up promotions / Semester discounts** staff permission.

        Args:
            version (str): version of the api.
            request (DeactivatePromoCodeRequest): 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}/site/deactivatepromocode")
            .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 update_client_index(self,
                            version,
                            request,
                            site_id,
                            authorization=None):
        """Perform a POST request to /public/v{version}/site/updateclientindex.

        Updates an exisitng client index record at the specified business.
        This endpoint requires staff user credentials.

        Args:
            version (str): version of the api.
            request (UpdateSiteClientIndexRequest): 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:
            UpdateSiteClientIndexResponse: 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}/site/updateclientindex")
            .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(UpdateSiteClientIndexResponse.from_dictionary),
        ).execute()
