GET | /users/{UserId}/visit-history | Get user visit history |
---|
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 UserVisitHistoryRequestDto extends ApiDtoBase implements IConvertible
{
int? UserId;
DateTime? FromDate;
DateTime? ToDate;
UserVisitHistoryRequestDto({this.UserId,this.FromDate,this.ToDate});
UserVisitHistoryRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
UserId = json['UserId'];
FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'UserId': UserId,
'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!)
});
getTypeName() => "UserVisitHistoryRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
/**
* Gets user check-in history based on a date range. Max 31 days.
*/
// @Api(Description="Gets user check-in history based on a date range. Max 31 days.")
class UserVisitHistoryRequest extends UserVisitHistoryRequestDto 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;
/**
*
*/
// @ApiMember(DataType="integer", Description="", IsRequired=true, Name="UserId", ParameterType="query")
int? UserId;
/**
* StoreId OR ChainId is required
*/
// @ApiMember(DataType="string", Description="StoreId OR ChainId is required", Name="StoreId", ParameterType="query")
int? StoreId;
/**
* StoreId OR ChainId is required
*/
// @ApiMember(DataType="string", Description="StoreId OR ChainId is required", Name="ChainId", ParameterType="query")
int? ChainId;
/**
* (Format:YYYY-MM-DD)
*/
// @ApiMember(DataType="date", Description="(Format:YYYY-MM-DD)", IsRequired=true, Name="FromDate", ParameterType="query")
DateTime? FromDate;
/**
* Max 31 Days (Format:YYYY-MM-DD)
*/
// @ApiMember(DataType="date", Description="Max 31 Days (Format:YYYY-MM-DD)", IsRequired=true, Name="ToDate", ParameterType="query")
DateTime? ToDate;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
UserVisitHistoryRequest({this.ApiKey,this.UserId,this.StoreId,this.ChainId,this.FromDate,this.ToDate,this.RestrictedId,this.RestrictedResourceType});
UserVisitHistoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
UserId = json['UserId'];
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,
'UserId': UserId,
'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() => "UserVisitHistoryRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'UserVisitHistoryRequestDto': TypeInfo(TypeOf.Class, create:() => UserVisitHistoryRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'UserVisitHistoryRequest': TypeInfo(TypeOf.Class, create:() => UserVisitHistoryRequest()),
});
Dart UserVisitHistoryRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /users/{UserId}/visit-history HTTP/1.1 Host: clubready.com Accept: text/csv