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 Foundation
import ServiceStack

public class AdminAppReq : Codable
{
    public var country:String?
    public var lang:String?

    required public init(){}
}

public class AdminAppData : Codable
{
    public var siteStructure:[String:SiteSection] = [:]
    public var sectionElements:[String:[String]] = [:]
    public var listRelationships:[String:String] = [:]
    public var listItems:[ListItem] = []
    public var countries:[String:Country] = [:]
    public var content:[Content] = []
    public var user:User?
    public var scriptTrackerRecords:[ScriptTracker] = []
    public var configurations:[Configuration] = []

    required public init(){}
}

public class SiteSection : Codable
{
    public var route:String?
    public var `public`:Bool?
    public var parent:String?
    public var roles:Int?
    public var hideFrom:[String] = []
    public var order:Int?

    required public init(){}
}

public class ListItem : Entity
{
    public var listId:String?
    public var country:String?
    public var relatedId:String?
    public var code:String?
    public var custom:String?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case listId
        case country
        case relatedId
        case code
        case custom
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        listId = try container.decodeIfPresent(String.self, forKey: .listId)
        country = try container.decodeIfPresent(String.self, forKey: .country)
        relatedId = try container.decodeIfPresent(String.self, forKey: .relatedId)
        code = try container.decodeIfPresent(String.self, forKey: .code)
        custom = try container.decodeIfPresent(String.self, forKey: .custom)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if listId != nil { try container.encode(listId, forKey: .listId) }
        if country != nil { try container.encode(country, forKey: .country) }
        if relatedId != nil { try container.encode(relatedId, forKey: .relatedId) }
        if code != nil { try container.encode(code, forKey: .code) }
        if custom != nil { try container.encode(custom, forKey: .custom) }
    }
}

public class Entity : IEntity, Codable
{
    public var id:String?

    required public init(){}
}

public class Country : Codable
{
    public var name:String?
    public var languages:[String:String] = [:]

    required public init(){}
}

public class Content : Entity
{
    public var section:String?
    public var itemId:String?
    public var itemCode:String?
    public var country:String?
    public var lang:String?
    public var app:String?
    public var companyId:String?
    public var company:String?
    public var elements:[String:String] = [:]

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case section
        case itemId
        case itemCode
        case country
        case lang
        case app
        case companyId
        case company
        case elements
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        section = try container.decodeIfPresent(String.self, forKey: .section)
        itemId = try container.decodeIfPresent(String.self, forKey: .itemId)
        itemCode = try container.decodeIfPresent(String.self, forKey: .itemCode)
        country = try container.decodeIfPresent(String.self, forKey: .country)
        lang = try container.decodeIfPresent(String.self, forKey: .lang)
        app = try container.decodeIfPresent(String.self, forKey: .app)
        companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
        company = try container.decodeIfPresent(String.self, forKey: .company)
        elements = try container.decodeIfPresent([String:String].self, forKey: .elements) ?? [:]
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if section != nil { try container.encode(section, forKey: .section) }
        if itemId != nil { try container.encode(itemId, forKey: .itemId) }
        if itemCode != nil { try container.encode(itemCode, forKey: .itemCode) }
        if country != nil { try container.encode(country, forKey: .country) }
        if lang != nil { try container.encode(lang, forKey: .lang) }
        if app != nil { try container.encode(app, forKey: .app) }
        if companyId != nil { try container.encode(companyId, forKey: .companyId) }
        if company != nil { try container.encode(company, forKey: .company) }
        if elements.count > 0 { try container.encode(elements, forKey: .elements) }
    }
}

public class User : Codable
{
    public var roles:Roles?

    required public init(){}
}

// @Flags()
public enum Roles : Int, Codable
{
    case None = 0
    case Employee = 1
    case Member = 2
    case Employer = 4
    case Broker = 8
    case Developer = 16
    case SysAdmin = 32
}

public class ScriptTracker : Entity
{
    public var sprint:String?
    public var country:String?
    public var language:String?
    public var section:String?
    public var itemCode:String?
    public var element:String?
    public var value:String?
    public var isFromMerge:Bool?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case sprint
        case country
        case language
        case section
        case itemCode
        case element
        case value
        case isFromMerge
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        sprint = try container.decodeIfPresent(String.self, forKey: .sprint)
        country = try container.decodeIfPresent(String.self, forKey: .country)
        language = try container.decodeIfPresent(String.self, forKey: .language)
        section = try container.decodeIfPresent(String.self, forKey: .section)
        itemCode = try container.decodeIfPresent(String.self, forKey: .itemCode)
        element = try container.decodeIfPresent(String.self, forKey: .element)
        value = try container.decodeIfPresent(String.self, forKey: .value)
        isFromMerge = try container.decodeIfPresent(Bool.self, forKey: .isFromMerge)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if sprint != nil { try container.encode(sprint, forKey: .sprint) }
        if country != nil { try container.encode(country, forKey: .country) }
        if language != nil { try container.encode(language, forKey: .language) }
        if section != nil { try container.encode(section, forKey: .section) }
        if itemCode != nil { try container.encode(itemCode, forKey: .itemCode) }
        if element != nil { try container.encode(element, forKey: .element) }
        if value != nil { try container.encode(value, forKey: .value) }
        if isFromMerge != nil { try container.encode(isFromMerge, forKey: .isFromMerge) }
    }
}

public class Configuration : Entity
{
    public var category:String?
    public var countries:[String:Country] = [:]
    public var listItems:[ListItem] = []
    public var listRelationships:[String:String] = [:]
    public var sectionElements:[String:[String]] = [:]
    public var siteStructure:[String:SiteSection] = [:]
    public var version:Int?
    public var createdBy:String?
    public var dateCreated:Date?
    public var updatedBy:String?
    public var dateUpdated:Date?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case category
        case countries
        case listItems
        case listRelationships
        case sectionElements
        case siteStructure
        case version
        case createdBy
        case dateCreated
        case updatedBy
        case dateUpdated
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        category = try container.decodeIfPresent(String.self, forKey: .category)
        countries = try container.decodeIfPresent([String:Country].self, forKey: .countries) ?? [:]
        listItems = try container.decodeIfPresent([ListItem].self, forKey: .listItems) ?? []
        listRelationships = try container.decodeIfPresent([String:String].self, forKey: .listRelationships) ?? [:]
        sectionElements = try container.decodeIfPresent([String:[String]].self, forKey: .sectionElements) ?? [:]
        siteStructure = try container.decodeIfPresent([String:SiteSection].self, forKey: .siteStructure) ?? [:]
        version = try container.decodeIfPresent(Int.self, forKey: .version)
        createdBy = try container.decodeIfPresent(String.self, forKey: .createdBy)
        dateCreated = try container.decodeIfPresent(Date.self, forKey: .dateCreated)
        updatedBy = try container.decodeIfPresent(String.self, forKey: .updatedBy)
        dateUpdated = try container.decodeIfPresent(Date.self, forKey: .dateUpdated)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if category != nil { try container.encode(category, forKey: .category) }
        if countries.count > 0 { try container.encode(countries, forKey: .countries) }
        if listItems.count > 0 { try container.encode(listItems, forKey: .listItems) }
        if listRelationships.count > 0 { try container.encode(listRelationships, forKey: .listRelationships) }
        if sectionElements.count > 0 { try container.encode(sectionElements, forKey: .sectionElements) }
        if siteStructure.count > 0 { try container.encode(siteStructure, forKey: .siteStructure) }
        if version != nil { try container.encode(version, forKey: .version) }
        if createdBy != nil { try container.encode(createdBy, forKey: .createdBy) }
        if dateCreated != nil { try container.encode(dateCreated, forKey: .dateCreated) }
        if updatedBy != nil { try container.encode(updatedBy, forKey: .updatedBy) }
        if dateUpdated != nil { try container.encode(dateUpdated, forKey: .dateUpdated) }
    }
}


Swift AdminAppReq 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 /admin/app HTTP/1.1 
Host: hcbtas-q-albamfs-api.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AdminAppReq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.ServiceModel">
  <Country>String</Country>
  <Lang>String</Lang>
</AdminAppReq>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AdminAppData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.Application.DTOs">
  <Configurations xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model" i:nil="true" />
  <Content xmlns:d2p1="http://schemas.datacontract.org/2004/07/TasSyd.Model">
    <d2p1:Content>
      <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
      <d2p1:App>String</d2p1:App>
      <d2p1:Company>String</d2p1:Company>
      <d2p1:CompanyId>String</d2p1:CompanyId>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:Elements xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d2p1:Elements>
      <d2p1:ItemCode>String</d2p1:ItemCode>
      <d2p1:ItemId>String</d2p1:ItemId>
      <d2p1:Lang>String</d2p1:Lang>
      <d2p1:Section>String</d2p1:Section>
    </d2p1:Content>
  </Content>
  <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>
  <ScriptTrackerRecords xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
    <d2p1:ScriptTracker>
      <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:Element>String</d2p1:Element>
      <d2p1:IsFromMerge>false</d2p1:IsFromMerge>
      <d2p1:ItemCode>String</d2p1:ItemCode>
      <d2p1:Language>String</d2p1:Language>
      <d2p1:Section>String</d2p1:Section>
      <d2p1:Sprint>String</d2p1:Sprint>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:ScriptTracker>
  </ScriptTrackerRecords>
  <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>
  <User xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
    <d2p1:Roles>None</d2p1:Roles>
  </User>
</AdminAppData>