GET | /sales/packages | Get Available packages for a chain or store |
---|
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 GetSalesPackagesRequestDto extends ApiDtoBase implements IConvertible
{
GetSalesPackagesRequestDto();
GetSalesPackagesRequestDto.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "GetSalesPackagesRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class GetSalesPackagesRequest extends GetSalesPackagesRequestDto 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;
/**
* ID # of store to get packages for
*/
// @ApiMember(DataType="string", Description="ID # of store to get packages for", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* ID # of the user to get packages for
*/
// @ApiMember(DataType="integer", Description="ID # of the user to get packages for", Name="UserId", ParameterType="query")
int? UserId;
/**
* The filter type which will used for packages credit (Class = 1, ClassSchedule = 2, SessionSize = 3)
*/
// @ApiMember(DataType="integer", Description="The filter type which will used for packages credit (Class = 1, ClassSchedule = 2, SessionSize = 3)", Name="CreditFilterType", ParameterType="query")
int? CreditFilterType;
/**
* ClassId or ClassScheduleId or SessionSizeId packages which drop credits
*/
// @ApiMember(DataType="integer", Description="ClassId or ClassScheduleId or SessionSizeId packages which drop credits", Name="CreditFilterId", ParameterType="query")
int? CreditFilterId;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
/**
* Show packages enabled for In App purchase. True or False
*/
// @ApiMember(DataType="string", Description="Show packages enabled for In App purchase. True or False", Name="InApp", ParameterType="query")
bool? InApp;
GetSalesPackagesRequest({this.ApiKey,this.StoreId,this.UserId,this.CreditFilterType,this.CreditFilterId,this.RestrictedId,this.RestrictedResourceType,this.InApp});
GetSalesPackagesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
UserId = json['UserId'];
CreditFilterType = json['CreditFilterType'];
CreditFilterId = json['CreditFilterId'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
InApp = json['InApp'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'UserId': UserId,
'CreditFilterType': CreditFilterType,
'CreditFilterId': CreditFilterId,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!),
'InApp': InApp
});
getTypeName() => "GetSalesPackagesRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'GetSalesPackagesRequestDto': TypeInfo(TypeOf.Class, create:() => GetSalesPackagesRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'GetSalesPackagesRequest': TypeInfo(TypeOf.Class, create:() => GetSalesPackagesRequest()),
});
Dart GetSalesPackagesRequest DTOs
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.
GET /sales/packages HTTP/1.1 Host: clubready.com Accept: application/xml