ConsumerApi

<back to all web services

GetSavedSearchesRequest

Consumer
Requires Authentication
Required role:Consumer
The following routes are available for this service:
GET/searches/GetSavedSearches
<?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};


enum Parking : string
{
    case StreetParking = 'StreetParking';
    case ParkingGarageNearby = 'ParkingGarageNearby';
}

enum PaymentOption : string
{
    case Visa = 'Visa';
    case MasterCard = 'MasterCard';
    case AmericanExpress = 'AmericanExpress';
    case Diners = 'Diners';
    case Vipps = 'Vipps';
}

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

enum DayOfWeek : string
{
    case Sunday = 'Sunday';
    case Monday = 'Monday';
    case Tuesday = 'Tuesday';
    case Wednesday = 'Wednesday';
    case Thursday = 'Thursday';
    case Friday = 'Friday';
    case Saturday = 'Saturday';
}

class OpenAtTimeDto implements JsonSerializable
{
    public function __construct(
        /** @var DayOfWeek|null */
        public ?DayOfWeek $weekDay=null,
        /** @var int */
        public int $hour=0,
        /** @var int */
        public int $minute=0
    ) {
    }

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

class CategoryDto 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
    ) {
    }

    /** @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'];
    }
    
    /** @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;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['slug'])) $this->slug = $o['slug'];
        if (isset($o['title'])) $this->title = $o['title'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->slug)) $o['slug'] = $this->slug;
        if (isset($this->title)) $o['title'] = $this->title;
        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 CuisineEsDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $label='',
        /** @var string */
        public string $slug=''
    ) {
    }

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

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

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

class ParkingApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $label='',
        /** @var Parking|null */
        public ?Parking $slug=null
    ) {
    }

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

class PaymentOptionApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $label='',
        /** @var PaymentOption|null */
        public ?PaymentOption $slug=null
    ) {
    }

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

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 EatingSuitabilityApiDto implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $label='',
        /** @var string */
        public string $slug=''
    ) {
    }

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['label'])) $this->label = $o['label'];
        if (isset($o['slug'])) $this->slug = $o['slug'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->label)) $o['label'] = $this->label;
        if (isset($this->slug)) $o['slug'] = $this->slug;
        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;
    }
}

PHP GetSavedSearchesRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /searches/GetSavedSearches HTTP/1.1 
Host: unstable-consumer-api.brovs.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	searches: 
	[
		{
			id: 0,
			name: String,
			filter: 
			{
				term: String,
				placeGuid: 00000000-0000-0000-0000-000000000000,
				adMessageGuid: 00000000-0000-0000-0000-000000000000,
				categoryAbsoluteSlugs: 
				[
					String
				],
				barSpecialitySlugs: 
				[
					String
				],
				barTypeSlugs: 
				[
					String
				],
				brandNames: 
				[
					String
				],
				cuisineSlugs: 
				[
					String
				],
				mealTypeSlugs: 
				[
					String
				],
				parking: 
				[
					StreetParking
				],
				paymentOptions: 
				[
					Visa
				],
				priceMainDishes: 
				[
					Value
				],
				eatingSuitabilitySlugs: 
				[
					String
				],
				takeAwaySlugs: 
				[
					String
				],
				wearPriceProfileSlugs: 
				[
					String
				],
				wheelChairAccessible: False,
				wifi: False,
				outdoorSeating: False,
				saveFoodAndMoney: False,
				openAt: 
				{
					weekDay: Sunday,
					hour: 0,
					minute: 0
				}
			},
			location: 
			{
				longitude: 0,
				latitude: 0,
				searchRadiusInKm: 0
			},
			filterDetails: 
			{
				categories: 
				[
					{
						name: String,
						slug: String,
						absoluteSlug: String,
						imageUrl: String,
						allImageUrl: String,
						iconImageUrl: String,
						position: 0
					}
				],
				barSpecialities: 
				[
					{
						slug: String,
						title: String
					}
				],
				barTypes: 
				[
					{
						slug: String,
						title: String
					}
				],
				brands: 
				[
					{
						name: String
					}
				],
				cuisines: 
				[
					{
						label: String,
						slug: String
					}
				],
				mealTypes: 
				[
					{
						label: String,
						slug: String
					}
				],
				parking: 
				[
					{
						label: String,
						slug: StreetParking
					}
				],
				paymentOptions: 
				[
					{
						label: String,
						slug: Visa
					}
				],
				priceMainDishes: 
				[
					{
						title: String,
						slug: Value
					}
				],
				eatingSuitability: 
				[
					{
						label: String,
						slug: String
					}
				],
				takeAways: 
				[
					{
						label: String,
						slug: String
					}
				],
				wearPriceProfiles: 
				[
					{
						slug: String,
						label: String
					}
				],
				rootCategories: 
				[
					{
						name: String,
						slug: String,
						absoluteSlug: String,
						imageUrl: String,
						allImageUrl: String,
						iconImageUrl: String,
						position: 0
					}
				]
			},
			createdAt: 0001-01-01T00:00:00.0000000+00:00,
			updatedAt: 0001-01-01T00:00:00.0000000+00:00
		}
	]
}