BokaMera.API.Host

<back to all web services

CreatePresetBehaviour

The following routes are available for this service:
POST/voss/presetBehaviourcreate preset behaviour in voss
import 'package:servicestack/servicestack.dart';

enum ChangeTypeEnum
{
    Subscription,
    ProductGroup,
    License,
}

enum ChangeOperationEnum
{
    Create,
    Terminate,
    Upgrade,
    Sidegrade,
    Downgrade,
    Migration,
}

enum SubscriptionTimingEnum
{
    AtSubscriptionBillingPeriodEnd,
    AtBindingPeriodEnd,
    Immediately,
}

enum PeriodAnchorEnum
{
    LatestPeriod,
    CurrentPeriod,
}

enum RenewalTimingEnum
{
    UseCurrentPlanRenewalDate,
    UseScheduledPlanRenewalDate,
}

enum SubscriptionBehaviourEnum
{
    Prorate,
    Full,
    None,
}

enum CreditKindEnum
{
    Normal,
    Internal,
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class CreatePresetBehaviour implements IConvertible
{
    /**
    * Company ids to create invoice. If none added invoice for all will be created
    */
    // @ApiMember(Description="Company ids to create invoice. If none added invoice for all will be created")
    ChangeTypeEnum? ChangeType;

    ChangeOperationEnum? ChangeOperation;
    SubscriptionTimingEnum? Timing;
    PeriodAnchorEnum? PeriodAnchor;
    RenewalTimingEnum? RenewalTiming;
    SubscriptionBehaviourEnum? DebitBehaviour;
    SubscriptionBehaviourEnum? CreditBehaviour;
    CreditKindEnum? CreditKind;
    int? PeriodIterationCount;

    CreatePresetBehaviour({this.ChangeType,this.ChangeOperation,this.Timing,this.PeriodAnchor,this.RenewalTiming,this.DebitBehaviour,this.CreditBehaviour,this.CreditKind,this.PeriodIterationCount});
    CreatePresetBehaviour.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ChangeType = JsonConverters.fromJson(json['ChangeType'],'ChangeTypeEnum',context!);
        ChangeOperation = JsonConverters.fromJson(json['ChangeOperation'],'ChangeOperationEnum',context!);
        Timing = JsonConverters.fromJson(json['Timing'],'SubscriptionTimingEnum',context!);
        PeriodAnchor = JsonConverters.fromJson(json['PeriodAnchor'],'PeriodAnchorEnum',context!);
        RenewalTiming = JsonConverters.fromJson(json['RenewalTiming'],'RenewalTimingEnum',context!);
        DebitBehaviour = JsonConverters.fromJson(json['DebitBehaviour'],'SubscriptionBehaviourEnum',context!);
        CreditBehaviour = JsonConverters.fromJson(json['CreditBehaviour'],'SubscriptionBehaviourEnum',context!);
        CreditKind = JsonConverters.fromJson(json['CreditKind'],'CreditKindEnum',context!);
        PeriodIterationCount = json['PeriodIterationCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ChangeType': JsonConverters.toJson(ChangeType,'ChangeTypeEnum',context!),
        'ChangeOperation': JsonConverters.toJson(ChangeOperation,'ChangeOperationEnum',context!),
        'Timing': JsonConverters.toJson(Timing,'SubscriptionTimingEnum',context!),
        'PeriodAnchor': JsonConverters.toJson(PeriodAnchor,'PeriodAnchorEnum',context!),
        'RenewalTiming': JsonConverters.toJson(RenewalTiming,'RenewalTimingEnum',context!),
        'DebitBehaviour': JsonConverters.toJson(DebitBehaviour,'SubscriptionBehaviourEnum',context!),
        'CreditBehaviour': JsonConverters.toJson(CreditBehaviour,'SubscriptionBehaviourEnum',context!),
        'CreditKind': JsonConverters.toJson(CreditKind,'CreditKindEnum',context!),
        'PeriodIterationCount': PeriodIterationCount
    };

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'ChangeTypeEnum': TypeInfo(TypeOf.Enum, enumValues:ChangeTypeEnum.values),
    'ChangeOperationEnum': TypeInfo(TypeOf.Enum, enumValues:ChangeOperationEnum.values),
    'SubscriptionTimingEnum': TypeInfo(TypeOf.Enum, enumValues:SubscriptionTimingEnum.values),
    'PeriodAnchorEnum': TypeInfo(TypeOf.Enum, enumValues:PeriodAnchorEnum.values),
    'RenewalTimingEnum': TypeInfo(TypeOf.Enum, enumValues:RenewalTimingEnum.values),
    'SubscriptionBehaviourEnum': TypeInfo(TypeOf.Enum, enumValues:SubscriptionBehaviourEnum.values),
    'CreditKindEnum': TypeInfo(TypeOf.Enum, enumValues:CreditKindEnum.values),
    'CreatePresetBehaviour': TypeInfo(TypeOf.Class, create:() => CreatePresetBehaviour()),
});

Dart CreatePresetBehaviour DTOs

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

HTTP + CSV

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

POST /voss/presetBehaviour HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ChangeType":"Subscription","ChangeOperation":"Create","Timing":"AtSubscriptionBillingPeriodEnd","PeriodAnchor":"LatestPeriod","RenewalTiming":"UseCurrentPlanRenewalDate","DebitBehaviour":"Prorate","CreditBehaviour":"Prorate","CreditKind":"Normal","PeriodIterationCount":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}