ClubReady Api

<back to all web services

CreateClassBookingRequest

The following routes are available for this service:
POST/scheduling/class-bookingCreate a Class Booking
POST/v2/{ApiKey}/club/{StoreId}/booking(obsolete) Create a Class Booking
POST/v2/{ApiKey}/club/{StoreId}/class-booking(obsolete) Create a Class Booking
import 'package:servicestack/servicestack.dart';

class ApiDtoBase implements IConvertible
{
    String? ApiKey;
    int? StoreId;
    int? ChainId;

    ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
    ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ApiKey = json['ApiKey'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'StoreId': StoreId,
        'ChainId': ChainId
    };

    getTypeName() => "ApiDtoBase";
    TypeContext? context = _ctx;
}

class CreateClassBookingRequestDto extends ApiDtoBase implements IConvertible
{
    int? UserId;
    int? ScheduleId;
    bool? AllowWaitList;

    CreateClassBookingRequestDto({this.UserId,this.ScheduleId,this.AllowWaitList});
    CreateClassBookingRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        UserId = json['UserId'];
        ScheduleId = json['ScheduleId'];
        AllowWaitList = json['AllowWaitList'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'UserId': UserId,
        'ScheduleId': ScheduleId,
        'AllowWaitList': AllowWaitList
    });

    getTypeName() => "CreateClassBookingRequestDto";
    TypeContext? context = _ctx;
}

enum RestrictedResourceType
{
    Store,
    Chain,
    User,
    Undefined,
}

class CreateClassBookingRequest extends CreateClassBookingRequestDto implements IRestrictedApiRequest, IConvertible
{
    /**
    * Api Key - grants access to resources
    */
    // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
    String? ApiKey;

    /**
    * UserID
    */
    // @ApiMember(DataType="string", Description="UserID", IsRequired=true, Name="UserId", ParameterType="query")
    int? UserId;

    /**
    * Store ID
    */
    // @ApiMember(DataType="integer", Description="Store ID", IsRequired=true, Name="StoreId", ParameterType="query")
    int? StoreId;

    /**
    * Class Schedule ID
    */
    // @ApiMember(DataType="integer", Description="Class Schedule ID", IsRequired=true, Name="ScheduleId", ParameterType="query")
    int? ScheduleId;

    /**
    * Put user in wait list when possible
    */
    // @ApiMember(DataType="bool", Description="Put user in wait list when possible", Name="AllowWaitList", ParameterType="query")
    bool? AllowWaitList;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    CreateClassBookingRequest({this.ApiKey,this.UserId,this.StoreId,this.ScheduleId,this.AllowWaitList,this.RestrictedId,this.RestrictedResourceType});
    CreateClassBookingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ApiKey = json['ApiKey'];
        UserId = json['UserId'];
        StoreId = json['StoreId'];
        ScheduleId = json['ScheduleId'];
        AllowWaitList = json['AllowWaitList'];
        RestrictedId = json['RestrictedId'];
        RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ApiKey': ApiKey,
        'UserId': UserId,
        'StoreId': StoreId,
        'ScheduleId': ScheduleId,
        'AllowWaitList': AllowWaitList,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
    });

    getTypeName() => "CreateClassBookingRequest";
    TypeContext? context = _ctx;
}

class CreateClassBookingResponseDto implements IConvertible
{
    int? BookingId;
    String? Message;

    CreateClassBookingResponseDto({this.BookingId,this.Message});
    CreateClassBookingResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BookingId = json['BookingId'];
        Message = json['Message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BookingId': BookingId,
        'Message': Message
    };

    getTypeName() => "CreateClassBookingResponseDto";
    TypeContext? context = _ctx;
}

class CreateClassBookingResponse extends CreateClassBookingResponseDto implements IConvertible
{
    int? BookingId;
    String? Message;

    CreateClassBookingResponse({this.BookingId,this.Message});
    CreateClassBookingResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        BookingId = json['BookingId'];
        Message = json['Message'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'BookingId': BookingId,
        'Message': Message
    });

    getTypeName() => "CreateClassBookingResponse";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'CreateClassBookingRequestDto': TypeInfo(TypeOf.Class, create:() => CreateClassBookingRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'CreateClassBookingRequest': TypeInfo(TypeOf.Class, create:() => CreateClassBookingRequest()),
    'CreateClassBookingResponseDto': TypeInfo(TypeOf.Class, create:() => CreateClassBookingResponseDto()),
    'CreateClassBookingResponse': TypeInfo(TypeOf.Class, create:() => CreateClassBookingResponse()),
});

Dart CreateClassBookingRequest 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.

POST /scheduling/class-booking HTTP/1.1 
Host: www.clubready.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateClassBookingRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model">
  <ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
  <ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
  <StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
  <AllowWaitList xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">false</AllowWaitList>
  <ScheduleId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">0</ScheduleId>
  <UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Scheduling.Models.Dto.Requests">0</UserId>
</CreateClassBookingRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreateClassBookingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model">
  <BookingId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</BookingId>
  <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message>
</CreateClassBookingResponse>