ClubReady Api

<back to all web services

CreditCheckRequest

The following routes are available for this service:
GET/scheduling/{UserId}/credit-checkCheck to see if a particular credit can be used to book a certain class or service.
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 CreditCheckRequestDto extends ApiDtoBase implements IConvertible
{
    int? UserId;
    int? CustomerSessionId;
    int? ClassId;
    int? SessionSizeId;

    CreditCheckRequestDto({this.UserId,this.CustomerSessionId,this.ClassId,this.SessionSizeId});
    CreditCheckRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

class CreditCheckRequest extends CreditCheckRequestDto 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 User ID
    */
    // @ApiMember(DataType="integer", Description="ClubReady User ID", IsRequired=true, Name="UserId", ParameterType="path")
    int? UserId;

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

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

    /**
    * ClubReady Session Size ID
    */
    // @ApiMember(DataType="integer", Description="ClubReady Session Size ID", Name="SessionSizeId", ParameterType="query")
    int? SessionSizeId;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    CreditCheckRequest({this.ApiKey,this.ChainId,this.StoreId,this.UserId,this.CustomerSessionId,this.ClassId,this.SessionSizeId,this.RestrictedId,this.RestrictedResourceType});
    CreditCheckRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ApiKey = json['ApiKey'];
        ChainId = json['ChainId'];
        StoreId = json['StoreId'];
        UserId = json['UserId'];
        CustomerSessionId = json['CustomerSessionId'];
        ClassId = json['ClassId'];
        SessionSizeId = json['SessionSizeId'];
        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,
        'UserId': UserId,
        'CustomerSessionId': CustomerSessionId,
        'ClassId': ClassId,
        'SessionSizeId': SessionSizeId,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
    });

    getTypeName() => "CreditCheckRequest";
    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 CreditCheckResponseDto extends ApiResponseBase implements IConvertible
{
    bool? CanUse;

    CreditCheckResponseDto({this.CanUse});
    CreditCheckResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CreditCheckResponse extends CreditCheckResponseDto implements IConvertible
{
    bool? Success;
    String? Message;
    bool? CanUse;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'CreditCheckRequestDto': TypeInfo(TypeOf.Class, create:() => CreditCheckRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'CreditCheckRequest': TypeInfo(TypeOf.Class, create:() => CreditCheckRequest()),
    'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
    'CreditCheckResponseDto': TypeInfo(TypeOf.Class, create:() => CreditCheckResponseDto()),
    'CreditCheckResponse': TypeInfo(TypeOf.Class, create:() => CreditCheckResponse()),
});

Dart CreditCheckRequest 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/{UserId}/credit-check HTTP/1.1 
Host: www.clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreditCheckResponse 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>
  <CanUse xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</CanUse>
</CreditCheckResponse>