GET | /subs |
---|
import 'package:servicestack/servicestack.dart';
class MSubBenefit implements IConvertible
{
int? id;
String? name;
bool? status;
int? order;
bool? hasContent;
String? image;
String? rssHash;
MSubBenefit({this.id,this.name,this.status,this.order,this.hasContent,this.image,this.rssHash});
MSubBenefit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
status = json['status'];
order = json['order'];
hasContent = json['hasContent'];
image = json['image'];
rssHash = json['rssHash'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'status': status,
'order': order,
'hasContent': hasContent,
'image': image,
'rssHash': rssHash
};
getTypeName() => "MSubBenefit";
TypeContext? context = _ctx;
}
class MBenefit implements IConvertible
{
int? id;
String? name;
bool? status;
int? order;
String? image;
List<MSubBenefit>? subBenefits;
MBenefit({this.id,this.name,this.status,this.order,this.image,this.subBenefits});
MBenefit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
status = json['status'];
order = json['order'];
image = json['image'];
subBenefits = JsonConverters.fromJson(json['subBenefits'],'List<MSubBenefit>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'status': status,
'order': order,
'image': image,
'subBenefits': JsonConverters.toJson(subBenefits,'List<MSubBenefit>',context!)
};
getTypeName() => "MBenefit";
TypeContext? context = _ctx;
}
class MSubscription implements IConvertible
{
int? id;
String? name;
String? description;
bool? status;
double? yearlyPrice;
double? price;
int? order;
String? icon;
String? paymentLink;
String? yearlyPaymentLink;
String? sid;
String? yearlySid;
double? discount;
List<MBenefit>? benefits;
MSubscription({this.id,this.name,this.description,this.status,this.yearlyPrice,this.price,this.order,this.icon,this.paymentLink,this.yearlyPaymentLink,this.sid,this.yearlySid,this.discount,this.benefits});
MSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
description = json['description'];
status = json['status'];
yearlyPrice = JsonConverters.toDouble(json['yearlyPrice']);
price = JsonConverters.toDouble(json['price']);
order = json['order'];
icon = json['icon'];
paymentLink = json['paymentLink'];
yearlyPaymentLink = json['yearlyPaymentLink'];
sid = json['sid'];
yearlySid = json['yearlySid'];
discount = JsonConverters.toDouble(json['discount']);
benefits = JsonConverters.fromJson(json['benefits'],'List<MBenefit>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'description': description,
'status': status,
'yearlyPrice': yearlyPrice,
'price': price,
'order': order,
'icon': icon,
'paymentLink': paymentLink,
'yearlyPaymentLink': yearlyPaymentLink,
'sid': sid,
'yearlySid': yearlySid,
'discount': discount,
'benefits': JsonConverters.toJson(benefits,'List<MBenefit>',context!)
};
getTypeName() => "MSubscription";
TypeContext? context = _ctx;
}
class SubsResponse implements IConvertible
{
List<MSubscription>? subscriptions;
int? responseCode;
String? responseMessage;
SubsResponse({this.subscriptions,this.responseCode,this.responseMessage});
SubsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
subscriptions = JsonConverters.fromJson(json['subscriptions'],'List<MSubscription>',context!);
responseCode = json['responseCode'];
responseMessage = json['responseMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'subscriptions': JsonConverters.toJson(subscriptions,'List<MSubscription>',context!),
'responseCode': responseCode,
'responseMessage': responseMessage
};
getTypeName() => "SubsResponse";
TypeContext? context = _ctx;
}
class SubsRequest implements IConvertible
{
String? lang;
SubsRequest({this.lang});
SubsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
lang = json['lang'];
return this;
}
Map<String, dynamic> toJson() => {
'lang': lang
};
getTypeName() => "SubsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'portal_api.migrantleap.com', types: <String, TypeInfo> {
'MSubBenefit': TypeInfo(TypeOf.Class, create:() => MSubBenefit()),
'MBenefit': TypeInfo(TypeOf.Class, create:() => MBenefit()),
'List<MSubBenefit>': TypeInfo(TypeOf.Class, create:() => <MSubBenefit>[]),
'MSubscription': TypeInfo(TypeOf.Class, create:() => MSubscription()),
'List<MBenefit>': TypeInfo(TypeOf.Class, create:() => <MBenefit>[]),
'SubsResponse': TypeInfo(TypeOf.Class, create:() => SubsResponse()),
'List<MSubscription>': TypeInfo(TypeOf.Class, create:() => <MSubscription>[]),
'SubsRequest': TypeInfo(TypeOf.Class, create:() => SubsRequest()),
});
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 /subs HTTP/1.1 Host: portal-api.migrantleap.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SubsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MigrantLeap.PortalBackend.Models"> <ResponseCode>0</ResponseCode> <ResponseMessage>String</ResponseMessage> <Subscriptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/MigrantLeap.PortalBackend.Providers.Models"> <d2p1:MSubscription> <d2p1:Benefits> <d2p1:MBenefit> <d2p1:Id>0</d2p1:Id> <d2p1:Image>String</d2p1:Image> <d2p1:Name>String</d2p1:Name> <d2p1:Order>0</d2p1:Order> <d2p1:Status>false</d2p1:Status> <d2p1:SubBenefits> <d2p1:MSubBenefit> <d2p1:HasContent>false</d2p1:HasContent> <d2p1:Id>0</d2p1:Id> <d2p1:Image>String</d2p1:Image> <d2p1:Name>String</d2p1:Name> <d2p1:Order>0</d2p1:Order> <d2p1:RSSHash>String</d2p1:RSSHash> <d2p1:Status>false</d2p1:Status> </d2p1:MSubBenefit> </d2p1:SubBenefits> </d2p1:MBenefit> </d2p1:Benefits> <d2p1:Description>String</d2p1:Description> <d2p1:Discount>0</d2p1:Discount> <d2p1:Icon>String</d2p1:Icon> <d2p1:Id>0</d2p1:Id> <d2p1:Name>String</d2p1:Name> <d2p1:Order>0</d2p1:Order> <d2p1:PaymentLink>String</d2p1:PaymentLink> <d2p1:Price>0</d2p1:Price> <d2p1:Sid>String</d2p1:Sid> <d2p1:Status>false</d2p1:Status> <d2p1:YearlyPaymentLink>String</d2p1:YearlyPaymentLink> <d2p1:YearlyPrice>0</d2p1:YearlyPrice> <d2p1:YearlySid>String</d2p1:YearlySid> </d2p1:MSubscription> </Subscriptions> </SubsResponse>