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 .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 /homepage/menu HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"HomeText":"String","HomeHidden":false,"ServicesText":"String","ServicesHidden":false,"BookTimeText":"String","BookTimeHidden":false,"AboutUsText":"String","AboutUsHidden":false,"ContactUsText":"String","ContactUsHidden":false,"MyBookingsText":"String","MyBookingsHidden":false,"CalendarText":"String","CalendarHidden":false,"NewsText":"String","NewsHidden":false,"AddressText":"String","AddressHidden":false,"GalleryText":"String","GalleryHidden":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}