ClubReady Api

<back to all web services

ClassRosterRequest

The following routes are available for this service:
GET/scheduling/class-rosterGet booked and waitlisted users for a class.
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 ClassRosterRequestDto(ApiDtoBase):
    class_schedule_id: int = 0


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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClassRosterRequest(ClassRosterRequestDto, 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="Store Id or Chain Id is required", Name="StoreId", ParameterType="query")
    store_id: Optional[int] = None
    """
    Store Id or Chain Id is required
    """


    # @ApiMember(DataType="integer", Description="Store Id or Chain Id is required", Name="ChainId", ParameterType="query")
    chain_id: Optional[int] = None
    """
    Store Id or Chain Id is required
    """


    # @ApiMember(DataType="integer", Description="Class Schedule ID", IsRequired=true, Name="ClassScheduleId", ParameterType="query")
    class_schedule_id: int = 0
    """
    Class Schedule ID
    """


    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 ClassRosterCreditType(IntEnum):
    UNINITIALIZED = 0
    PAID_CREDIT = 1
    FREE_CREDIT = 2
    AMENITY_CREDIT = 3
    MEMBERSHIP_TYPE_CREDIT = 4
    CLASS_PASS_CREDIT = 5
    ERROR = -1


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClassRosterItem:
    booking_id: int = 0
    user_id: int = 0
    first_name: Optional[str] = None
    last_name: Optional[str] = None
    email: Optional[str] = None
    phone: Optional[str] = None
    booking_made: datetime.datetime = datetime.datetime(1, 1, 1)
    first_time_booking: bool = False
    package_name: Optional[str] = None
    package_id: Optional[int] = None
    lead_type_name: Optional[str] = None
    lead_type_id: Optional[int] = None
    is_member: bool = False
    member_expiration: Optional[datetime.datetime] = None
    credit_type: Optional[ClassRosterCreditType] = None
    credits_remaining: int = 0
    next_credit_expiration: Optional[datetime.datetime] = None
    booking_status_id: Optional[int] = None
    booking_status_description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClassRosterResponseDto(ApiResponseBase):
    class_roster: Optional[List[ClassRosterItem]] = None
    wait_list: Optional[List[ClassRosterItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClassRosterResponse(ClassRosterResponseDto):
    success: bool = False
    message: Optional[str] = None
    class_date: datetime.datetime = datetime.datetime(1, 1, 1)
    free_spots: int = 0
    max_spots: int = 0
    total_booked: int = 0
    location_type: Optional[str] = None
    virtual_link: Optional[str] = None
    class_roster: Optional[List[ClassRosterItem]] = None
    wait_list: Optional[List[ClassRosterItem]] = None

Python ClassRosterRequest 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/class-roster HTTP/1.1 
Host: clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ClassRosterResponse 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>
  <ClassRoster xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
    <ClassRosterItem>
      <BookingId>0</BookingId>
      <BookingMade>0001-01-01T00:00:00</BookingMade>
      <BookingStatusDescription>String</BookingStatusDescription>
      <BookingStatusId>0</BookingStatusId>
      <CreditType>Uninitialized</CreditType>
      <CreditsRemaining>0</CreditsRemaining>
      <Email>String</Email>
      <FirstName>String</FirstName>
      <FirstTimeBooking>false</FirstTimeBooking>
      <IsMember>false</IsMember>
      <IsWaitList>false</IsWaitList>
      <LastName>String</LastName>
      <LeadTypeId>0</LeadTypeId>
      <LeadTypeName>String</LeadTypeName>
      <MemberExpiration>0001-01-01T00:00:00</MemberExpiration>
      <NextCreditExpiration>0001-01-01T00:00:00</NextCreditExpiration>
      <PackageId>0</PackageId>
      <PackageName>String</PackageName>
      <Phone>String</Phone>
      <UserId>0</UserId>
    </ClassRosterItem>
  </ClassRoster>
  <WaitList xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
    <ClassRosterItem>
      <BookingId>0</BookingId>
      <BookingMade>0001-01-01T00:00:00</BookingMade>
      <BookingStatusDescription>String</BookingStatusDescription>
      <BookingStatusId>0</BookingStatusId>
      <CreditType>Uninitialized</CreditType>
      <CreditsRemaining>0</CreditsRemaining>
      <Email>String</Email>
      <FirstName>String</FirstName>
      <FirstTimeBooking>false</FirstTimeBooking>
      <IsMember>false</IsMember>
      <IsWaitList>false</IsWaitList>
      <LastName>String</LastName>
      <LeadTypeId>0</LeadTypeId>
      <LeadTypeName>String</LeadTypeName>
      <MemberExpiration>0001-01-01T00:00:00</MemberExpiration>
      <NextCreditExpiration>0001-01-01T00:00:00</NextCreditExpiration>
      <PackageId>0</PackageId>
      <PackageName>String</PackageName>
      <Phone>String</Phone>
      <UserId>0</UserId>
    </ClassRosterItem>
  </WaitList>
  <ClassDate>0001-01-01T00:00:00</ClassDate>
  <FreeSpots>0</FreeSpots>
  <LocationType>String</LocationType>
  <MaxSpots>0</MaxSpots>
  <TotalBooked>0</TotalBooked>
  <VirtualLink>String</VirtualLink>
</ClassRosterResponse>