ClubReady Api

<back to all web services

BookingStatusEventsRequest

The following routes are available for this service:
GET/scheduling/booking-status-eventsList of booking status changes in a time frame.
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiDtoBase:
    api_key: Optional[str] = None
    store_id: Optional[int] = None
    chain_id: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsRequestDto(ApiDtoBase):
    from_date: datetime.datetime = datetime.datetime(1, 1, 1)
    to_date: datetime.datetime = datetime.datetime(1, 1, 1)
    booking_type_filter: int = 0
    consult_filter: int = 0
    status_filter: Optional[int] = None


class RestrictedResourceType(str, Enum):
    STORE = 'Store'
    CHAIN = 'Chain'
    USER = 'User'
    UNDEFINED = 'Undefined'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsRequest(BookingStatusEventsRequestDto, IRestrictedApiRequest):
    # @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
    api_key: Optional[str] = None
    """
    Api Key - grants access to resources
    """


    # @ApiMember(DataType="integer", Description="Chain ID", Name="ChainId", ParameterType="query")
    chain_id: Optional[int] = None
    """
    Chain ID
    """


    # @ApiMember(DataType="integer", Description="Store ID", Name="StoreId", ParameterType="query")
    store_id: Optional[int] = None
    """
    Store ID
    """


    # @ApiMember(DataType="date", Description="UTC Format", IsRequired=true, Name="FromDate", ParameterType="query")
    from_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    UTC Format
    """


    # @ApiMember(DataType="date", Description="Max 24 Hours (UTC Format)", IsRequired=true, Name="ToDate", ParameterType="query")
    to_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    Max 24 Hours (UTC Format)
    """


    # @ApiMember(DataType="integer", Description="0 = All, 1 = Classes, 2 = Services", IsRequired=true, Name="BookingTypeFilter", ParameterType="query")
    booking_type_filter: int = 0
    """
    0 = All, 1 = Classes, 2 = Services
    """


    # @ApiMember(DataType="integer", Description="0 = Any, 1 = Only Consults, 2 = Exclude Consults", IsRequired=true, Name="ConsultFilter", ParameterType="query")
    consult_filter: int = 0
    """
    0 = Any, 1 = Only Consults, 2 = Exclude Consults
    """


    # @ApiMember(DataType="integer", Description="Leave blank for any, otherwise use ClubReady BookingStatus enum", Name="StatusFilter", ParameterType="query")
    status_filter: Optional[int] = None
    """
    Leave blank for any, otherwise use ClubReady BookingStatus enum
    """


    restricted_id: Optional[int] = None
    restricted_resource_type: Optional[RestrictedResourceType] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiResponseBase:
    success: bool = False
    message: Optional[str] = None


class BookingStatus(IntEnum):
    UNDEFINED = 0
    UNAVAILABLE = 1
    OPEN = 2
    CANCELLED_WITHIN_POLICY = 3
    CANCELLED_OUTSIDE_POLICY = 4
    COMPLETED = 5
    NO_SHOW = 6
    RESCHEDULED_WITHIN_POLICY = 8
    RESCHEDULED_BY_ADMIN = 9
    CANCELLED_BY_ADMIN_NOT_CUSTOMER_FAULT = 10
    PENDING = 11
    WAIT_LISTED = 12
    ERROR = -1


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventItem:
    chain_id: Optional[int] = None
    store_id: Optional[int] = None
    user_id: int = 0
    booking_id: int = 0
    class_schedule_id: Optional[int] = None
    service_id: Optional[int] = None
    session_size_id: Optional[int] = None
    booking_date_time: datetime.datetime = datetime.datetime(1, 1, 1)
    status: Optional[BookingStatus] = None
    status_id: int = 0
    status_changed: datetime.datetime = datetime.datetime(1, 1, 1)
    consult: bool = False
    booked_from_wait_list: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsResponseDto(ApiResponseBase):
    booking_status_events: Optional[List[BookingStatusEventItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsResponse(BookingStatusEventsResponseDto):
    success: bool = False
    message: Optional[str] = None
    booking_status_events: Optional[List[BookingStatusEventItem]] = None

Python BookingStatusEventsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /scheduling/booking-status-events HTTP/1.1 
Host: clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BookingStatusEventsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model">
  <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message>
  <Success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</Success>
  <BookingStatusEvents xmlns:d2p1="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
    <d2p1:BookingStatusEventItem>
      <d2p1:BookedFromWaitList>false</d2p1:BookedFromWaitList>
      <d2p1:BookingDateTime>0001-01-01T00:00:00</d2p1:BookingDateTime>
      <d2p1:BookingId>0</d2p1:BookingId>
      <d2p1:ChainId>0</d2p1:ChainId>
      <d2p1:ClassScheduleId>0</d2p1:ClassScheduleId>
      <d2p1:Consult>false</d2p1:Consult>
      <d2p1:ServiceId>0</d2p1:ServiceId>
      <d2p1:SessionSizeId>0</d2p1:SessionSizeId>
      <d2p1:Status>Undefined</d2p1:Status>
      <d2p1:StatusChanged>0001-01-01T00:00:00</d2p1:StatusChanged>
      <d2p1:StatusId>0</d2p1:StatusId>
      <d2p1:StoreId>0</d2p1:StoreId>
      <d2p1:UserId>0</d2p1:UserId>
    </d2p1:BookingStatusEventItem>
  </BookingStatusEvents>
</BookingStatusEventsResponse>