ClubReady Api

<back to all web services

CheckBookingStatusRequest

The following routes are available for this service:
GET/scheduling/booking-status-checkDetermine if a user can book a class.
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 CheckClassBookingStatusRequestDto extends ApiDtoBase implements IConvertible
{
    int? ClassScheduleId;
    int? UserId;

    CheckClassBookingStatusRequestDto({this.ClassScheduleId,this.UserId});
    CheckClassBookingStatusRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

class CheckBookingStatusRequest extends CheckClassBookingStatusRequestDto 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;

    /**
    * Chain ID
    */
    // @ApiMember(DataType="integer", Description="Chain ID", Name="ChainId", ParameterType="query")
    int? ChainId;

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

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

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

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    CheckBookingStatusRequest({this.ApiKey,this.ChainId,this.StoreId,this.ClassScheduleId,this.UserId,this.RestrictedId,this.RestrictedResourceType});
    CheckBookingStatusRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class ApiResponseBase implements IConvertible
{
    bool? Success;
    String? Message;

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

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

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

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

class CheckBookingStatusResponseDto extends ApiResponseBase implements IConvertible
{
    bool? CanBook;
    bool? ConsumesCredit;
    String? Source;
    int? AvailableCredits;
    bool? IsBooked;
    bool? IsWaitListed;
    int? CancelHours;
    int? LeadTime;
    int? MaxLeadTime;

    CheckBookingStatusResponseDto({this.CanBook,this.ConsumesCredit,this.Source,this.AvailableCredits,this.IsBooked,this.IsWaitListed,this.CancelHours,this.LeadTime,this.MaxLeadTime});
    CheckBookingStatusResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CanBook = json['CanBook'];
        ConsumesCredit = json['ConsumesCredit'];
        Source = json['Source'];
        AvailableCredits = json['AvailableCredits'];
        IsBooked = json['IsBooked'];
        IsWaitListed = json['IsWaitListed'];
        CancelHours = json['CancelHours'];
        LeadTime = json['LeadTime'];
        MaxLeadTime = json['MaxLeadTime'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CanBook': CanBook,
        'ConsumesCredit': ConsumesCredit,
        'Source': Source,
        'AvailableCredits': AvailableCredits,
        'IsBooked': IsBooked,
        'IsWaitListed': IsWaitListed,
        'CancelHours': CancelHours,
        'LeadTime': LeadTime,
        'MaxLeadTime': MaxLeadTime
    });

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

class CheckBookingStatusResponse extends CheckBookingStatusResponseDto implements IConvertible
{
    bool? Success;
    String? Message;
    bool? CanBook;
    bool? ConsumesCredit;
    String? Source;
    int? AvailableCredits;
    bool? IsBooked;
    bool? IsWaitListed;
    int? CancelHours;
    int? LeadTime;
    int? MaxLeadTime;

    CheckBookingStatusResponse({this.Success,this.Message,this.CanBook,this.ConsumesCredit,this.Source,this.AvailableCredits,this.IsBooked,this.IsWaitListed,this.CancelHours,this.LeadTime,this.MaxLeadTime});
    CheckBookingStatusResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Success = json['Success'];
        Message = json['Message'];
        CanBook = json['CanBook'];
        ConsumesCredit = json['ConsumesCredit'];
        Source = json['Source'];
        AvailableCredits = json['AvailableCredits'];
        IsBooked = json['IsBooked'];
        IsWaitListed = json['IsWaitListed'];
        CancelHours = json['CancelHours'];
        LeadTime = json['LeadTime'];
        MaxLeadTime = json['MaxLeadTime'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Success': Success,
        'Message': Message,
        'CanBook': CanBook,
        'ConsumesCredit': ConsumesCredit,
        'Source': Source,
        'AvailableCredits': AvailableCredits,
        'IsBooked': IsBooked,
        'IsWaitListed': IsWaitListed,
        'CancelHours': CancelHours,
        'LeadTime': LeadTime,
        'MaxLeadTime': MaxLeadTime
    });

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

TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'CheckClassBookingStatusRequestDto': TypeInfo(TypeOf.Class, create:() => CheckClassBookingStatusRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'CheckBookingStatusRequest': TypeInfo(TypeOf.Class, create:() => CheckBookingStatusRequest()),
    'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
    'CheckBookingStatusResponseDto': TypeInfo(TypeOf.Class, create:() => CheckBookingStatusResponseDto()),
    'CheckBookingStatusResponse': TypeInfo(TypeOf.Class, create:() => CheckBookingStatusResponse()),
});

Dart CheckBookingStatusRequest DTOs

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

HTTP + JSV

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

GET /scheduling/booking-status-check HTTP/1.1 
Host: clubready.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Success: False,
	Message: String,
	CanBook: False,
	ConsumesCredit: False,
	Source: String,
	AvailableCredits: 0,
	IsBooked: False,
	IsWaitListed: False,
	CancelHours: 0,
	LeadTime: 0,
	MaxLeadTime: 0
}