ConsumerApi

<back to all web services

GetAdMessageDraftsRequest

Consumer
Requires Authentication
Required role:Consumer
The following routes are available for this service:
GET/admessage/drafts
<?php namespace ConsumerApi;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class ImageUrls implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $preview='',
        /** @var string */
        public string $small='',
        /** @var string */
        public string $medium='',
        /** @var string */
        public string $large=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['preview'])) $this->preview = $o['preview'];
        if (isset($o['small'])) $this->small = $o['small'];
        if (isset($o['medium'])) $this->medium = $o['medium'];
        if (isset($o['large'])) $this->large = $o['large'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->preview)) $o['preview'] = $this->preview;
        if (isset($this->small)) $o['small'] = $this->small;
        if (isset($this->medium)) $o['medium'] = $this->medium;
        if (isset($this->large)) $o['large'] = $this->large;
        return empty($o) ? new class(){} : $o;
    }
}

class OpeningHour implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $openAtHour=0,
        /** @var int */
        public int $openAtMinute=0,
        /** @var int */
        public int $closeAtHour=0,
        /** @var int */
        public int $closeAtMinute=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['openAtHour'])) $this->openAtHour = $o['openAtHour'];
        if (isset($o['openAtMinute'])) $this->openAtMinute = $o['openAtMinute'];
        if (isset($o['closeAtHour'])) $this->closeAtHour = $o['closeAtHour'];
        if (isset($o['closeAtMinute'])) $this->closeAtMinute = $o['closeAtMinute'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->openAtHour)) $o['openAtHour'] = $this->openAtHour;
        if (isset($this->openAtMinute)) $o['openAtMinute'] = $this->openAtMinute;
        if (isset($this->closeAtHour)) $o['closeAtHour'] = $this->closeAtHour;
        if (isset($this->closeAtMinute)) $o['closeAtMinute'] = $this->closeAtMinute;
        return empty($o) ? new class(){} : $o;
    }
}

class WeeklyOpeningHours implements JsonSerializable
{
    public function __construct(
        /** @var OpeningHour|null */
        public ?OpeningHour $monday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $tuesday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $wednesday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $thursday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $friday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $saturday=null,
        /** @var OpeningHour|null */
        public ?OpeningHour $sunday=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['monday'])) $this->monday = JsonConverters::from('OpeningHour', $o['monday']);
        if (isset($o['tuesday'])) $this->tuesday = JsonConverters::from('OpeningHour', $o['tuesday']);
        if (isset($o['wednesday'])) $this->wednesday = JsonConverters::from('OpeningHour', $o['wednesday']);
        if (isset($o['thursday'])) $this->thursday = JsonConverters::from('OpeningHour', $o['thursday']);
        if (isset($o['friday'])) $this->friday = JsonConverters::from('OpeningHour', $o['friday']);
        if (isset($o['saturday'])) $this->saturday = JsonConverters::from('OpeningHour', $o['saturday']);
        if (isset($o['sunday'])) $this->sunday = JsonConverters::from('OpeningHour', $o['sunday']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->monday)) $o['monday'] = JsonConverters::to('OpeningHour', $this->monday);
        if (isset($this->tuesday)) $o['tuesday'] = JsonConverters::to('OpeningHour', $this->tuesday);
        if (isset($this->wednesday)) $o['wednesday'] = JsonConverters::to('OpeningHour', $this->wednesday);
        if (isset($this->thursday)) $o['thursday'] = JsonConverters::to('OpeningHour', $this->thursday);
        if (isset($this->friday)) $o['friday'] = JsonConverters::to('OpeningHour', $this->friday);
        if (isset($this->saturday)) $o['saturday'] = JsonConverters::to('OpeningHour', $this->saturday);
        if (isset($this->sunday)) $o['sunday'] = JsonConverters::to('OpeningHour', $this->sunday);
        return empty($o) ? new class(){} : $o;
    }
}

class OpeningHours implements JsonSerializable
{
    public function __construct(
        /** @var WeeklyOpeningHours|null */
        public ?WeeklyOpeningHours $weekly=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['weekly'])) $this->weekly = JsonConverters::from('WeeklyOpeningHours', $o['weekly']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->weekly)) $o['weekly'] = JsonConverters::to('WeeklyOpeningHours', $this->weekly);
        return empty($o) ? new class(){} : $o;
    }
}

enum PlaceType : string
{
    case Mall = 'Mall';
    case Regular = 'Regular';
}

enum PriceMainDish : string
{
    case Value = 'Value';
    case Medium = 'Medium';
    case High = 'High';
    case FineDining = 'FineDining';
}

class PriceMainDishApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $title='',
        /** @var PriceMainDish|null */
        public ?PriceMainDish $slug=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['slug'])) $this->slug = JsonConverters::from('PriceMainDish', $o['slug']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->slug)) $o['slug'] = JsonConverters::to('PriceMainDish', $this->slug);
        return empty($o) ? new class(){} : $o;
    }
}

class TimeZoneDto implements JsonSerializable
{
    public function __construct(
        /** @var DateInterval|null */
        public ?DateInterval $baseUtcOffset=null,
        /** @var string */
        public string $daylightName='',
        /** @var string */
        public string $displayName='',
        /** @var string */
        public string $id='',
        /** @var string */
        public string $standardName='',
        /** @var bool|null */
        public ?bool $supportsDaylightSavingTime=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['baseUtcOffset'])) $this->baseUtcOffset = JsonConverters::from('DateInterval', $o['baseUtcOffset']);
        if (isset($o['daylightName'])) $this->daylightName = $o['daylightName'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['standardName'])) $this->standardName = $o['standardName'];
        if (isset($o['supportsDaylightSavingTime'])) $this->supportsDaylightSavingTime = $o['supportsDaylightSavingTime'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->baseUtcOffset)) $o['baseUtcOffset'] = JsonConverters::to('DateInterval', $this->baseUtcOffset);
        if (isset($this->daylightName)) $o['daylightName'] = $this->daylightName;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->standardName)) $o['standardName'] = $this->standardName;
        if (isset($this->supportsDaylightSavingTime)) $o['supportsDaylightSavingTime'] = $this->supportsDaylightSavingTime;
        return empty($o) ? new class(){} : $o;
    }
}

class PlaceContact implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $phone=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $website=null,
        /** @var string|null */
        public ?string $webShop=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['phone'])) $this->phone = $o['phone'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['website'])) $this->website = $o['website'];
        if (isset($o['webShop'])) $this->webShop = $o['webShop'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->phone)) $o['phone'] = $this->phone;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->website)) $o['website'] = $this->website;
        if (isset($this->webShop)) $o['webShop'] = $this->webShop;
        return empty($o) ? new class(){} : $o;
    }
}

class PlaceAddress implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $street='',
        /** @var string */
        public string $postalCode='',
        /** @var string */
        public string $region='',
        /** @var string */
        public string $countryCode=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['region'])) $this->region = $o['region'];
        if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->region)) $o['region'] = $this->region;
        if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
        return empty($o) ? new class(){} : $o;
    }
}

class CategoryTreeApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name='',
        /** @var string */
        public string $slug='',
        /** @var string */
        public string $absoluteSlug='',
        /** @var string|null */
        public ?string $imageUrl=null,
        /** @var string|null */
        public ?string $allImageUrl=null,
        /** @var string|null */
        public ?string $iconImageUrl=null,
        /** @var int */
        public int $position=0,
        /** @var array<CategoryTreeApiDto>|null */
        public ?array $children=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['slug'])) $this->slug = $o['slug'];
        if (isset($o['absoluteSlug'])) $this->absoluteSlug = $o['absoluteSlug'];
        if (isset($o['imageUrl'])) $this->imageUrl = $o['imageUrl'];
        if (isset($o['allImageUrl'])) $this->allImageUrl = $o['allImageUrl'];
        if (isset($o['iconImageUrl'])) $this->iconImageUrl = $o['iconImageUrl'];
        if (isset($o['position'])) $this->position = $o['position'];
        if (isset($o['children'])) $this->children = JsonConverters::fromArray('CategoryTreeApiDto', $o['children']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->slug)) $o['slug'] = $this->slug;
        if (isset($this->absoluteSlug)) $o['absoluteSlug'] = $this->absoluteSlug;
        if (isset($this->imageUrl)) $o['imageUrl'] = $this->imageUrl;
        if (isset($this->allImageUrl)) $o['allImageUrl'] = $this->allImageUrl;
        if (isset($this->iconImageUrl)) $o['iconImageUrl'] = $this->iconImageUrl;
        if (isset($this->position)) $o['position'] = $this->position;
        if (isset($this->children)) $o['children'] = JsonConverters::toArray('CategoryTreeApiDto', $this->children);
        return empty($o) ? new class(){} : $o;
    }
}

class WearPriceProfileEsDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $slug='',
        /** @var string */
        public string $label=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['slug'])) $this->slug = $o['slug'];
        if (isset($o['label'])) $this->label = $o['label'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->slug)) $o['slug'] = $this->slug;
        if (isset($this->label)) $o['label'] = $this->label;
        return empty($o) ? new class(){} : $o;
    }
}

class BrandApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        return empty($o) ? new class(){} : $o;
    }
}

class PlaceCustomBrandApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        return empty($o) ? new class(){} : $o;
    }
}

class PlaceSelectedBrandApiDto implements JsonSerializable
{
    public function __construct(
        /** @var BrandApiDto|null */
        public ?BrandApiDto $brand=null,
        /** @var string[]|null */
        public ?array $categoryAbsoluteSlugs=null,
        /** @var PlaceCustomBrandApiDto|null */
        public ?PlaceCustomBrandApiDto $placeCustomBrand=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['brand'])) $this->brand = JsonConverters::from('BrandApiDto', $o['brand']);
        if (isset($o['categoryAbsoluteSlugs'])) $this->categoryAbsoluteSlugs = JsonConverters::fromArray('string', $o['categoryAbsoluteSlugs']);
        if (isset($o['placeCustomBrand'])) $this->placeCustomBrand = JsonConverters::from('PlaceCustomBrandApiDto', $o['placeCustomBrand']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->brand)) $o['brand'] = JsonConverters::to('BrandApiDto', $this->brand);
        if (isset($this->categoryAbsoluteSlugs)) $o['categoryAbsoluteSlugs'] = JsonConverters::toArray('string', $this->categoryAbsoluteSlugs);
        if (isset($this->placeCustomBrand)) $o['placeCustomBrand'] = JsonConverters::to('PlaceCustomBrandApiDto', $this->placeCustomBrand);
        return empty($o) ? new class(){} : $o;
    }
}

class PlaceBasicApiDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string */
        public string $guid='',
        /** @var string|null */
        public ?string $overview=null,
        /** @var string */
        public string $name='',
        /** @var float */
        public float $longitude=0.0,
        /** @var float */
        public float $latitude=0.0,
        /** @var bool|null */
        public ?bool $claimed=null,
        /** @var string|null */
        public ?string $organizationNumber=null,
        /** @var string */
        public string $countryCode='',
        /** @var OpeningHours|null */
        public ?OpeningHours $openingHours=null,
        /** @var bool|null */
        public ?bool $wheelchairAccessible=null,
        /** @var bool|null */
        public ?bool $wifi=null,
        /** @var bool|null */
        public ?bool $outdoorSeating=null,
        /** @var bool|null */
        public ?bool $saveFoodAndMoney=null,
        /** @var PlaceType|null */
        public ?PlaceType $placeType=null,
        /** @var PriceMainDishApiDto|null */
        public ?PriceMainDishApiDto $priceMainDish=null,
        /** @var TimeZoneDto|null */
        public ?TimeZoneDto $timeZoneDto=null,
        /** @var int|null */
        public ?int $businessId=null,
        /** @var PlaceContact|null */
        public ?PlaceContact $contact=null,
        /** @var PlaceAddress|null */
        public ?PlaceAddress $address=null,
        /** @var array<CategoryTreeApiDto>|null */
        public ?array $categories=null,
        /** @var ImageUrls|null */
        public ?ImageUrls $logoUrl=null,
        /** @var ImageUrls|null */
        public ?ImageUrls $imageUrl=null,
        /** @var array<WearPriceProfileEsDto>|null */
        public ?array $wearPriceProfiles=null,
        /** @var array<PlaceSelectedBrandApiDto>|null */
        public ?array $brands=null,
        /** @var string|null */
        public ?string $floor=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['overview'])) $this->overview = $o['overview'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['claimed'])) $this->claimed = $o['claimed'];
        if (isset($o['organizationNumber'])) $this->organizationNumber = $o['organizationNumber'];
        if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
        if (isset($o['openingHours'])) $this->openingHours = JsonConverters::from('OpeningHours', $o['openingHours']);
        if (isset($o['wheelchairAccessible'])) $this->wheelchairAccessible = $o['wheelchairAccessible'];
        if (isset($o['wifi'])) $this->wifi = $o['wifi'];
        if (isset($o['outdoorSeating'])) $this->outdoorSeating = $o['outdoorSeating'];
        if (isset($o['saveFoodAndMoney'])) $this->saveFoodAndMoney = $o['saveFoodAndMoney'];
        if (isset($o['placeType'])) $this->placeType = JsonConverters::from('PlaceType', $o['placeType']);
        if (isset($o['priceMainDish'])) $this->priceMainDish = JsonConverters::from('PriceMainDishApiDto', $o['priceMainDish']);
        if (isset($o['timeZoneDto'])) $this->timeZoneDto = JsonConverters::from('TimeZoneDto', $o['timeZoneDto']);
        if (isset($o['businessId'])) $this->businessId = $o['businessId'];
        if (isset($o['contact'])) $this->contact = JsonConverters::from('PlaceContact', $o['contact']);
        if (isset($o['address'])) $this->address = JsonConverters::from('PlaceAddress', $o['address']);
        if (isset($o['categories'])) $this->categories = JsonConverters::fromArray('CategoryTreeApiDto', $o['categories']);
        if (isset($o['logoUrl'])) $this->logoUrl = JsonConverters::from('ImageUrls', $o['logoUrl']);
        if (isset($o['imageUrl'])) $this->imageUrl = JsonConverters::from('ImageUrls', $o['imageUrl']);
        if (isset($o['wearPriceProfiles'])) $this->wearPriceProfiles = JsonConverters::fromArray('WearPriceProfileEsDto', $o['wearPriceProfiles']);
        if (isset($o['brands'])) $this->brands = JsonConverters::fromArray('PlaceSelectedBrandApiDto', $o['brands']);
        if (isset($o['floor'])) $this->floor = $o['floor'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->overview)) $o['overview'] = $this->overview;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->claimed)) $o['claimed'] = $this->claimed;
        if (isset($this->organizationNumber)) $o['organizationNumber'] = $this->organizationNumber;
        if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
        if (isset($this->openingHours)) $o['openingHours'] = JsonConverters::to('OpeningHours', $this->openingHours);
        if (isset($this->wheelchairAccessible)) $o['wheelchairAccessible'] = $this->wheelchairAccessible;
        if (isset($this->wifi)) $o['wifi'] = $this->wifi;
        if (isset($this->outdoorSeating)) $o['outdoorSeating'] = $this->outdoorSeating;
        if (isset($this->saveFoodAndMoney)) $o['saveFoodAndMoney'] = $this->saveFoodAndMoney;
        if (isset($this->placeType)) $o['placeType'] = JsonConverters::to('PlaceType', $this->placeType);
        if (isset($this->priceMainDish)) $o['priceMainDish'] = JsonConverters::to('PriceMainDishApiDto', $this->priceMainDish);
        if (isset($this->timeZoneDto)) $o['timeZoneDto'] = JsonConverters::to('TimeZoneDto', $this->timeZoneDto);
        if (isset($this->businessId)) $o['businessId'] = $this->businessId;
        if (isset($this->contact)) $o['contact'] = JsonConverters::to('PlaceContact', $this->contact);
        if (isset($this->address)) $o['address'] = JsonConverters::to('PlaceAddress', $this->address);
        if (isset($this->categories)) $o['categories'] = JsonConverters::toArray('CategoryTreeApiDto', $this->categories);
        if (isset($this->logoUrl)) $o['logoUrl'] = JsonConverters::to('ImageUrls', $this->logoUrl);
        if (isset($this->imageUrl)) $o['imageUrl'] = JsonConverters::to('ImageUrls', $this->imageUrl);
        if (isset($this->wearPriceProfiles)) $o['wearPriceProfiles'] = JsonConverters::toArray('WearPriceProfileEsDto', $this->wearPriceProfiles);
        if (isset($this->brands)) $o['brands'] = JsonConverters::toArray('PlaceSelectedBrandApiDto', $this->brands);
        if (isset($this->floor)) $o['floor'] = $this->floor;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsBase implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $description=null,
        /** @var array<string>|null */
        public ?array $moreInformation=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['moreInformation'])) $this->moreInformation = JsonConverters::fromArray('string', $o['moreInformation']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->moreInformation)) $o['moreInformation'] = JsonConverters::toArray('string', $this->moreInformation);
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsPercentageDiscountOnAllMerchandise extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsPercentageDiscountRangeOnAllMerchandise extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $start=0.0,
        /** @var float */
        public float $stop=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['start'])) $this->start = $o['start'];
        if (isset($o['stop'])) $this->stop = $o['stop'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->start)) $o['start'] = $this->start;
        if (isset($this->stop)) $o['stop'] = $this->stop;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsPercentageDiscountOnSelectedMerchandise extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsAbsoluteDiscountOnSelectedMerchandise extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsAbsoluteDiscountRangeOnAllMerchandise extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $start=0.0,
        /** @var float */
        public float $stop=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['start'])) $this->start = $o['start'];
        if (isset($o['stop'])) $this->stop = $o['stop'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->start)) $o['start'] = $this->start;
        if (isset($this->stop)) $o['stop'] = $this->stop;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsTotalAmountOverXgivesYdiscount extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $ifTotalAmountMoreThanX=0.0,
        /** @var float */
        public float $thenYouGetDiscountPercentageY=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ifTotalAmountMoreThanX'])) $this->ifTotalAmountMoreThanX = $o['ifTotalAmountMoreThanX'];
        if (isset($o['thenYouGetDiscountPercentageY'])) $this->thenYouGetDiscountPercentageY = $o['thenYouGetDiscountPercentageY'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ifTotalAmountMoreThanX)) $o['ifTotalAmountMoreThanX'] = $this->ifTotalAmountMoreThanX;
        if (isset($this->thenYouGetDiscountPercentageY)) $o['thenYouGetDiscountPercentageY'] = $this->thenYouGetDiscountPercentageY;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsXforYdiscount extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var int */
        public int $ifYouBuyX=0,
        /** @var int */
        public int $thenYouGetY=0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ifYouBuyX'])) $this->ifYouBuyX = $o['ifYouBuyX'];
        if (isset($o['thenYouGetY'])) $this->thenYouGetY = $o['thenYouGetY'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ifYouBuyX)) $o['ifYouBuyX'] = $this->ifYouBuyX;
        if (isset($this->thenYouGetY)) $o['thenYouGetY'] = $this->thenYouGetY;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsNewArrivals extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsFreetext extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var string */
        public string $title=''
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['title'])) $this->title = $o['title'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->title)) $o['title'] = $this->title;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsTodaysBreakFastOffer extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsTodaysLunchOffer extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsTodaysDinnerOffer extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsSaveFoodAndMoney extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $value=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsPercentageOffYourFoodBill extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null,
        /** @var float */
        public float $percentage=0.0
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['percentage'])) $this->percentage = $o['percentage'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->percentage)) $o['percentage'] = $this->percentage;
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsHappyHour extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsSomeFreeTablesLeftToday extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsTwoDishesForThePriceOfOne extends AdMessageDetailsBase implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param array<string>|null $moreInformation
     */
    public function __construct(
        ?string $description=null,
        ?array $moreInformation=null
    ) {
        parent::__construct($description,$moreInformation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDetailsUnion implements JsonSerializable
{
    public function __construct(
        /** @var AdMessageDetailsPercentageDiscountOnAllMerchandise|null */
        public ?AdMessageDetailsPercentageDiscountOnAllMerchandise $percentageOnAllMerchandise=null,
        /** @var AdMessageDetailsPercentageDiscountRangeOnAllMerchandise|null */
        public ?AdMessageDetailsPercentageDiscountRangeOnAllMerchandise $percentageRangeOnAllMerchandise=null,
        /** @var AdMessageDetailsPercentageDiscountOnSelectedMerchandise|null */
        public ?AdMessageDetailsPercentageDiscountOnSelectedMerchandise $percentageOnSelectedMerchandise=null,
        /** @var AdMessageDetailsAbsoluteDiscountOnSelectedMerchandise|null */
        public ?AdMessageDetailsAbsoluteDiscountOnSelectedMerchandise $absoluteOnSelectedMerchandise=null,
        /** @var AdMessageDetailsAbsoluteDiscountRangeOnAllMerchandise|null */
        public ?AdMessageDetailsAbsoluteDiscountRangeOnAllMerchandise $absoluteRangeOnAllMerchandise=null,
        /** @var AdMessageDetailsTotalAmountOverXgivesYdiscount|null */
        public ?AdMessageDetailsTotalAmountOverXgivesYdiscount $totalAmountOverXgivesYdiscount=null,
        /** @var AdMessageDetailsXforYdiscount|null */
        public ?AdMessageDetailsXforYdiscount $xforY=null,
        /** @var AdMessageDetailsNewArrivals|null */
        public ?AdMessageDetailsNewArrivals $newArrivals=null,
        /** @var AdMessageDetailsFreetext|null */
        public ?AdMessageDetailsFreetext $freetext=null,
        /** @var AdMessageDetailsTodaysBreakFastOffer|null */
        public ?AdMessageDetailsTodaysBreakFastOffer $todaysBreakFastOffer=null,
        /** @var AdMessageDetailsTodaysLunchOffer|null */
        public ?AdMessageDetailsTodaysLunchOffer $todaysLunchOffer=null,
        /** @var AdMessageDetailsTodaysDinnerOffer|null */
        public ?AdMessageDetailsTodaysDinnerOffer $todaysDinnerOffer=null,
        /** @var AdMessageDetailsSaveFoodAndMoney|null */
        public ?AdMessageDetailsSaveFoodAndMoney $saveFoodAndMoney=null,
        /** @var AdMessageDetailsPercentageOffYourFoodBill|null */
        public ?AdMessageDetailsPercentageOffYourFoodBill $percentageOfYourFoodBill=null,
        /** @var AdMessageDetailsHappyHour|null */
        public ?AdMessageDetailsHappyHour $happyHour=null,
        /** @var AdMessageDetailsSomeFreeTablesLeftToday|null */
        public ?AdMessageDetailsSomeFreeTablesLeftToday $someFreeTablesLeftToday=null,
        /** @var AdMessageDetailsTwoDishesForThePriceOfOne|null */
        public ?AdMessageDetailsTwoDishesForThePriceOfOne $twoDishesForThePriceOfOne=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['percentageOnAllMerchandise'])) $this->percentageOnAllMerchandise = JsonConverters::from('AdMessageDetailsPercentageDiscountOnAllMerchandise', $o['percentageOnAllMerchandise']);
        if (isset($o['percentageRangeOnAllMerchandise'])) $this->percentageRangeOnAllMerchandise = JsonConverters::from('AdMessageDetailsPercentageDiscountRangeOnAllMerchandise', $o['percentageRangeOnAllMerchandise']);
        if (isset($o['percentageOnSelectedMerchandise'])) $this->percentageOnSelectedMerchandise = JsonConverters::from('AdMessageDetailsPercentageDiscountOnSelectedMerchandise', $o['percentageOnSelectedMerchandise']);
        if (isset($o['absoluteOnSelectedMerchandise'])) $this->absoluteOnSelectedMerchandise = JsonConverters::from('AdMessageDetailsAbsoluteDiscountOnSelectedMerchandise', $o['absoluteOnSelectedMerchandise']);
        if (isset($o['absoluteRangeOnAllMerchandise'])) $this->absoluteRangeOnAllMerchandise = JsonConverters::from('AdMessageDetailsAbsoluteDiscountRangeOnAllMerchandise', $o['absoluteRangeOnAllMerchandise']);
        if (isset($o['totalAmountOverXgivesYdiscount'])) $this->totalAmountOverXgivesYdiscount = JsonConverters::from('AdMessageDetailsTotalAmountOverXgivesYdiscount', $o['totalAmountOverXgivesYdiscount']);
        if (isset($o['xforY'])) $this->xforY = JsonConverters::from('AdMessageDetailsXforYdiscount', $o['xforY']);
        if (isset($o['newArrivals'])) $this->newArrivals = JsonConverters::from('AdMessageDetailsNewArrivals', $o['newArrivals']);
        if (isset($o['freetext'])) $this->freetext = JsonConverters::from('AdMessageDetailsFreetext', $o['freetext']);
        if (isset($o['todaysBreakFastOffer'])) $this->todaysBreakFastOffer = JsonConverters::from('AdMessageDetailsTodaysBreakFastOffer', $o['todaysBreakFastOffer']);
        if (isset($o['todaysLunchOffer'])) $this->todaysLunchOffer = JsonConverters::from('AdMessageDetailsTodaysLunchOffer', $o['todaysLunchOffer']);
        if (isset($o['todaysDinnerOffer'])) $this->todaysDinnerOffer = JsonConverters::from('AdMessageDetailsTodaysDinnerOffer', $o['todaysDinnerOffer']);
        if (isset($o['saveFoodAndMoney'])) $this->saveFoodAndMoney = JsonConverters::from('AdMessageDetailsSaveFoodAndMoney', $o['saveFoodAndMoney']);
        if (isset($o['percentageOfYourFoodBill'])) $this->percentageOfYourFoodBill = JsonConverters::from('AdMessageDetailsPercentageOffYourFoodBill', $o['percentageOfYourFoodBill']);
        if (isset($o['happyHour'])) $this->happyHour = JsonConverters::from('AdMessageDetailsHappyHour', $o['happyHour']);
        if (isset($o['someFreeTablesLeftToday'])) $this->someFreeTablesLeftToday = JsonConverters::from('AdMessageDetailsSomeFreeTablesLeftToday', $o['someFreeTablesLeftToday']);
        if (isset($o['twoDishesForThePriceOfOne'])) $this->twoDishesForThePriceOfOne = JsonConverters::from('AdMessageDetailsTwoDishesForThePriceOfOne', $o['twoDishesForThePriceOfOne']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->percentageOnAllMerchandise)) $o['percentageOnAllMerchandise'] = JsonConverters::to('AdMessageDetailsPercentageDiscountOnAllMerchandise', $this->percentageOnAllMerchandise);
        if (isset($this->percentageRangeOnAllMerchandise)) $o['percentageRangeOnAllMerchandise'] = JsonConverters::to('AdMessageDetailsPercentageDiscountRangeOnAllMerchandise', $this->percentageRangeOnAllMerchandise);
        if (isset($this->percentageOnSelectedMerchandise)) $o['percentageOnSelectedMerchandise'] = JsonConverters::to('AdMessageDetailsPercentageDiscountOnSelectedMerchandise', $this->percentageOnSelectedMerchandise);
        if (isset($this->absoluteOnSelectedMerchandise)) $o['absoluteOnSelectedMerchandise'] = JsonConverters::to('AdMessageDetailsAbsoluteDiscountOnSelectedMerchandise', $this->absoluteOnSelectedMerchandise);
        if (isset($this->absoluteRangeOnAllMerchandise)) $o['absoluteRangeOnAllMerchandise'] = JsonConverters::to('AdMessageDetailsAbsoluteDiscountRangeOnAllMerchandise', $this->absoluteRangeOnAllMerchandise);
        if (isset($this->totalAmountOverXgivesYdiscount)) $o['totalAmountOverXgivesYdiscount'] = JsonConverters::to('AdMessageDetailsTotalAmountOverXgivesYdiscount', $this->totalAmountOverXgivesYdiscount);
        if (isset($this->xforY)) $o['xforY'] = JsonConverters::to('AdMessageDetailsXforYdiscount', $this->xforY);
        if (isset($this->newArrivals)) $o['newArrivals'] = JsonConverters::to('AdMessageDetailsNewArrivals', $this->newArrivals);
        if (isset($this->freetext)) $o['freetext'] = JsonConverters::to('AdMessageDetailsFreetext', $this->freetext);
        if (isset($this->todaysBreakFastOffer)) $o['todaysBreakFastOffer'] = JsonConverters::to('AdMessageDetailsTodaysBreakFastOffer', $this->todaysBreakFastOffer);
        if (isset($this->todaysLunchOffer)) $o['todaysLunchOffer'] = JsonConverters::to('AdMessageDetailsTodaysLunchOffer', $this->todaysLunchOffer);
        if (isset($this->todaysDinnerOffer)) $o['todaysDinnerOffer'] = JsonConverters::to('AdMessageDetailsTodaysDinnerOffer', $this->todaysDinnerOffer);
        if (isset($this->saveFoodAndMoney)) $o['saveFoodAndMoney'] = JsonConverters::to('AdMessageDetailsSaveFoodAndMoney', $this->saveFoodAndMoney);
        if (isset($this->percentageOfYourFoodBill)) $o['percentageOfYourFoodBill'] = JsonConverters::to('AdMessageDetailsPercentageOffYourFoodBill', $this->percentageOfYourFoodBill);
        if (isset($this->happyHour)) $o['happyHour'] = JsonConverters::to('AdMessageDetailsHappyHour', $this->happyHour);
        if (isset($this->someFreeTablesLeftToday)) $o['someFreeTablesLeftToday'] = JsonConverters::to('AdMessageDetailsSomeFreeTablesLeftToday', $this->someFreeTablesLeftToday);
        if (isset($this->twoDishesForThePriceOfOne)) $o['twoDishesForThePriceOfOne'] = JsonConverters::to('AdMessageDetailsTwoDishesForThePriceOfOne', $this->twoDishesForThePriceOfOne);
        return empty($o) ? new class(){} : $o;
    }
}

class AdMessageDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string */
        public string $guid='',
        /** @var string */
        public string $title='',
        /** @var DateTime */
        public DateTime $startAt=new DateTime(),
        /** @var DateTime */
        public DateTime $stopAt=new DateTime(),
        /** @var DateTime */
        public DateTime $publishAt=new DateTime(),
        /** @var array<ImageUrls>|null */
        public ?array $imageUrls=null,
        /** @var PlaceBasicApiDto|null */
        public ?PlaceBasicApiDto $place=null,
        /** @var AdMessageDetailsUnion|null */
        public ?AdMessageDetailsUnion $detailsUnion=null,
        /** @var int */
        public int $starredCount=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['guid'])) $this->guid = $o['guid'];
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['startAt'])) $this->startAt = JsonConverters::from('DateTime', $o['startAt']);
        if (isset($o['stopAt'])) $this->stopAt = JsonConverters::from('DateTime', $o['stopAt']);
        if (isset($o['publishAt'])) $this->publishAt = JsonConverters::from('DateTime', $o['publishAt']);
        if (isset($o['imageUrls'])) $this->imageUrls = JsonConverters::fromArray('ImageUrls', $o['imageUrls']);
        if (isset($o['place'])) $this->place = JsonConverters::from('PlaceBasicApiDto', $o['place']);
        if (isset($o['detailsUnion'])) $this->detailsUnion = JsonConverters::from('AdMessageDetailsUnion', $o['detailsUnion']);
        if (isset($o['starredCount'])) $this->starredCount = $o['starredCount'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->guid)) $o['guid'] = $this->guid;
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->startAt)) $o['startAt'] = JsonConverters::to('DateTime', $this->startAt);
        if (isset($this->stopAt)) $o['stopAt'] = JsonConverters::to('DateTime', $this->stopAt);
        if (isset($this->publishAt)) $o['publishAt'] = JsonConverters::to('DateTime', $this->publishAt);
        if (isset($this->imageUrls)) $o['imageUrls'] = JsonConverters::toArray('ImageUrls', $this->imageUrls);
        if (isset($this->place)) $o['place'] = JsonConverters::to('PlaceBasicApiDto', $this->place);
        if (isset($this->detailsUnion)) $o['detailsUnion'] = JsonConverters::to('AdMessageDetailsUnion', $this->detailsUnion);
        if (isset($this->starredCount)) $o['starredCount'] = $this->starredCount;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetAdMessageDraftsRequest 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 /admessage/drafts HTTP/1.1 
Host: unstable-consumer-api.brovs.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetAdMessageDraftsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConsumerApi.Dto">
  <DraftAdMessages xmlns:d2p1="http://schemas.datacontract.org/2004/07/Api.Dto">
    <d2p1:AdMessageDto>
      <d2p1:DetailsUnion xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:AbsoluteOnSelectedMerchandise>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:AbsoluteOnSelectedMerchandise>
        <d4p1:AbsoluteRangeOnAllMerchandise>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Start>0</d4p1:Start>
          <d4p1:Stop>0</d4p1:Stop>
        </d4p1:AbsoluteRangeOnAllMerchandise>
        <d4p1:Freetext>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Title>String</d4p1:Title>
        </d4p1:Freetext>
        <d4p1:HappyHour>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
        </d4p1:HappyHour>
        <d4p1:NewArrivals>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
        </d4p1:NewArrivals>
        <d4p1:PercentageOfYourFoodBill>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Percentage>0</d4p1:Percentage>
        </d4p1:PercentageOfYourFoodBill>
        <d4p1:PercentageOnAllMerchandise>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:PercentageOnAllMerchandise>
        <d4p1:PercentageOnSelectedMerchandise>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:PercentageOnSelectedMerchandise>
        <d4p1:PercentageRangeOnAllMerchandise>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Start>0</d4p1:Start>
          <d4p1:Stop>0</d4p1:Stop>
        </d4p1:PercentageRangeOnAllMerchandise>
        <d4p1:SaveFoodAndMoney>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:SaveFoodAndMoney>
        <d4p1:SomeFreeTablesLeftToday>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
        </d4p1:SomeFreeTablesLeftToday>
        <d4p1:TodaysBreakFastOffer>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:TodaysBreakFastOffer>
        <d4p1:TodaysDinnerOffer>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:TodaysDinnerOffer>
        <d4p1:TodaysLunchOffer>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:TodaysLunchOffer>
        <d4p1:TotalAmountOverXgivesYdiscount>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:IfTotalAmountMoreThanX>0</d4p1:IfTotalAmountMoreThanX>
          <d4p1:ThenYouGetDiscountPercentageY>0</d4p1:ThenYouGetDiscountPercentageY>
        </d4p1:TotalAmountOverXgivesYdiscount>
        <d4p1:TwoDishesForThePriceOfOne>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
        </d4p1:TwoDishesForThePriceOfOne>
        <d4p1:XforY>
          <d4p1:Description>String</d4p1:Description>
          <d4p1:MoreInformation xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:MoreInformation>
          <d4p1:IfYouBuyX>0</d4p1:IfYouBuyX>
          <d4p1:ThenYouGetY>0</d4p1:ThenYouGetY>
        </d4p1:XforY>
      </d2p1:DetailsUnion>
      <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:ImageUrls xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:ImageUrls>
          <d4p1:Large>String</d4p1:Large>
          <d4p1:Medium>String</d4p1:Medium>
          <d4p1:Preview>String</d4p1:Preview>
          <d4p1:Small>String</d4p1:Small>
        </d4p1:ImageUrls>
      </d2p1:ImageUrls>
      <d2p1:Place>
        <d2p1:Address xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:CountryCode>String</d5p1:CountryCode>
          <d5p1:PostalCode>String</d5p1:PostalCode>
          <d5p1:Region>String</d5p1:Region>
          <d5p1:Street>String</d5p1:Street>
        </d2p1:Address>
        <d2p1:Brands>
          <d2p1:PlaceSelectedBrandApiDto>
            <d2p1:Brand>
              <d2p1:Name>String</d2p1:Name>
            </d2p1:Brand>
            <d2p1:CategoryAbsoluteSlugs xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:string>String</d7p1:string>
            </d2p1:CategoryAbsoluteSlugs>
            <d2p1:PlaceCustomBrand>
              <d2p1:Name>String</d2p1:Name>
            </d2p1:PlaceCustomBrand>
          </d2p1:PlaceSelectedBrandApiDto>
        </d2p1:Brands>
        <d2p1:BusinessId>0</d2p1:BusinessId>
        <d2p1:Categories>
          <d2p1:CategoryTreeApiDto>
            <d2p1:AbsoluteSlug>String</d2p1:AbsoluteSlug>
            <d2p1:AllImageUrl>String</d2p1:AllImageUrl>
            <d2p1:Children>
              <d2p1:CategoryTreeApiDto>
                <d2p1:AbsoluteSlug>String</d2p1:AbsoluteSlug>
                <d2p1:AllImageUrl>String</d2p1:AllImageUrl>
                <d2p1:Children>
                  <d2p1:CategoryTreeApiDto>
                    <d2p1:AbsoluteSlug>String</d2p1:AbsoluteSlug>
                    <d2p1:AllImageUrl>String</d2p1:AllImageUrl>
                    <d2p1:Children i:nil="true" />
                    <d2p1:IconImageUrl>String</d2p1:IconImageUrl>
                    <d2p1:ImageUrl>String</d2p1:ImageUrl>
                    <d2p1:Name>String</d2p1:Name>
                    <d2p1:Position>0</d2p1:Position>
                    <d2p1:Slug>String</d2p1:Slug>
                  </d2p1:CategoryTreeApiDto>
                </d2p1:Children>
                <d2p1:IconImageUrl>String</d2p1:IconImageUrl>
                <d2p1:ImageUrl>String</d2p1:ImageUrl>
                <d2p1:Name>String</d2p1:Name>
                <d2p1:Position>0</d2p1:Position>
                <d2p1:Slug>String</d2p1:Slug>
              </d2p1:CategoryTreeApiDto>
            </d2p1:Children>
            <d2p1:IconImageUrl>String</d2p1:IconImageUrl>
            <d2p1:ImageUrl>String</d2p1:ImageUrl>
            <d2p1:Name>String</d2p1:Name>
            <d2p1:Position>0</d2p1:Position>
            <d2p1:Slug>String</d2p1:Slug>
          </d2p1:CategoryTreeApiDto>
        </d2p1:Categories>
        <d2p1:Claimed>false</d2p1:Claimed>
        <d2p1:Contact xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:Email>String</d5p1:Email>
          <d5p1:Phone>String</d5p1:Phone>
          <d5p1:WebShop>String</d5p1:WebShop>
          <d5p1:Website>String</d5p1:Website>
        </d2p1:Contact>
        <d2p1:CountryCode>String</d2p1:CountryCode>
        <d2p1:Floor>String</d2p1:Floor>
        <d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
        <d2p1:Id>0</d2p1:Id>
        <d2p1:ImageUrl xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:Large>String</d5p1:Large>
          <d5p1:Medium>String</d5p1:Medium>
          <d5p1:Preview>String</d5p1:Preview>
          <d5p1:Small>String</d5p1:Small>
        </d2p1:ImageUrl>
        <d2p1:Latitude>0</d2p1:Latitude>
        <d2p1:LogoUrl xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:Large>String</d5p1:Large>
          <d5p1:Medium>String</d5p1:Medium>
          <d5p1:Preview>String</d5p1:Preview>
          <d5p1:Small>String</d5p1:Small>
        </d2p1:LogoUrl>
        <d2p1:Longitude>0</d2p1:Longitude>
        <d2p1:Name>String</d2p1:Name>
        <d2p1:OpeningHours xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:Weekly>
            <d5p1:Friday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Friday>
            <d5p1:Monday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Monday>
            <d5p1:Saturday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Saturday>
            <d5p1:Sunday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Sunday>
            <d5p1:Thursday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Thursday>
            <d5p1:Tuesday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Tuesday>
            <d5p1:Wednesday>
              <d5p1:CloseAtHour>0</d5p1:CloseAtHour>
              <d5p1:CloseAtMinute>0</d5p1:CloseAtMinute>
              <d5p1:OpenAtHour>0</d5p1:OpenAtHour>
              <d5p1:OpenAtMinute>0</d5p1:OpenAtMinute>
            </d5p1:Wednesday>
          </d5p1:Weekly>
        </d2p1:OpeningHours>
        <d2p1:OrganizationNumber>String</d2p1:OrganizationNumber>
        <d2p1:OutdoorSeating>false</d2p1:OutdoorSeating>
        <d2p1:Overview>String</d2p1:Overview>
        <d2p1:PlaceType>Mall</d2p1:PlaceType>
        <d2p1:PriceMainDish>
          <d2p1:Slug>Value</d2p1:Slug>
          <d2p1:Title>String</d2p1:Title>
        </d2p1:PriceMainDish>
        <d2p1:SaveFoodAndMoney>false</d2p1:SaveFoodAndMoney>
        <d2p1:TimeZoneDto xmlns:d5p1="http://schemas.datacontract.org/2004/07/Entities.Common">
          <d5p1:BaseUtcOffset>PT0S</d5p1:BaseUtcOffset>
          <d5p1:DaylightName>String</d5p1:DaylightName>
          <d5p1:DisplayName>String</d5p1:DisplayName>
          <d5p1:Id>String</d5p1:Id>
          <d5p1:StandardName>String</d5p1:StandardName>
          <d5p1:SupportsDaylightSavingTime>false</d5p1:SupportsDaylightSavingTime>
        </d2p1:TimeZoneDto>
        <d2p1:WearPriceProfiles>
          <d2p1:WearPriceProfileEsDto>
            <d2p1:Label>String</d2p1:Label>
            <d2p1:Slug>String</d2p1:Slug>
          </d2p1:WearPriceProfileEsDto>
        </d2p1:WearPriceProfiles>
        <d2p1:WheelchairAccessible>false</d2p1:WheelchairAccessible>
        <d2p1:Wifi>false</d2p1:Wifi>
      </d2p1:Place>
      <d2p1:PublishAt xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </d2p1:PublishAt>
      <d2p1:StarredCount>0</d2p1:StarredCount>
      <d2p1:StartAt xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </d2p1:StartAt>
      <d2p1:StopAt xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </d2p1:StopAt>
      <d2p1:Title>String</d2p1:Title>
    </d2p1:AdMessageDto>
  </DraftAdMessages>
</GetAdMessageDraftsResponse>