GET | /freelicense/{Ref} | ||
---|---|---|---|
GET | /GetFreeLicense |
import 'package:servicestack/servicestack.dart';
enum LicenseType
{
Free,
FreeIndividual,
FreeOpenSource,
Indie,
Business,
Enterprise,
TextIndie,
TextBusiness,
OrmLiteIndie,
OrmLiteBusiness,
RedisIndie,
RedisBusiness,
AwsIndie,
AwsBusiness,
Trial,
Site,
TextSite,
RedisSite,
OrmLiteSite,
}
class FreeLicenseResponse implements IConvertible
{
String? licenseName;
String? licenseRef;
String? licenseKey;
LicenseType? licenseType;
DateTime? createdDate;
DateTime? expiryDate;
String? externalRef;
ResponseStatus? responseStatus;
FreeLicenseResponse({this.licenseName,this.licenseRef,this.licenseKey,this.licenseType,this.createdDate,this.expiryDate,this.externalRef,this.responseStatus});
FreeLicenseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
licenseName = json['licenseName'];
licenseRef = json['licenseRef'];
licenseKey = json['licenseKey'];
licenseType = JsonConverters.fromJson(json['licenseType'],'LicenseType',context!);
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
expiryDate = JsonConverters.fromJson(json['expiryDate'],'DateTime',context!);
externalRef = json['externalRef'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'licenseName': licenseName,
'licenseRef': licenseRef,
'licenseKey': licenseKey,
'licenseType': JsonConverters.toJson(licenseType,'LicenseType',context!),
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'expiryDate': JsonConverters.toJson(expiryDate,'DateTime',context!),
'externalRef': externalRef,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "FreeLicenseResponse";
TypeContext? context = _ctx;
}
class GetFreeLicense implements IGet, IConvertible
{
String? ref;
GetFreeLicense({this.ref});
GetFreeLicense.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ref = json['ref'];
return this;
}
Map<String, dynamic> toJson() => {
'ref': ref
};
getTypeName() => "GetFreeLicense";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
'LicenseType': TypeInfo(TypeOf.Enum, enumValues:LicenseType.values),
'FreeLicenseResponse': TypeInfo(TypeOf.Class, create:() => FreeLicenseResponse()),
'GetFreeLicense': TypeInfo(TypeOf.Class, create:() => GetFreeLicense()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /freelicense/{Ref} HTTP/1.1 Host: account.servicestack.net Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { licenseName: String, licenseRef: String, licenseKey: String, licenseType: Free, createdDate: 0001-01-01, expiryDate: 0001-01-01, externalRef: String, responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }