BokaMera.API.Host

<back to all web services

LicensePlanQuery

The following routes are available for this service:
GET/licenses/plans/Get all license plansThis service is used to get get all license plans that exists.
import 'package:servicestack/servicestack.dart';

// @DataContract
abstract class QueryBase
{
    // @DataMember(Order=1)
    int? Skip;

    // @DataMember(Order=2)
    int? Take;

    // @DataMember(Order=3)
    String? OrderBy;

    // @DataMember(Order=4)
    String? OrderByDesc;

    // @DataMember(Order=5)
    String? Include;

    // @DataMember(Order=6)
    String? Fields;

    // @DataMember(Order=7)
    Map<String,String?>? Meta;

    QueryBase({this.Skip,this.Take,this.OrderBy,this.OrderByDesc,this.Include,this.Fields,this.Meta});
    QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Skip = json['Skip'];
        Take = json['Take'];
        OrderBy = json['OrderBy'];
        OrderByDesc = json['OrderByDesc'];
        Include = json['Include'];
        Fields = json['Fields'];
        Meta = JsonConverters.toStringMap(json['Meta']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Skip': Skip,
        'Take': Take,
        'OrderBy': OrderBy,
        'OrderByDesc': OrderByDesc,
        'Include': Include,
        'Fields': Fields,
        'Meta': Meta
    };

    getTypeName() => "QueryBase";
    TypeContext? context = _ctx;
}

abstract class QueryDb2<From,Into> extends QueryBase
{
    QueryDb2();
    QueryDb2.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "QueryDb<$From,$Into>";
    TypeContext? context = _ctx;
}

class VossPlanResponse implements IConvertible
{
    String Id = "";
    String Name = "";
    String LengthUnit = "";
    String Length = "";

    VossPlanResponse({this.Id,this.Name,this.LengthUnit,this.Length});
    VossPlanResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        LengthUnit = json['LengthUnit'];
        Length = json['Length'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'LengthUnit': LengthUnit,
        'Length': Length
    };

    getTypeName() => "VossPlanResponse";
    TypeContext? context = _ctx;
}

enum LengthUnit
{
    Week,
    Month,
    Year,
}

class LicensePlanQueryResponse implements IConvertible
{
    int Id = 0;
    String VossPlanId = "";
    String Name = "";
    String Description = "";
    VossPlanResponse VossPlan;
    int PlanLength = 0;
    LengthUnit PlanLengthUnit;
    DateTime UpdatedDate = DateTime(0);
    DateTime CreatedDate = DateTime(0);
    bool Active;

    LicensePlanQueryResponse({this.Id,this.VossPlanId,this.Name,this.Description,this.VossPlan,this.PlanLength,this.PlanLengthUnit,this.UpdatedDate,this.CreatedDate,this.Active});
    LicensePlanQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        VossPlanId = json['VossPlanId'];
        Name = json['Name'];
        Description = json['Description'];
        VossPlan = JsonConverters.fromJson(json['VossPlan'],'VossPlanResponse',context!);
        PlanLength = json['PlanLength'];
        PlanLengthUnit = JsonConverters.fromJson(json['PlanLengthUnit'],'LengthUnit',context!);
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        Active = json['Active'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'VossPlanId': VossPlanId,
        'Name': Name,
        'Description': Description,
        'VossPlan': JsonConverters.toJson(VossPlan,'VossPlanResponse',context!),
        'PlanLength': PlanLength,
        'PlanLengthUnit': JsonConverters.toJson(PlanLengthUnit,'LengthUnit',context!),
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'Active': Active
    };

    getTypeName() => "LicensePlanQueryResponse";
    TypeContext? context = _ctx;
}

class BaseModel implements IConvertible
{
    BaseModel();
    BaseModel.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "BaseModel";
    TypeContext? context = _ctx;
}

class LicensePlan extends BaseModel implements IBaseModelUpdated, IBaseModelCreated, IConvertible
{
    // @Ignore()
    VossPlanResponse VossPlan;

    // @Required()
    int Id = 0;

    String VossPlanId = "";
    // @Required()
    int PlanLength = 0;

    // @Required()
    int PlanLengthUnitId = 0;

    // @Required()
    String Name = "";

    // @Required()
    String Description = "";

    DateTime UpdatedDate = DateTime(0);
    bool Active;
    DateTime CreatedDate = DateTime(0);

    LicensePlan({this.VossPlan,this.Id,this.VossPlanId,this.PlanLength,this.PlanLengthUnitId,this.Name,this.Description,this.UpdatedDate,this.Active,this.CreatedDate});
    LicensePlan.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        VossPlan = JsonConverters.fromJson(json['VossPlan'],'VossPlanResponse',context!);
        Id = json['Id'];
        VossPlanId = json['VossPlanId'];
        PlanLength = json['PlanLength'];
        PlanLengthUnitId = json['PlanLengthUnitId'];
        Name = json['Name'];
        Description = json['Description'];
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        Active = json['Active'];
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'VossPlan': JsonConverters.toJson(VossPlan,'VossPlanResponse',context!),
        'Id': Id,
        'VossPlanId': VossPlanId,
        'PlanLength': PlanLength,
        'PlanLengthUnitId': PlanLengthUnitId,
        'Name': Name,
        'Description': Description,
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
        'Active': Active,
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!)
    });

    getTypeName() => "LicensePlan";
    TypeContext? context = _ctx;
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class LicensePlanQuery extends QueryDb2<LicensePlan,LicensePlanQueryResponse> implements IConvertible
{
    /**
    * Search active plan.
    */
    // @ApiMember(Description="Search active plan.", ParameterType="query")
    bool Active;

    LicensePlanQuery({this.Active});
    LicensePlanQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Active = json['Active'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Active': Active
    });

    getTypeName() => "LicensePlanQuery";
    TypeContext? context = _ctx;
}

class AccessKeyTypeResponse implements IConvertible
{
    int Id = 0;
    String KeyType = "";
    String Description = "";

    AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
    AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        KeyType = json['KeyType'];
        Description = json['Description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'KeyType': KeyType,
        'Description': Description
    };

    getTypeName() => "AccessKeyTypeResponse";
    TypeContext? context = _ctx;
}

// @DataContract
class QueryResponse<T> implements IConvertible
{
    // @DataMember(Order=1)
    int Offset = 0;

    // @DataMember(Order=2)
    int Total = 0;

    // @DataMember(Order=3)
    List<AccessKeyTypeResponse> Results = [];

    // @DataMember(Order=4)
    Map<String,String?>? Meta;

    // @DataMember(Order=5)
    ResponseStatus? ResponseStatus;

    QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
    QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Offset = json['Offset'];
        Total = json['Total'];
        Results = JsonConverters.fromJson(json['Results'],'List<AccessKeyTypeResponse>',context!);
        Meta = JsonConverters.toStringMap(json['Meta']);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Offset': Offset,
        'Total': Total,
        'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
        'Meta': Meta,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "QueryResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api_staging.bookmore.com', types: <String, TypeInfo> {
    'VossPlanResponse': TypeInfo(TypeOf.Class, create:() => VossPlanResponse()),
    'LengthUnit': TypeInfo(TypeOf.Enum, enumValues:LengthUnit.values),
    'LicensePlanQueryResponse': TypeInfo(TypeOf.Class, create:() => LicensePlanQueryResponse()),
    'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
    'LicensePlan': TypeInfo(TypeOf.Class, create:() => LicensePlan()),
    'LicensePlanQuery': TypeInfo(TypeOf.Class, create:() => LicensePlanQuery()),
    'List<LicensePlanQueryResponse>': TypeInfo(TypeOf.Class, create:() => <LicensePlanQueryResponse>[]),
    'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
    'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});

Dart LicensePlanQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /licenses/plans/ HTTP/1.1 
Host: api-staging.bookmore.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"Name":"String","Description":"String","VossPlan":{"Name":"String","LengthUnit":"String","Length":"String"},"PlanLength":0,"PlanLengthUnit":"Week","Active":false}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}