GET | /users | Get users list filtered by date |
---|
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 UsersListRequestDto extends ApiDtoBase implements IConvertible
{
String? Segment;
String? ActivityDate;
String? ActivityOperator;
UsersListRequestDto({this.Segment,this.ActivityDate,this.ActivityOperator});
UsersListRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Segment = json['Segment'];
ActivityDate = json['ActivityDate'];
ActivityOperator = json['ActivityOperator'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Segment': Segment,
'ActivityDate': ActivityDate,
'ActivityOperator': ActivityOperator
});
getTypeName() => "UsersListRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class UsersListRequest extends UsersListRequestDto 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;
/**
* StoreId OR ChainId is required
*/
// @ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="StoreId", ParameterType="query")
int? StoreId;
/**
* StoreId OR ChainId is required
*/
// @ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="ChainId", ParameterType="query")
int? ChainId;
/**
* Date to use for filter
*/
// @ApiMember(DataType="Date", Description="Date to use for filter", IsRequired=true, Name="ActivityDate", ParameterType="query")
String? ActivityDate;
/**
* The operator to use when comparing ActivityDate. Options are GT,EQ and LT for Greater Than, Equal and Less Than. Defaults to GT if not provided.
*/
// @ApiMember(DataType="String", Description="The operator to use when comparing ActivityDate. Options are GT,EQ and LT for Greater Than, Equal and Less Than. Defaults to GT if not provided.", Name="ActivityOperator", ParameterType="query")
String? ActivityOperator;
/**
* Filter by a specific segment. Types: Prospects, Active, Inactive, All, PastDue
*/
// @ApiMember(DataType="string", Description="Filter by a specific segment. Types: Prospects, Active, Inactive, All, PastDue", Name="Segment", ParameterType="query")
String? Segment;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
/**
* Version 2 adds email and mobile phone to output
*/
// @ApiMember(DataType="string", Description="Version 2 adds email and mobile phone to output", Name="Version", ParameterType="query")
int? Version;
UsersListRequest({this.ApiKey,this.StoreId,this.ChainId,this.ActivityDate,this.ActivityOperator,this.Segment,this.RestrictedId,this.RestrictedResourceType,this.Version});
UsersListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ChainId = json['ChainId'];
ActivityDate = json['ActivityDate'];
ActivityOperator = json['ActivityOperator'];
Segment = json['Segment'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
Version = json['Version'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'ChainId': ChainId,
'ActivityDate': ActivityDate,
'ActivityOperator': ActivityOperator,
'Segment': Segment,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!),
'Version': Version
});
getTypeName() => "UsersListRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'UsersListRequestDto': TypeInfo(TypeOf.Class, create:() => UsersListRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'UsersListRequest': TypeInfo(TypeOf.Class, create:() => UsersListRequest()),
});
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 HTTP/1.1 Host: clubready.com Accept: text/csv