ServiceStack Home (Live)

<back to all web services

CreateIndividualLicense

The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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/jsv
Content-Type: text/jsv
Content-Length: length

{
	licenseName: String,
	agreeTerms: False
}
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
		}
	}
}