| Required role: | Business |
| GET | /ad/get |
|---|
import Foundation
import ServiceStack
public class ImageUrls : Codable
{
public var preview:String
public var small:String
public var medium:String
public var large:String
required public init(){}
}
public class OpeningHours : Codable
{
public var weekly:WeeklyOpeningHours
required public init(){}
}
public class WeeklyOpeningHours : Codable
{
public var monday:OpeningHour
public var tuesday:OpeningHour
public var wednesday:OpeningHour
public var thursday:OpeningHour
public var friday:OpeningHour
public var saturday:OpeningHour
public var sunday:OpeningHour
required public init(){}
}
public class OpeningHour : Codable
{
public var openAtHour:Int
public var openAtMinute:Int
public var closeAtHour:Int
public var closeAtMinute:Int
required public init(){}
}
public enum PlaceType : String, Codable
{
case Mall
case Regular
}
public class PlaceContact : Codable
{
public var phone:String
public var email:String
public var website:String
public var webShop:String
required public init(){}
}
public class PlaceAddress : Codable
{
public var street:String
public var postalCode:String
public var region:String
public var countryCode:String
required public init(){}
}
public class TimeZoneDto : Codable
{
@TimeSpan public var baseUtcOffset:TimeInterval
public var daylightName:String
public var displayName:String
public var id:String
public var standardName:String
public var supportsDaylightSavingTime:Bool
required public init(){}
}
public class PriceMainDishDto : Codable
{
public var title:String
public var slug:PriceMainDish
required public init(){}
}
public enum PriceMainDish : String, Codable
{
case Value
case Medium
case High
case FineDining
}
public class AdDetailsUnion : Codable
{
public var percentageOnAllMerchandise:AdDetailsPercentageDiscountOnAllMerchandise
public var percentageRangeOnAllMerchandise:AdDetailsPercentageDiscountRangeOnAllMerchandise
public var percentageOnSelectedMerchandise:AdDetailsPercentageDiscountOnSelectedMerchandise
public var absoluteOnSelectedMerchandise:AdDetailsAbsoluteDiscountOnSelectedMerchandise
public var absoluteRangeOnAllMerchandise:AdDetailsAbsoluteDiscountRangeOnAllMerchandise
public var totalAmountOverXgivesYdiscount:AdDetailsTotalAmountOverXgivesYdiscount
public var xforY:AdDetailsXforYdiscount
public var newArrivals:AdDetailsNewArrivals
public var freetext:AdDetailsFreetext
public var todaysBreakFastOffer:AdDetailsTodaysBreakFastOffer
public var todaysLunchOffer:AdDetailsTodaysLunchOffer
public var todaysDinnerOffer:AdDetailsTodaysDinnerOffer
public var saveFoodAndMoney:AdDetailsSaveFoodAndMoney
public var percentageOfYourFoodBill:AdDetailsPercentageOffYourFoodBill
public var happyHour:AdDetailsHappyHour
public var someFreeTablesLeftToday:AdDetailsSomeFreeTablesLeftToday
public var twoDishesForThePriceOfOne:AdDetailsTwoDishesForThePriceOfOne
required public init(){}
}
public class AdDetailsPercentageDiscountOnAllMerchandise : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsBase : Codable
{
public var Description:String
public var moreInformation:[String] = []
required public init(){}
}
public class AdDetailsPercentageDiscountRangeOnAllMerchandise : AdDetailsBase
{
public var start:Double
public var stop:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case start
case stop
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
start = try container.decodeIfPresent(Double.self, forKey: .start)
stop = try container.decodeIfPresent(Double.self, forKey: .stop)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if start != nil { try container.encode(start, forKey: .start) }
if stop != nil { try container.encode(stop, forKey: .stop) }
}
}
public class AdDetailsPercentageDiscountOnSelectedMerchandise : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsAbsoluteDiscountOnSelectedMerchandise : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsAbsoluteDiscountRangeOnAllMerchandise : AdDetailsBase
{
public var start:Double
public var stop:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case start
case stop
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
start = try container.decodeIfPresent(Double.self, forKey: .start)
stop = try container.decodeIfPresent(Double.self, forKey: .stop)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if start != nil { try container.encode(start, forKey: .start) }
if stop != nil { try container.encode(stop, forKey: .stop) }
}
}
public class AdDetailsTotalAmountOverXgivesYdiscount : AdDetailsBase
{
public var ifTotalAmountMoreThanX:Double
public var thenYouGetDiscountPercentageY:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case ifTotalAmountMoreThanX
case thenYouGetDiscountPercentageY
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
ifTotalAmountMoreThanX = try container.decodeIfPresent(Double.self, forKey: .ifTotalAmountMoreThanX)
thenYouGetDiscountPercentageY = try container.decodeIfPresent(Double.self, forKey: .thenYouGetDiscountPercentageY)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if ifTotalAmountMoreThanX != nil { try container.encode(ifTotalAmountMoreThanX, forKey: .ifTotalAmountMoreThanX) }
if thenYouGetDiscountPercentageY != nil { try container.encode(thenYouGetDiscountPercentageY, forKey: .thenYouGetDiscountPercentageY) }
}
}
public class AdDetailsXforYdiscount : AdDetailsBase
{
public var ifYouBuyX:Int
public var thenYouGetY:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case ifYouBuyX
case thenYouGetY
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
ifYouBuyX = try container.decodeIfPresent(Int.self, forKey: .ifYouBuyX)
thenYouGetY = try container.decodeIfPresent(Int.self, forKey: .thenYouGetY)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if ifYouBuyX != nil { try container.encode(ifYouBuyX, forKey: .ifYouBuyX) }
if thenYouGetY != nil { try container.encode(thenYouGetY, forKey: .thenYouGetY) }
}
}
public class AdDetailsNewArrivals : AdDetailsBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class AdDetailsFreetext : AdDetailsBase
{
public var title:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case title
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
title = try container.decodeIfPresent(String.self, forKey: .title)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if title != nil { try container.encode(title, forKey: .title) }
}
}
public class AdDetailsTodaysBreakFastOffer : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsTodaysLunchOffer : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsTodaysDinnerOffer : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsSaveFoodAndMoney : AdDetailsBase
{
public var value:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Double.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class AdDetailsPercentageOffYourFoodBill : AdDetailsBase
{
public var percentage:Double
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case percentage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
percentage = try container.decodeIfPresent(Double.self, forKey: .percentage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if percentage != nil { try container.encode(percentage, forKey: .percentage) }
}
}
public class AdDetailsHappyHour : AdDetailsBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class AdDetailsSomeFreeTablesLeftToday : AdDetailsBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class AdDetailsTwoDishesForThePriceOfOne : AdDetailsBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /ad/get HTTP/1.1 Host: qa-business-api.brovs.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ad":{"id":0,"title":"String","startAt":{"year":0,"month":0,"day":0,"hour":0,"minute":0,"second":0},"stopAt":{"year":0,"month":0,"day":0,"hour":0,"minute":0,"second":0},"publishAt":{"year":0,"month":0,"day":0,"hour":0,"minute":0,"second":0},"state":"String","updatedAt":"0001-01-01T00:00:00.0000000+00:00","imageUrls":[{"preview":"String","small":"String","medium":"String","large":"String"}],"place":{"id":0,"name":"String","businessId":0,"longitude":0,"latitude":0,"claimed":false,"organizationNumber":"String","countryCode":"String","overview":"String","openingHours":{"weekly":{"monday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"tuesday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"wednesday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"thursday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"friday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"saturday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0},"sunday":{"openAtHour":0,"openAtMinute":0,"closeAtHour":0,"closeAtMinute":0}}},"placeType":"Mall","contact":{"phone":"String","email":"String","website":"String","webShop":"String"},"address":{"street":"String","postalCode":"String","region":"String","countryCode":"String"},"wheelChairAccessible":false,"wifi":false,"outdoorSeating":false,"saveFoodAndMoney":false,"timeZoneDto":{"baseUtcOffset":"PT0S","daylightName":"String","displayName":"String","id":"String","standardName":"String","supportsDaylightSavingTime":false},"priceMainDish":{"title":"String","slug":"Value"},"otherServices":[{"id":0,"serviceName":"String","floor":"String"}],"floor":"String"},"detailsUnion":{"percentageOnAllMerchandise":{"value":0,"description":"String","moreInformation":["String"]},"percentageRangeOnAllMerchandise":{"start":0,"stop":0,"description":"String","moreInformation":["String"]},"percentageOnSelectedMerchandise":{"value":0,"description":"String","moreInformation":["String"]},"absoluteOnSelectedMerchandise":{"value":0,"description":"String","moreInformation":["String"]},"absoluteRangeOnAllMerchandise":{"start":0,"stop":0,"description":"String","moreInformation":["String"]},"totalAmountOverXgivesYdiscount":{"ifTotalAmountMoreThanX":0,"thenYouGetDiscountPercentageY":0,"description":"String","moreInformation":["String"]},"xforY":{"ifYouBuyX":0,"thenYouGetY":0,"description":"String","moreInformation":["String"]},"newArrivals":{"description":"String","moreInformation":["String"]},"freetext":{"title":"String","description":"String","moreInformation":["String"]},"todaysBreakFastOffer":{"value":0,"description":"String","moreInformation":["String"]},"todaysLunchOffer":{"value":0,"description":"String","moreInformation":["String"]},"todaysDinnerOffer":{"value":0,"description":"String","moreInformation":["String"]},"saveFoodAndMoney":{"value":0,"description":"String","moreInformation":["String"]},"percentageOfYourFoodBill":{"percentage":0,"description":"String","moreInformation":["String"]},"happyHour":{"description":"String","moreInformation":["String"]},"someFreeTablesLeftToday":{"description":"String","moreInformation":["String"]},"twoDishesForThePriceOfOne":{"description":"String","moreInformation":["String"]}}}}