POST | /users/checkin | Check User Into Club |
---|
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 DoCheckInRequestDto extends ApiDtoBase implements IConvertible
{
String? Barcode;
int? UserId;
DateTime? UtcTimeStamp;
DoCheckInRequestDto({this.Barcode,this.UserId,this.UtcTimeStamp});
DoCheckInRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Barcode = json['Barcode'];
UserId = json['UserId'];
UtcTimeStamp = JsonConverters.fromJson(json['UtcTimeStamp'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Barcode': Barcode,
'UserId': UserId,
'UtcTimeStamp': JsonConverters.toJson(UtcTimeStamp,'DateTime',context!)
});
getTypeName() => "DoCheckInRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
/**
* Check a user into a club
*/
// @Api(Description="Check a user into a club")
class DoCheckInRequest extends DoCheckInRequestDto 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;
/**
* User barcode
*/
// @ApiMember(DataType="string", Description="User barcode", IsRequired=true, Name="Barcode", ParameterType="query")
String? Barcode;
/**
* ClubReady StoreId required
*/
// @ApiMember(DataType="integer", Description="ClubReady StoreId required", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* UserId to check into club
*/
// @ApiMember(DataType="integer", Description="UserId to check into club", Name="UserId", ParameterType="query")
int? UserId;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
DoCheckInRequest({this.ApiKey,this.Barcode,this.StoreId,this.UserId,this.RestrictedId,this.RestrictedResourceType});
DoCheckInRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
Barcode = json['Barcode'];
StoreId = json['StoreId'];
UserId = json['UserId'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'Barcode': Barcode,
'StoreId': StoreId,
'UserId': UserId,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "DoCheckInRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'DoCheckInRequestDto': TypeInfo(TypeOf.Class, create:() => DoCheckInRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'DoCheckInRequest': TypeInfo(TypeOf.Class, create:() => DoCheckInRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/checkin HTTP/1.1
Host: clubready.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DoCheckInRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.ClubAccess.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>
<Barcode xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Barcode>
<UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</UserId>
<UtcTimeStamp xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0001-01-01T00:00:00</UtcTimeStamp>
</DoCheckInRequest>