AlbaApi

<back to all web services

UpdateConfigReq

The following routes are available for this service:
POST/config/update
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

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 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 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 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 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 UpdateConfigReq implements IConvertible
{
    String? category;
    Map<String,Country?>? countries;
    List<ListItem>? listItems;
    Map<String,String?>? listRelationships;
    Map<String,List<String>?>? sectionElements;
    Map<String,SiteSection?>? siteStructure;

    UpdateConfigReq({this.category,this.countries,this.listItems,this.listRelationships,this.sectionElements,this.siteStructure});
    UpdateConfigReq.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> 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!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        '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!)
    };

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

TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
    'Entity': TypeInfo(TypeOf.Class, create:() => Entity()),
    'Country': TypeInfo(TypeOf.Class, create:() => Country()),
    'ListItem': TypeInfo(TypeOf.Class, create:() => ListItem()),
    'SiteSection': TypeInfo(TypeOf.Class, create:() => SiteSection()),
    '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?>()),
    'UpdateConfigReq': TypeInfo(TypeOf.Class, create:() => UpdateConfigReq()),
});

Dart UpdateConfigReq DTOs

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

HTTP + XML

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

POST /config/update HTTP/1.1 
Host: hcbtas-q-albamfs-api.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateConfigReq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.ServiceModel">
  <Category>String</Category>
  <Countries xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringCountryFNLs6TVB>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value xmlns:d4p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
        <d4p1:Languages>
          <d2p1:KeyValueOfstringstring>
            <d2p1:Key>String</d2p1:Key>
            <d2p1:Value>String</d2p1:Value>
          </d2p1:KeyValueOfstringstring>
        </d4p1:Languages>
        <d4p1:Name>String</d4p1:Name>
      </d2p1:Value>
    </d2p1:KeyValueOfstringCountryFNLs6TVB>
  </Countries>
  <ListItems xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
    <d2p1:ListItem>
      <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
      <d2p1:Code>String</d2p1:Code>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:Custom>String</d2p1:Custom>
      <d2p1:ListId>String</d2p1:ListId>
      <d2p1:RelatedId>String</d2p1:RelatedId>
    </d2p1:ListItem>
  </ListItems>
  <ListRelationships xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </ListRelationships>
  <SectionElements xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringArrayOfstringty7Ep6D1>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>
        <d2p1:string>String</d2p1:string>
      </d2p1:Value>
    </d2p1:KeyValueOfstringArrayOfstringty7Ep6D1>
  </SectionElements>
  <SiteStructure xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringSiteSectionFNLs6TVB>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value xmlns:d4p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
        <d4p1:HideFrom>
          <d2p1:string>String</d2p1:string>
        </d4p1:HideFrom>
        <d4p1:Order>0</d4p1:Order>
        <d4p1:Parent>String</d4p1:Parent>
        <d4p1:Public>false</d4p1:Public>
        <d4p1:Roles>0</d4p1:Roles>
        <d4p1:Route>String</d4p1:Route>
      </d2p1:Value>
    </d2p1:KeyValueOfstringSiteSectionFNLs6TVB>
  </SiteStructure>
</UpdateConfigReq>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<Configuration xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
  <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
  <Category>String</Category>
  <Countries xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringCountryFNLs6TVB>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>
        <Languages>
          <d2p1:KeyValueOfstringstring>
            <d2p1:Key>String</d2p1:Key>
            <d2p1:Value>String</d2p1:Value>
          </d2p1:KeyValueOfstringstring>
        </Languages>
        <Name>String</Name>
      </d2p1:Value>
    </d2p1:KeyValueOfstringCountryFNLs6TVB>
  </Countries>
  <CreatedBy>String</CreatedBy>
  <DateCreated>0001-01-01T00:00:00</DateCreated>
  <DateUpdated>0001-01-01T00:00:00</DateUpdated>
  <ListItems>
    <ListItem>
      <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
      <Code>String</Code>
      <Country>String</Country>
      <Custom>String</Custom>
      <ListId>String</ListId>
      <RelatedId>String</RelatedId>
    </ListItem>
  </ListItems>
  <ListRelationships xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </ListRelationships>
  <SectionElements xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringArrayOfstringty7Ep6D1>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>
        <d2p1:string>String</d2p1:string>
      </d2p1:Value>
    </d2p1:KeyValueOfstringArrayOfstringty7Ep6D1>
  </SectionElements>
  <SiteStructure xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringSiteSectionFNLs6TVB>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>
        <HideFrom>
          <d2p1:string>String</d2p1:string>
        </HideFrom>
        <Order>0</Order>
        <Parent>String</Parent>
        <Public>false</Public>
        <Roles>0</Roles>
        <Route>String</Route>
      </d2p1:Value>
    </d2p1:KeyValueOfstringSiteSectionFNLs6TVB>
  </SiteStructure>
  <UpdatedBy>String</UpdatedBy>
  <Version>0</Version>
</Configuration>