BokaMera.API.Host

<back to all web services

UpdateVossSubscriptionScheduledChange

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/voss/subscriptions/{SubscriptionId}/scheduledChanges/{Id}Update voss subscription scheduled changeUpdate a pending subscription scheduled change in the VOSS System. Already executed scheduled changes cannot be updated.
import 'package:servicestack/servicestack.dart';

enum TypeEnum
{
    AtSubscriptionBillingPeriodEnd,
    AtBindingPeriodEnd,
}

enum StatusEnum
{
    Active,
    Terminated,
}

// @DataContract(Name="SubscriptionScheduledChangePackageResult")
class SubscriptionScheduledChangePackageResult implements IConvertible
{
    // @DataMember(Name="id", IsRequired=true)
    String id = "";

    // @DataMember(Name="versionId", IsRequired=true)
    String versionId = "";

    // @DataMember(Name="name", IsRequired=true)
    String name = "";

    SubscriptionScheduledChangePackageResult({this.id,this.versionId,this.name});
    SubscriptionScheduledChangePackageResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['Id'];
        versionId = json['VersionId'];
        name = json['Name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'versionId': versionId,
        'name': name
    };

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

// @DataContract(Name="SubscriptionScheduledChangeTierResult")
class SubscriptionScheduledChangeTierResult implements IConvertible
{
    // @DataMember(Name="id", IsRequired=true)
    String id = "";

    // @DataMember(Name="name", IsRequired=true)
    String name = "";

    SubscriptionScheduledChangeTierResult({this.id,this.name});
    SubscriptionScheduledChangeTierResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

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

// @DataContract(Name="SubscriptionScheduledChangePlanResult")
class SubscriptionScheduledChangePlanResult implements IConvertible
{
    // @DataMember(Name="id", IsRequired=true)
    String id = "";

    // @DataMember(Name="name", IsRequired=true)
    String name = "";

    SubscriptionScheduledChangePlanResult({this.id,this.name});
    SubscriptionScheduledChangePlanResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

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

// @DataContract(Name="SubscriptionScheduledChangeSalesInformationResult")
class SubscriptionScheduledChangeSalesInformationResult implements IConvertible
{
    // @DataMember(Name="salesPersonId")
    String salesPersonId = "";

    // @DataMember(Name="salesDepartmentId")
    String salesDepartmentId = "";

    SubscriptionScheduledChangeSalesInformationResult({this.salesPersonId,this.salesDepartmentId});
    SubscriptionScheduledChangeSalesInformationResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        salesPersonId = json['SalesPersonId'];
        salesDepartmentId = json['SalesDepartmentId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'salesPersonId': salesPersonId,
        'salesDepartmentId': salesDepartmentId
    };

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

// @DataContract(Name="SubscriptionScheduledChangeResult")
class SubscriptionScheduledChangeResult implements IConvertible
{
    // @DataMember(Name="type")
    TypeEnum type;

    // @DataMember(Name="status", IsRequired=true)
    StatusEnum status;

    // @DataMember(Name="id", IsRequired=true)
    String id = "";

    // @DataMember(Name="package")
    SubscriptionScheduledChangePackageResult package;

    // @DataMember(Name="tier")
    SubscriptionScheduledChangeTierResult tier;

    // @DataMember(Name="plan")
    SubscriptionScheduledChangePlanResult plan;

    // @DataMember(Name="scheduledDate", IsRequired=true)
    DateTime scheduledDate = DateTime(0);

    // @DataMember(Name="salesInformation")
    SubscriptionScheduledChangeSalesInformationResult salesInformation;

    SubscriptionScheduledChangeResult({this.type,this.status,this.id,this.package,this.tier,this.plan,this.scheduledDate,this.salesInformation});
    SubscriptionScheduledChangeResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['Type'],'TypeEnum',context!);
        status = JsonConverters.fromJson(json['Status'],'StatusEnum',context!);
        id = json['Id'];
        package = JsonConverters.fromJson(json['Package'],'SubscriptionScheduledChangePackageResult',context!);
        tier = JsonConverters.fromJson(json['Tier'],'SubscriptionScheduledChangeTierResult',context!);
        plan = JsonConverters.fromJson(json['Plan'],'SubscriptionScheduledChangePlanResult',context!);
        scheduledDate = JsonConverters.fromJson(json['ScheduledDate'],'DateTime',context!);
        salesInformation = JsonConverters.fromJson(json['SalesInformation'],'SubscriptionScheduledChangeSalesInformationResult',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'TypeEnum',context!),
        'status': JsonConverters.toJson(status,'StatusEnum',context!),
        'id': id,
        'package': JsonConverters.toJson(package,'SubscriptionScheduledChangePackageResult',context!),
        'tier': JsonConverters.toJson(tier,'SubscriptionScheduledChangeTierResult',context!),
        'plan': JsonConverters.toJson(plan,'SubscriptionScheduledChangePlanResult',context!),
        'scheduledDate': JsonConverters.toJson(scheduledDate,'DateTime',context!),
        'salesInformation': JsonConverters.toJson(salesInformation,'SubscriptionScheduledChangeSalesInformationResult',context!)
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class UpdateVossSubscriptionScheduledChange implements IConvertible
{
    /**
    * The subscription id
    */
    // @ApiMember(Description="The subscription id", IsRequired=true)
    String SubscriptionId = "";

    /**
    * The subscription scheduled change id
    */
    // @ApiMember(Description="The subscription scheduled change id", IsRequired=true)
    String Id = "";

    /**
    * Controls when the scheduled change will be executed:  <br />AtSubscriptionBillingPeriodEnd - after the currently latest subscription billing period ends  <br />AtBindingPeriodEnd - after the currently latest subscription binding period ends
    */
    // @ApiMember(Description="Controls when the scheduled change will be executed:  <br />AtSubscriptionBillingPeriodEnd - after the currently latest subscription billing period ends  <br />AtBindingPeriodEnd - after the currently latest subscription binding period ends", IsRequired=true)
    TypeEnum Type;

    /**
    * Optional package version id; if omitted the current version of the subscription package is used
    */
    // @ApiMember(Description="Optional package version id; if omitted the current version of the subscription package is used")
    String? VersionId;

    /**
    * The id of a package which will be active after the scheduled change is executed; if provided the tier id and plan id have to be provided as well
    */
    // @ApiMember(Description="The id of a package which will be active after the scheduled change is executed; if provided the tier id and plan id have to be provided as well")
    String? PackageId;

    /**
    * The id of a tier which will be active after the scheduled change is executed; can be omitted if PlanId is provided instead
    */
    // @ApiMember(Description="The id of a tier which will be active after the scheduled change is executed; can be omitted if PlanId is provided instead")
    String? TierId;

    /**
    * The id of a plan which will be active after the scheduled change is executed; can be omitted if TierId is provided instead
    */
    // @ApiMember(Description="The id of a plan which will be active after the scheduled change is executed; can be omitted if TierId is provided instead")
    String? PlanId;

    /**
    * How many periods (counting from the latest period) must pass before the scheduled change is executed; if omitted the change is executed on the latest period end
    */
    // @ApiMember(Description="How many periods (counting from the latest period) must pass before the scheduled change is executed; if omitted the change is executed on the latest period end")
    int? PeriodIterationCount;

    UpdateVossSubscriptionScheduledChange({this.SubscriptionId,this.Id,this.Type,this.VersionId,this.PackageId,this.TierId,this.PlanId,this.PeriodIterationCount});
    UpdateVossSubscriptionScheduledChange.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SubscriptionId = json['SubscriptionId'];
        Id = json['Id'];
        Type = JsonConverters.fromJson(json['Type'],'TypeEnum',context!);
        VersionId = json['VersionId'];
        PackageId = json['PackageId'];
        TierId = json['TierId'];
        PlanId = json['PlanId'];
        PeriodIterationCount = json['PeriodIterationCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SubscriptionId': SubscriptionId,
        'Id': Id,
        'Type': JsonConverters.toJson(Type,'TypeEnum',context!),
        'VersionId': VersionId,
        'PackageId': PackageId,
        'TierId': TierId,
        'PlanId': PlanId,
        'PeriodIterationCount': PeriodIterationCount
    };

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'TypeEnum': TypeInfo(TypeOf.Enum, enumValues:TypeEnum.values),
    'StatusEnum': TypeInfo(TypeOf.Enum, enumValues:StatusEnum.values),
    'SubscriptionScheduledChangePackageResult': TypeInfo(TypeOf.Class, create:() => SubscriptionScheduledChangePackageResult()),
    'SubscriptionScheduledChangeTierResult': TypeInfo(TypeOf.Class, create:() => SubscriptionScheduledChangeTierResult()),
    'SubscriptionScheduledChangePlanResult': TypeInfo(TypeOf.Class, create:() => SubscriptionScheduledChangePlanResult()),
    'SubscriptionScheduledChangeSalesInformationResult': TypeInfo(TypeOf.Class, create:() => SubscriptionScheduledChangeSalesInformationResult()),
    'SubscriptionScheduledChangeResult': TypeInfo(TypeOf.Class, create:() => SubscriptionScheduledChangeResult()),
    'UpdateVossSubscriptionScheduledChange': TypeInfo(TypeOf.Class, create:() => UpdateVossSubscriptionScheduledChange()),
});

Dart UpdateVossSubscriptionScheduledChange DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

PUT /voss/subscriptions/{SubscriptionId}/scheduledChanges/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Type":"AtSubscriptionBillingPeriodEnd","VersionId":"00000000-0000-0000-0000-000000000000","PackageId":"00000000-0000-0000-0000-000000000000","TierId":"00000000-0000-0000-0000-000000000000","PlanId":"00000000-0000-0000-0000-000000000000","PeriodIterationCount":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"type":"AtSubscriptionBillingPeriodEnd","status":"Pending"}