GET | /sales/members/{MemberId}/package-eligibility | Find out is a user is eligible to purchase a certain package. |
---|
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 PackageEligibilityRequestDto extends ApiDtoBase implements IConvertible
{
int? PackageId;
int? MemberId;
PackageEligibilityRequestDto({this.PackageId,this.MemberId});
PackageEligibilityRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
PackageId = json['PackageId'];
MemberId = json['MemberId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'PackageId': PackageId,
'MemberId': MemberId
});
getTypeName() => "PackageEligibilityRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class PackageEligibilityRequest extends PackageEligibilityRequestDto 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;
/**
* Store ID # member belongs to
*/
// @ApiMember(DataType="integer", Description="Store ID # member belongs to", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* ID of the member to lookup
*/
// @ApiMember(DataType="integer", Description="ID of the member to lookup", IsRequired=true, Name="MemberId", ParameterType="path")
int? MemberId;
/**
* ID of the package to check
*/
// @ApiMember(DataType="integer", Description="ID of the package to check", IsRequired=true, Name="PackageId", ParameterType="query")
int? PackageId;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
PackageEligibilityRequest({this.ApiKey,this.StoreId,this.MemberId,this.PackageId,this.RestrictedId,this.RestrictedResourceType});
PackageEligibilityRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
MemberId = json['MemberId'];
PackageId = json['PackageId'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'MemberId': MemberId,
'PackageId': PackageId,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "PackageEligibilityRequest";
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 PackageEligibilityItem implements IConvertible
{
String? Name;
String? Value;
bool? IsEligible;
String? Message;
PackageEligibilityItem({this.Name,this.Value,this.IsEligible,this.Message});
PackageEligibilityItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Value = json['Value'];
IsEligible = json['IsEligible'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Value': Value,
'IsEligible': IsEligible,
'Message': Message
};
getTypeName() => "PackageEligibilityItem";
TypeContext? context = _ctx;
}
class PackageEligibility implements IConvertible
{
bool? IsEligible;
List<PackageEligibilityItem>? Eligibility;
PackageEligibility({this.IsEligible,this.Eligibility});
PackageEligibility.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
IsEligible = json['IsEligible'];
Eligibility = JsonConverters.fromJson(json['Eligibility'],'List<PackageEligibilityItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'IsEligible': IsEligible,
'Eligibility': JsonConverters.toJson(Eligibility,'List<PackageEligibilityItem>',context!)
};
getTypeName() => "PackageEligibility";
TypeContext? context = _ctx;
}
class PackageEligibilityResponseDto extends ApiResponseBase implements IConvertible
{
PackageEligibility? EligibilityInfo;
PackageEligibilityResponseDto({this.EligibilityInfo});
PackageEligibilityResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
EligibilityInfo = JsonConverters.fromJson(json['EligibilityInfo'],'PackageEligibility',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'EligibilityInfo': JsonConverters.toJson(EligibilityInfo,'PackageEligibility',context!)
});
getTypeName() => "PackageEligibilityResponseDto";
TypeContext? context = _ctx;
}
class PackageEligibilityResponse extends PackageEligibilityResponseDto implements IConvertible
{
PackageEligibility? EligibilityInfo;
PackageEligibilityResponse({this.EligibilityInfo});
PackageEligibilityResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
EligibilityInfo = JsonConverters.fromJson(json['EligibilityInfo'],'PackageEligibility',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'EligibilityInfo': JsonConverters.toJson(EligibilityInfo,'PackageEligibility',context!)
});
getTypeName() => "PackageEligibilityResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'PackageEligibilityRequestDto': TypeInfo(TypeOf.Class, create:() => PackageEligibilityRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'PackageEligibilityRequest': TypeInfo(TypeOf.Class, create:() => PackageEligibilityRequest()),
'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
'PackageEligibilityItem': TypeInfo(TypeOf.Class, create:() => PackageEligibilityItem()),
'PackageEligibility': TypeInfo(TypeOf.Class, create:() => PackageEligibility()),
'List<PackageEligibilityItem>': TypeInfo(TypeOf.Class, create:() => <PackageEligibilityItem>[]),
'PackageEligibilityResponseDto': TypeInfo(TypeOf.Class, create:() => PackageEligibilityResponseDto()),
'PackageEligibilityResponse': TypeInfo(TypeOf.Class, create:() => PackageEligibilityResponse()),
});
Dart PackageEligibilityRequest 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/members/{MemberId}/package-eligibility HTTP/1.1 Host: clubready.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <PackageEligibilityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Model"> <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message> <Success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</Success> <EligibilityInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/ClubReady.Core.Sales.Models" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models"> <d2p1:Eligibility> <d2p1:PackageEligibilityItem> <d2p1:IsEligible>false</d2p1:IsEligible> <d2p1:Message>String</d2p1:Message> <d2p1:Name>String</d2p1:Name> <d2p1:Value>String</d2p1:Value> </d2p1:PackageEligibilityItem> </d2p1:Eligibility> <d2p1:IsEligible>false</d2p1:IsEligible> </EligibilityInfo> </PackageEligibilityResponse>