BokaMera.API.Host

<back to all web services

HomepageMenuQuery

The following routes are available for this service:
GET/homepage/menuFind news items for a company
import Foundation
import ServiceStack

public class HomepageMenuQuery : QueryDb2<HomepageMenu, HomepageMenuQueryResponse>, ICompanyRequest
{
    /**
    * Enter the company you want to see news for, if blank and you are an admin, your company id will be used
    */
    // @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="query")
    public var companyId:String?

    /**
    * The homeage sitepath.
    */
    // @ApiMember(Description="The homeage sitepath.")
    public var sitePath:String

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

    private enum CodingKeys : String, CodingKey {
        case companyId
        case sitePath
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
        sitePath = try container.decodeIfPresent(String.self, forKey: .sitePath)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if companyId != nil { try container.encode(companyId, forKey: .companyId) }
        if sitePath != nil { try container.encode(sitePath, forKey: .sitePath) }
    }
}

public class HomepageMenu : BaseModel
{
    // @Required()
    public var homeText:String?

    // @Required()
    public var homeHidden:Bool?

    // @Required()
    public var servicesText:String?

    // @Required()
    public var servicesHidden:Bool?

    // @Required()
    public var bookTimeText:String?

    // @Required()
    public var bookTimeHidden:Bool?

    // @Required()
    public var aboutUsText:String?

    // @Required()
    public var aboutUsHidden:Bool?

    // @Required()
    public var contactUsText:String?

    // @Required()
    public var contactUsHidden:Bool?

    // @Required()
    public var myBookingsText:String?

    // @Required()
    public var myBookingsHidden:Bool?

    // @Required()
    public var calendarText:String?

    // @Required()
    public var calendarHidden:Bool?

    // @Required()
    public var newsText:String?

    // @Required()
    public var newsHidden:Bool?

    // @Required()
    public var addressText:String?

    // @Required()
    public var addressHidden:Bool?

    // @Required()
    public var galleryText:String?

    // @Required()
    public var galleryHidden:Bool?

    public var modifiedDate:Date?
    // @Required()
    public var id:String?

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

    private enum CodingKeys : String, CodingKey {
        case homeText
        case homeHidden
        case servicesText
        case servicesHidden
        case bookTimeText
        case bookTimeHidden
        case aboutUsText
        case aboutUsHidden
        case contactUsText
        case contactUsHidden
        case myBookingsText
        case myBookingsHidden
        case calendarText
        case calendarHidden
        case newsText
        case newsHidden
        case addressText
        case addressHidden
        case galleryText
        case galleryHidden
        case modifiedDate
        case id
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        homeText = try container.decodeIfPresent(String.self, forKey: .homeText)
        homeHidden = try container.decodeIfPresent(Bool.self, forKey: .homeHidden)
        servicesText = try container.decodeIfPresent(String.self, forKey: .servicesText)
        servicesHidden = try container.decodeIfPresent(Bool.self, forKey: .servicesHidden)
        bookTimeText = try container.decodeIfPresent(String.self, forKey: .bookTimeText)
        bookTimeHidden = try container.decodeIfPresent(Bool.self, forKey: .bookTimeHidden)
        aboutUsText = try container.decodeIfPresent(String.self, forKey: .aboutUsText)
        aboutUsHidden = try container.decodeIfPresent(Bool.self, forKey: .aboutUsHidden)
        contactUsText = try container.decodeIfPresent(String.self, forKey: .contactUsText)
        contactUsHidden = try container.decodeIfPresent(Bool.self, forKey: .contactUsHidden)
        myBookingsText = try container.decodeIfPresent(String.self, forKey: .myBookingsText)
        myBookingsHidden = try container.decodeIfPresent(Bool.self, forKey: .myBookingsHidden)
        calendarText = try container.decodeIfPresent(String.self, forKey: .calendarText)
        calendarHidden = try container.decodeIfPresent(Bool.self, forKey: .calendarHidden)
        newsText = try container.decodeIfPresent(String.self, forKey: .newsText)
        newsHidden = try container.decodeIfPresent(Bool.self, forKey: .newsHidden)
        addressText = try container.decodeIfPresent(String.self, forKey: .addressText)
        addressHidden = try container.decodeIfPresent(Bool.self, forKey: .addressHidden)
        galleryText = try container.decodeIfPresent(String.self, forKey: .galleryText)
        galleryHidden = try container.decodeIfPresent(Bool.self, forKey: .galleryHidden)
        modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
        id = try container.decodeIfPresent(String.self, forKey: .id)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if homeText != nil { try container.encode(homeText, forKey: .homeText) }
        if homeHidden != nil { try container.encode(homeHidden, forKey: .homeHidden) }
        if servicesText != nil { try container.encode(servicesText, forKey: .servicesText) }
        if servicesHidden != nil { try container.encode(servicesHidden, forKey: .servicesHidden) }
        if bookTimeText != nil { try container.encode(bookTimeText, forKey: .bookTimeText) }
        if bookTimeHidden != nil { try container.encode(bookTimeHidden, forKey: .bookTimeHidden) }
        if aboutUsText != nil { try container.encode(aboutUsText, forKey: .aboutUsText) }
        if aboutUsHidden != nil { try container.encode(aboutUsHidden, forKey: .aboutUsHidden) }
        if contactUsText != nil { try container.encode(contactUsText, forKey: .contactUsText) }
        if contactUsHidden != nil { try container.encode(contactUsHidden, forKey: .contactUsHidden) }
        if myBookingsText != nil { try container.encode(myBookingsText, forKey: .myBookingsText) }
        if myBookingsHidden != nil { try container.encode(myBookingsHidden, forKey: .myBookingsHidden) }
        if calendarText != nil { try container.encode(calendarText, forKey: .calendarText) }
        if calendarHidden != nil { try container.encode(calendarHidden, forKey: .calendarHidden) }
        if newsText != nil { try container.encode(newsText, forKey: .newsText) }
        if newsHidden != nil { try container.encode(newsHidden, forKey: .newsHidden) }
        if addressText != nil { try container.encode(addressText, forKey: .addressText) }
        if addressHidden != nil { try container.encode(addressHidden, forKey: .addressHidden) }
        if galleryText != nil { try container.encode(galleryText, forKey: .galleryText) }
        if galleryHidden != nil { try container.encode(galleryHidden, forKey: .galleryHidden) }
        if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
        if id != nil { try container.encode(id, forKey: .id) }
    }
}

public class BaseModel : Codable
{
    required public init(){}
}

public class HomepageMenuQueryResponse : Codable
{
    /**
    * The company id
    */
    // @ApiMember(Description="The company id")
    public var companyId:String

    /**
    * The text for home menu item
    */
    // @ApiMember(Description="The text for home menu item")
    public var homeText:String

    /**
    * If the home menu item should be hidden
    */
    // @ApiMember(Description="If the home menu item should be hidden")
    public var homeHidden:Bool

    /**
    * The text for services menu item
    */
    // @ApiMember(Description="The text for services menu item")
    public var servicesText:String

    /**
    * If the services menu item should be hidden
    */
    // @ApiMember(Description="If the services menu item should be hidden")
    public var servicesHidden:Bool

    /**
    * The text for book time menu item
    */
    // @ApiMember(Description="The text for book time menu item")
    public var bookTimeText:String

    /**
    * If the book time menu item should be hidden
    */
    // @ApiMember(Description="If the book time menu item should be hidden")
    public var bookTimeHidden:Bool

    /**
    * The text for about us menu item
    */
    // @ApiMember(Description="The text for about us menu item")
    public var aboutUsText:String

    /**
    * If the about us menu item should be hidden
    */
    // @ApiMember(Description="If the about us menu item should be hidden")
    public var aboutUsHidden:Bool

    /**
    * The text for contact us menu item
    */
    // @ApiMember(Description="The text for contact us menu item")
    public var contactUsText:String

    /**
    * If the contact us menu item should be hidden
    */
    // @ApiMember(Description="If the contact us menu item should be hidden")
    public var contactUsHidden:Bool

    /**
    * The text for my bookings menu item
    */
    // @ApiMember(Description="The text for my bookings menu item")
    public var myBookingsText:String

    /**
    * If the my bookings menu item should be hidden
    */
    // @ApiMember(Description="If the my bookings menu item should be hidden")
    public var myBookingsHidden:Bool

    /**
    * The text for calender menu item
    */
    // @ApiMember(Description="The text for calender menu item")
    public var calendarText:String

    /**
    * If the calendar menu item should be hidden
    */
    // @ApiMember(Description="If the calendar menu item should be hidden")
    public var calendarHidden:Bool

    /**
    * The text for news menu item
    */
    // @ApiMember(Description="The text for news menu item")
    public var newsText:String

    /**
    * If the news menu item should be hidden
    */
    // @ApiMember(Description="If the news menu item should be hidden")
    public var newsHidden:Bool

    /**
    * The text for address menu item
    */
    // @ApiMember(Description="The text for address menu item")
    public var addressText:String

    /**
    * If the address menu item should be hidden
    */
    // @ApiMember(Description="If the address menu item should be hidden")
    public var addressHidden:Bool?

    /**
    * The text for gallery menu item
    */
    // @ApiMember(Description="The text for gallery menu item")
    public var galleryText:String

    /**
    * If the gallery menu item should be hidden
    */
    // @ApiMember(Description="If the gallery menu item should be hidden")
    public var galleryHidden:Bool?

    public var responseStatus:ResponseStatus

    required public init(){}
}

public class AccessKeyTypeResponse : Codable
{
    public var id:Int
    public var keyType:String
    public var Description:String

    required public init(){}
}


Swift HomepageMenuQuery 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.

GET /homepage/menu HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<QueryResponseOfHomepageMenuQueryResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Offset>0</Offset>
  <Total>0</Total>
  <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
    <d2p1:HomepageMenuQueryResponse>
      <d2p1:AboutUsHidden>false</d2p1:AboutUsHidden>
      <d2p1:AboutUsText>String</d2p1:AboutUsText>
      <d2p1:AddressHidden>false</d2p1:AddressHidden>
      <d2p1:AddressText>String</d2p1:AddressText>
      <d2p1:BookTimeHidden>false</d2p1:BookTimeHidden>
      <d2p1:BookTimeText>String</d2p1:BookTimeText>
      <d2p1:CalendarHidden>false</d2p1:CalendarHidden>
      <d2p1:CalendarText>String</d2p1:CalendarText>
      <d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
      <d2p1:ContactUsHidden>false</d2p1:ContactUsHidden>
      <d2p1:ContactUsText>String</d2p1:ContactUsText>
      <d2p1:GalleryHidden>false</d2p1:GalleryHidden>
      <d2p1:GalleryText>String</d2p1:GalleryText>
      <d2p1:HomeHidden>false</d2p1:HomeHidden>
      <d2p1:HomeText>String</d2p1:HomeText>
      <d2p1:MyBookingsHidden>false</d2p1:MyBookingsHidden>
      <d2p1:MyBookingsText>String</d2p1:MyBookingsText>
      <d2p1:NewsHidden>false</d2p1:NewsHidden>
      <d2p1:NewsText>String</d2p1:NewsText>
      <d2p1:ResponseStatus>
        <ErrorCode>String</ErrorCode>
        <Message>String</Message>
        <StackTrace>String</StackTrace>
        <Errors>
          <ResponseError>
            <ErrorCode>String</ErrorCode>
            <FieldName>String</FieldName>
            <Message>String</Message>
            <Meta xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:KeyValueOfstringstring>
                <d7p1:Key>String</d7p1:Key>
                <d7p1:Value>String</d7p1:Value>
              </d7p1:KeyValueOfstringstring>
            </Meta>
          </ResponseError>
        </Errors>
        <Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </Meta>
      </d2p1:ResponseStatus>
      <d2p1:ServicesHidden>false</d2p1:ServicesHidden>
      <d2p1:ServicesText>String</d2p1:ServicesText>
    </d2p1:HomepageMenuQueryResponse>
  </Results>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <ResponseStatus>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StackTrace>String</StackTrace>
    <Errors>
      <ResponseError>
        <ErrorCode>String</ErrorCode>
        <FieldName>String</FieldName>
        <Message>String</Message>
        <Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </Meta>
      </ResponseError>
    </Errors>
    <Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </Meta>
  </ResponseStatus>
</QueryResponseOfHomepageMenuQueryResponseWg5EthtI>