POST | /freelicense/individual | ||
---|---|---|---|
POST | /CreateIndividualLicense |
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 CreateIndividualLicense implements IPost, IConvertible
{
String? licenseName;
bool? agreeTerms;
CreateIndividualLicense({this.licenseName,this.agreeTerms});
CreateIndividualLicense.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
licenseName = json['licenseName'];
agreeTerms = json['agreeTerms'];
return this;
}
Map<String, dynamic> toJson() => {
'licenseName': licenseName,
'agreeTerms': agreeTerms
};
getTypeName() => "CreateIndividualLicense";
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()),
'CreateIndividualLicense': TypeInfo(TypeOf.Class, create:() => CreateIndividualLicense()),
});
Dart CreateIndividualLicense DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /freelicense/individual HTTP/1.1
Host: account.servicestack.net
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"licenseName":"String","agreeTerms":false}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"licenseName":"String","licenseRef":"String","licenseKey":"String","licenseType":"Free","createdDate":"\/Date(-62135596800000-0000)\/","expiryDate":"\/Date(-62135596800000-0000)\/","externalRef":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}