ClubReady Api

<back to all web services

ClubVisitHistoryRequest

The following routes are available for this service:
GET/club/visit-historyReturn list of club visits, by club or entire chain.
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 ClubVisitHistoryRequestDto extends ApiDtoBase implements IConvertible
{
    DateTime? FromDate;
    DateTime? ToDate;

    ClubVisitHistoryRequestDto({this.FromDate,this.ToDate});
    ClubVisitHistoryRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
        ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
        'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!)
    });

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

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

class ClubVisitHistoryRequest extends ClubVisitHistoryRequestDto 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;

    /**
    * Either StoreId or ChainId is required
    */
    // @ApiMember(DataType="integer", Description="Either StoreId or ChainId is required", Name="StoreId", ParameterType="query")
    int? StoreId;

    /**
    * Either StoreId or ChainId is required
    */
    // @ApiMember(DataType="integer", Description="Either StoreId or ChainId is required", Name="ChainId", ParameterType="query")
    int? ChainId;

    /**
    * UTC Format
    */
    // @ApiMember(DataType="date", Description="UTC Format", IsRequired=true, Name="FromDate", ParameterType="query")
    DateTime? FromDate;

    /**
    * Max 24 Hours (UTC Format)
    */
    // @ApiMember(DataType="date", Description="Max 24 Hours (UTC Format)", IsRequired=true, Name="ToDate", ParameterType="query")
    DateTime? ToDate;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    ClubVisitHistoryRequest({this.ApiKey,this.StoreId,this.ChainId,this.FromDate,this.ToDate,this.RestrictedId,this.RestrictedResourceType});
    ClubVisitHistoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

    getTypeName() => "ClubVisitHistoryRequest";
    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 ClubVisitHistoryItem implements IConvertible
{
    int? CheckinLogId;
    int? UserId;
    String? FirstName;
    String? LastName;
    int? CheckinStoreId;
    String? CheckinLocationName;
    int? HomeStoreId;
    String? HomeStoreLocationName;
    DateTime? UtcTime;

    ClubVisitHistoryItem({this.CheckinLogId,this.UserId,this.FirstName,this.LastName,this.CheckinStoreId,this.CheckinLocationName,this.HomeStoreId,this.HomeStoreLocationName,this.UtcTime});
    ClubVisitHistoryItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CheckinLogId = json['CheckinLogId'];
        UserId = json['UserId'];
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        CheckinStoreId = json['CheckinStoreId'];
        CheckinLocationName = json['CheckinLocationName'];
        HomeStoreId = json['HomeStoreId'];
        HomeStoreLocationName = json['HomeStoreLocationName'];
        UtcTime = JsonConverters.fromJson(json['UtcTime'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CheckinLogId': CheckinLogId,
        'UserId': UserId,
        'FirstName': FirstName,
        'LastName': LastName,
        'CheckinStoreId': CheckinStoreId,
        'CheckinLocationName': CheckinLocationName,
        'HomeStoreId': HomeStoreId,
        'HomeStoreLocationName': HomeStoreLocationName,
        'UtcTime': JsonConverters.toJson(UtcTime,'DateTime',context!)
    };

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

class ClubVisitHistoryResponseDto extends ApiResponseBase implements IConvertible
{
    int? TotalVisits;
    List<ClubVisitHistoryItem>? Visits;

    ClubVisitHistoryResponseDto({this.TotalVisits,this.Visits});
    ClubVisitHistoryResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        TotalVisits = json['TotalVisits'];
        Visits = JsonConverters.fromJson(json['Visits'],'List<ClubVisitHistoryItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'TotalVisits': TotalVisits,
        'Visits': JsonConverters.toJson(Visits,'List<ClubVisitHistoryItem>',context!)
    });

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

class ClubVisitHistoryResponse extends ClubVisitHistoryResponseDto implements IConvertible
{
    bool? Success;
    String? Message;
    int? TotalVisits;
    List<ClubVisitHistoryItem>? Visits;

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

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Success = json['Success'];
        Message = json['Message'];
        TotalVisits = json['TotalVisits'];
        Visits = JsonConverters.fromJson(json['Visits'],'List<ClubVisitHistoryItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Success': Success,
        'Message': Message,
        'TotalVisits': TotalVisits,
        'Visits': JsonConverters.toJson(Visits,'List<ClubVisitHistoryItem>',context!)
    });

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

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'ClubVisitHistoryRequestDto': TypeInfo(TypeOf.Class, create:() => ClubVisitHistoryRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'ClubVisitHistoryRequest': TypeInfo(TypeOf.Class, create:() => ClubVisitHistoryRequest()),
    'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
    'ClubVisitHistoryItem': TypeInfo(TypeOf.Class, create:() => ClubVisitHistoryItem()),
    'ClubVisitHistoryResponseDto': TypeInfo(TypeOf.Class, create:() => ClubVisitHistoryResponseDto()),
    'List<ClubVisitHistoryItem>': TypeInfo(TypeOf.Class, create:() => <ClubVisitHistoryItem>[]),
    'ClubVisitHistoryResponse': TypeInfo(TypeOf.Class, create:() => ClubVisitHistoryResponse()),
});

Dart ClubVisitHistoryRequest 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 /club/visit-history HTTP/1.1 
Host: www.clubready.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Success: False,
	Message: String,
	TotalVisits: 0,
	Visits: 
	[
		{
			CheckinLogId: 0,
			UserId: 0,
			FirstName: String,
			LastName: String,
			CheckinStoreId: 0,
			CheckinLocationName: String,
			HomeStoreId: 0,
			HomeStoreLocationName: String,
			UtcTime: 0001-01-01
		}
	]
}