AlbaApi

<back to all web services

AdminAppReq

The following routes are available for this service:
All Verbs/admin/app
All Verbs/admin/app/{Country}
All Verbs/admin/app/{Country}/{Lang}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class SiteSection implements IConvertible
{
    String? route;
    bool? public;
    String? parent;
    int? roles;
    List<String>? hideFrom;
    int? order;

    SiteSection({this.route,this.public,this.parent,this.roles,this.hideFrom,this.order});
    SiteSection.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        route = json['route'];
        public = json['public'];
        parent = json['parent'];
        roles = json['roles'];
        hideFrom = JsonConverters.fromJson(json['hideFrom'],'List<String>',context!);
        order = json['order'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'route': route,
        'public': public,
        'parent': parent,
        'roles': roles,
        'hideFrom': JsonConverters.toJson(hideFrom,'List<String>',context!),
        'order': order
    };

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

class Entity implements IEntity, IConvertible
{
    String? id;

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

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

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

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

class ListItem extends Entity implements IConvertible
{
    String? listId;
    String? country;
    String? relatedId;
    String? code;
    String? custom;

    ListItem({this.listId,this.country,this.relatedId,this.code,this.custom});
    ListItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        listId = json['listId'];
        country = json['country'];
        relatedId = json['relatedId'];
        code = json['code'];
        custom = json['custom'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'listId': listId,
        'country': country,
        'relatedId': relatedId,
        'code': code,
        'custom': custom
    });

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

class Country implements IConvertible
{
    String? name;
    Map<String,String?>? languages;

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

    fromMap(Map<String, dynamic> json) {
        name = json['name'];
        languages = JsonConverters.toStringMap(json['languages']);
        return this;
    }

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

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

class Content extends Entity implements IConvertible
{
    String? section;
    String? itemId;
    String? itemCode;
    String? country;
    String? lang;
    String? app;
    String? companyId;
    String? company;
    Map<String,String?>? elements;

    Content({this.section,this.itemId,this.itemCode,this.country,this.lang,this.app,this.companyId,this.company,this.elements});
    Content.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        section = json['section'];
        itemId = json['itemId'];
        itemCode = json['itemCode'];
        country = json['country'];
        lang = json['lang'];
        app = json['app'];
        companyId = json['companyId'];
        company = json['company'];
        elements = JsonConverters.toStringMap(json['elements']);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'section': section,
        'itemId': itemId,
        'itemCode': itemCode,
        'country': country,
        'lang': lang,
        'app': app,
        'companyId': companyId,
        'company': company,
        'elements': elements
    });

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

// @flags()
class Roles
{
    static const Roles None = const Roles._(0);
    static const Roles Employee = const Roles._(1);
    static const Roles Member = const Roles._(2);
    static const Roles Employer = const Roles._(4);
    static const Roles Broker = const Roles._(8);
    static const Roles Developer = const Roles._(16);
    static const Roles SysAdmin = const Roles._(32);

    final int _value;
    const Roles._(this._value);
    int get value => _value;
    static List<Roles> get values => const [None,Employee,Member,Employer,Broker,Developer,SysAdmin];
}

class User implements IConvertible
{
    Roles? roles;

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

    fromMap(Map<String, dynamic> json) {
        roles = JsonConverters.fromJson(json['roles'],'Roles',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'roles': JsonConverters.toJson(roles,'Roles',context!)
    };

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

class ScriptTracker extends Entity implements IConvertible
{
    String? sprint;
    String? country;
    String? language;
    String? section;
    String? itemCode;
    String? element;
    String? value;
    bool? isFromMerge;

    ScriptTracker({this.sprint,this.country,this.language,this.section,this.itemCode,this.element,this.value,this.isFromMerge});
    ScriptTracker.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        sprint = json['sprint'];
        country = json['country'];
        language = json['language'];
        section = json['section'];
        itemCode = json['itemCode'];
        element = json['element'];
        value = json['value'];
        isFromMerge = json['isFromMerge'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'sprint': sprint,
        'country': country,
        'language': language,
        'section': section,
        'itemCode': itemCode,
        'element': element,
        'value': value,
        'isFromMerge': isFromMerge
    });

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

class Configuration extends Entity implements IConvertible
{
    String? category;
    Map<String,Country?>? countries;
    List<ListItem>? listItems;
    Map<String,String?>? listRelationships;
    Map<String,List<String>?>? sectionElements;
    Map<String,SiteSection?>? siteStructure;
    int? version;
    String? createdBy;
    DateTime? dateCreated;
    String? updatedBy;
    DateTime? dateUpdated;

    Configuration({this.category,this.countries,this.listItems,this.listRelationships,this.sectionElements,this.siteStructure,this.version,this.createdBy,this.dateCreated,this.updatedBy,this.dateUpdated});
    Configuration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        category = json['category'];
        countries = JsonConverters.fromJson(json['countries'],'Map<String,Country?>',context!);
        listItems = JsonConverters.fromJson(json['listItems'],'List<ListItem>',context!);
        listRelationships = JsonConverters.toStringMap(json['listRelationships']);
        sectionElements = JsonConverters.fromJson(json['sectionElements'],'Map<String,List<String>?>',context!);
        siteStructure = JsonConverters.fromJson(json['siteStructure'],'Map<String,SiteSection?>',context!);
        version = json['version'];
        createdBy = json['createdBy'];
        dateCreated = JsonConverters.fromJson(json['dateCreated'],'DateTime',context!);
        updatedBy = json['updatedBy'];
        dateUpdated = JsonConverters.fromJson(json['dateUpdated'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'category': category,
        'countries': JsonConverters.toJson(countries,'Map<String,Country?>',context!),
        'listItems': JsonConverters.toJson(listItems,'List<ListItem>',context!),
        'listRelationships': listRelationships,
        'sectionElements': JsonConverters.toJson(sectionElements,'Map<String,List<String>?>',context!),
        'siteStructure': JsonConverters.toJson(siteStructure,'Map<String,SiteSection?>',context!),
        'version': version,
        'createdBy': createdBy,
        'dateCreated': JsonConverters.toJson(dateCreated,'DateTime',context!),
        'updatedBy': updatedBy,
        'dateUpdated': JsonConverters.toJson(dateUpdated,'DateTime',context!)
    });

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

class AdminAppData implements IConvertible
{
    Map<String,SiteSection?>? siteStructure;
    Map<String,List<String>?>? sectionElements;
    Map<String,String?>? listRelationships;
    List<ListItem>? listItems;
    Map<String,Country?>? countries;
    List<Content>? content;
    User? user;
    List<ScriptTracker>? scriptTrackerRecords;
    List<Configuration>? configurations;

    AdminAppData({this.siteStructure,this.sectionElements,this.listRelationships,this.listItems,this.countries,this.content,this.user,this.scriptTrackerRecords,this.configurations});
    AdminAppData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        siteStructure = JsonConverters.fromJson(json['siteStructure'],'Map<String,SiteSection?>',context!);
        sectionElements = JsonConverters.fromJson(json['sectionElements'],'Map<String,List<String>?>',context!);
        listRelationships = JsonConverters.toStringMap(json['listRelationships']);
        listItems = JsonConverters.fromJson(json['listItems'],'List<ListItem>',context!);
        countries = JsonConverters.fromJson(json['countries'],'Map<String,Country?>',context!);
        content = JsonConverters.fromJson(json['content'],'List<Content>',context!);
        user = JsonConverters.fromJson(json['user'],'User',context!);
        scriptTrackerRecords = JsonConverters.fromJson(json['scriptTrackerRecords'],'List<ScriptTracker>',context!);
        configurations = JsonConverters.fromJson(json['configurations'],'List<Configuration>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'siteStructure': JsonConverters.toJson(siteStructure,'Map<String,SiteSection?>',context!),
        'sectionElements': JsonConverters.toJson(sectionElements,'Map<String,List<String>?>',context!),
        'listRelationships': listRelationships,
        'listItems': JsonConverters.toJson(listItems,'List<ListItem>',context!),
        'countries': JsonConverters.toJson(countries,'Map<String,Country?>',context!),
        'content': JsonConverters.toJson(content,'List<Content>',context!),
        'user': JsonConverters.toJson(user,'User',context!),
        'scriptTrackerRecords': JsonConverters.toJson(scriptTrackerRecords,'List<ScriptTracker>',context!),
        'configurations': JsonConverters.toJson(configurations,'List<Configuration>',context!)
    };

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

class AdminAppReq implements IConvertible
{
    String? country;
    String? lang;

    AdminAppReq({this.country,this.lang});
    AdminAppReq.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'country': country,
        'lang': lang
    };

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

TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
    'SiteSection': TypeInfo(TypeOf.Class, create:() => SiteSection()),
    'Entity': TypeInfo(TypeOf.Class, create:() => Entity()),
    'ListItem': TypeInfo(TypeOf.Class, create:() => ListItem()),
    'Country': TypeInfo(TypeOf.Class, create:() => Country()),
    'Content': TypeInfo(TypeOf.Class, create:() => Content()),
    'Roles': TypeInfo(TypeOf.Enum, enumValues:Roles.values),
    'User': TypeInfo(TypeOf.Class, create:() => User()),
    'ScriptTracker': TypeInfo(TypeOf.Class, create:() => ScriptTracker()),
    'Configuration': TypeInfo(TypeOf.Class, create:() => Configuration()),
    'Map<String,Country?>': TypeInfo(TypeOf.Class, create:() => Map<String,Country?>()),
    'List<ListItem>': TypeInfo(TypeOf.Class, create:() => <ListItem>[]),
    'Map<String,List<String>?>': TypeInfo(TypeOf.Class, create:() => Map<String,List<String>?>()),
    'Map<String,SiteSection?>': TypeInfo(TypeOf.Class, create:() => Map<String,SiteSection?>()),
    'AdminAppData': TypeInfo(TypeOf.Class, create:() => AdminAppData()),
    'List<Content>': TypeInfo(TypeOf.Class, create:() => <Content>[]),
    'List<ScriptTracker>': TypeInfo(TypeOf.Class, create:() => <ScriptTracker>[]),
    'List<Configuration>': TypeInfo(TypeOf.Class, create:() => <Configuration>[]),
    'AdminAppReq': TypeInfo(TypeOf.Class, create:() => AdminAppReq()),
});

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

POST /admin/app HTTP/1.1 
Host: hcbtas-q-albamfs-api.azurewebsites.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"country":"String","lang":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"siteStructure":{"String":{"route":"String","public":false,"parent":"String","roles":0,"hideFrom":["String"],"order":0}},"sectionElements":{"String":["String"]},"listRelationships":{"String":"String"},"listItems":[{"listId":"String","country":"String","relatedId":"String","code":"String","custom":"String","id":"String"}],"countries":{"String":{"name":"String","languages":{"String":"String"}}},"content":[{"section":"String","itemId":"String","itemCode":"String","country":"String","lang":"String","app":"String","companyId":"String","company":"String","elements":{"String":"String"},"id":"String"}],"user":{"roles":0},"scriptTrackerRecords":[{"sprint":"String","country":"String","language":"String","section":"String","itemCode":"String","element":"String","value":"String","isFromMerge":false,"id":"String"}]}