BokaMera.API.Host

<back to all web services

GetVossTier

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/voss/tiers/{TierId}gets voss tiers
import 'package:servicestack/servicestack.dart';

enum ProductGroupTypeEnum
{
    Optional,
    Included,
}

enum TypeEnum
{
    AtSubscriptionBillingPeriodEnd,
    AtBindingPeriodEnd,
    Immediately,
}

// @DataContract(Name="ProductGroupTagDto")
class ProductGroupTagDto implements IConvertible
{
    // @DataMember(Name="type", IsRequired=true)
    TypeEnum? type;

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

    ProductGroupTagDto({this.type,this.tag});
    ProductGroupTagDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['Type'],'TypeEnum',context!);
        tag = json['Tag'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'TypeEnum',context!),
        'tag': tag
    };

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

enum ProductTypeEnum
{
    Main,
    Addon,
    License,
    Usage,
}

enum StatusEnum
{
    Active,
    Terminated,
}

// @DataContract(Name="TierProductDto")
class TierProductDto implements IConvertible
{
    // @DataMember(Name="type", IsRequired=true)
    ProductTypeEnum? type;

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

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

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

    // @DataMember(Name="externalId")
    String? externalId;

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

    TierProductDto({this.type,this.status,this.id,this.name,this.externalId,this.articleNumber});
    TierProductDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['ProductType'],'ProductTypeEnum',context!);
        status = JsonConverters.fromJson(json['Status'],'StatusEnum',context!);
        id = json['Id'];
        name = json['Name'];
        externalId = json['ExternalId'];
        articleNumber = json['ArticleNumber'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'ProductTypeEnum',context!),
        'status': JsonConverters.toJson(status,'StatusEnum',context!),
        'id': id,
        'name': name,
        'externalId': externalId,
        'articleNumber': articleNumber
    };

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

// @DataContract(Name="TierProductGroupDto")
class TierProductGroupDto implements IConvertible
{
    // @DataMember(Name="productGroupType", IsRequired=true)
    ProductGroupTypeEnum? productGroupType;

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

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

    // @DataMember(Name="externalId")
    String? externalId;

    // @DataMember(Name="tags", EmitDefaultValue=false)
    List<ProductGroupTagDto>? tags = [];

    // @DataMember(Name="products", EmitDefaultValue=false)
    List<TierProductDto>? products = [];

    TierProductGroupDto({this.productGroupType,this.id,this.name,this.externalId,this.tags,this.products});
    TierProductGroupDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        productGroupType = JsonConverters.fromJson(json['ProductGroupType'],'ProductGroupTypeEnum',context!);
        id = json['Id'];
        name = json['Name'];
        externalId = json['ExternalId'];
        tags = JsonConverters.fromJson(json['Tags'],'List<ProductGroupTagDto>',context!);
        products = JsonConverters.fromJson(json['Products'],'List<TierProductDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'productGroupType': JsonConverters.toJson(productGroupType,'ProductGroupTypeEnum',context!),
        'id': id,
        'name': name,
        'externalId': externalId,
        'tags': JsonConverters.toJson(tags,'List<ProductGroupTagDto>',context!),
        'products': JsonConverters.toJson(products,'List<TierProductDto>',context!)
    };

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

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

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

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

    // @DataMember(Name="externalId")
    String? externalId;

    // @DataMember(Name="rank")
    int? rank;

    // @DataMember(Name="productGroups", EmitDefaultValue=false)
    List<TierProductGroupDto>? productGroups = [];

    TierResult({this.id,this.versionId,this.name,this.externalId,this.rank,this.productGroups});
    TierResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['Id'];
        versionId = json['VersionId'];
        name = json['Name'];
        externalId = json['ExternalId'];
        rank = json['Rank'];
        productGroups = JsonConverters.fromJson(json['ProductGroups'],'List<TierProductGroupDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'versionId': versionId,
        'name': name,
        'externalId': externalId,
        'rank': rank,
        'productGroups': JsonConverters.toJson(productGroups,'List<TierProductGroupDto>',context!)
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossTier implements IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? TierId;

    String? PackageId;

    GetVossTier({this.TierId,this.PackageId});
    GetVossTier.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TierId = json['TierId'];
        PackageId = json['PackageId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TierId': TierId,
        'PackageId': PackageId
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'ProductGroupTypeEnum': TypeInfo(TypeOf.Enum, enumValues:ProductGroupTypeEnum.values),
    'TypeEnum': TypeInfo(TypeOf.Enum, enumValues:TypeEnum.values),
    'ProductGroupTagDto': TypeInfo(TypeOf.Class, create:() => ProductGroupTagDto()),
    'ProductTypeEnum': TypeInfo(TypeOf.Enum, enumValues:ProductTypeEnum.values),
    'StatusEnum': TypeInfo(TypeOf.Enum, enumValues:StatusEnum.values),
    'TierProductDto': TypeInfo(TypeOf.Class, create:() => TierProductDto()),
    'TierProductGroupDto': TypeInfo(TypeOf.Class, create:() => TierProductGroupDto()),
    'List<ProductGroupTagDto>': TypeInfo(TypeOf.Class, create:() => <ProductGroupTagDto>[]),
    'List<TierProductDto>': TypeInfo(TypeOf.Class, create:() => <TierProductDto>[]),
    'TierResult': TypeInfo(TypeOf.Class, create:() => TierResult()),
    'List<TierProductGroupDto>': TypeInfo(TypeOf.Class, create:() => <TierProductGroupDto>[]),
    'GetVossTier': TypeInfo(TypeOf.Class, create:() => GetVossTier()),
});

Dart GetVossTier 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.

GET /voss/tiers/{TierId} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"name":"String","externalId":"String","rank":0,"productGroups":[{}]}