BusinessApi

<back to all web services

SearchPlaceRequest

Business
Requires Authentication
Required role:Consumer
The following routes are available for this service:
GET/place/search
<?php namespace BusinessApi;

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 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';
}

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 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;
    }
}

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

class PriceMainDishDto 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;
    }
}

PHP SearchPlaceRequest 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 /place/search HTTP/1.1 
Host: business-api.brovs.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SearchPlaceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BusinessApi.Dto">
  <Offset>0</Offset>
  <Places>
    <PlaceBasicDto>
      <Address xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:CountryCode>String</d4p1:CountryCode>
        <d4p1:PostalCode>String</d4p1:PostalCode>
        <d4p1:Region>String</d4p1:Region>
        <d4p1:Street>String</d4p1:Street>
      </Address>
      <BusinessId>0</BusinessId>
      <Claimed>false</Claimed>
      <Contact xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:Email>String</d4p1:Email>
        <d4p1:Phone>String</d4p1:Phone>
        <d4p1:WebShop>String</d4p1:WebShop>
        <d4p1:Website>String</d4p1:Website>
      </Contact>
      <CountryCode>String</CountryCode>
      <Floor>String</Floor>
      <Guid>00000000-0000-0000-0000-000000000000</Guid>
      <Id>0</Id>
      <Latitude>0</Latitude>
      <Longitude>0</Longitude>
      <Name>String</Name>
      <OpeningHours xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:Weekly>
          <d4p1:Friday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Friday>
          <d4p1:Monday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Monday>
          <d4p1:Saturday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Saturday>
          <d4p1:Sunday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Sunday>
          <d4p1:Thursday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Thursday>
          <d4p1:Tuesday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Tuesday>
          <d4p1:Wednesday>
            <d4p1:CloseAtHour>0</d4p1:CloseAtHour>
            <d4p1:CloseAtMinute>0</d4p1:CloseAtMinute>
            <d4p1:OpenAtHour>0</d4p1:OpenAtHour>
            <d4p1:OpenAtMinute>0</d4p1:OpenAtMinute>
          </d4p1:Wednesday>
        </d4p1:Weekly>
      </OpeningHours>
      <OrganizationNumber>String</OrganizationNumber>
      <OtherServices>
        <MallOtherServiceDto>
          <Floor>String</Floor>
          <Id>0</Id>
          <ServiceName>String</ServiceName>
        </MallOtherServiceDto>
      </OtherServices>
      <OutdoorSeating>false</OutdoorSeating>
      <Overview>String</Overview>
      <PlaceType>Mall</PlaceType>
      <PriceMainDish xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:Slug>Value</d4p1:Slug>
        <d4p1:Title>String</d4p1:Title>
      </PriceMainDish>
      <SaveFoodAndMoney>false</SaveFoodAndMoney>
      <TimeZoneDto xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
        <d4p1:BaseUtcOffset>PT0S</d4p1:BaseUtcOffset>
        <d4p1:DaylightName>String</d4p1:DaylightName>
        <d4p1:DisplayName>String</d4p1:DisplayName>
        <d4p1:Id>String</d4p1:Id>
        <d4p1:StandardName>String</d4p1:StandardName>
        <d4p1:SupportsDaylightSavingTime>false</d4p1:SupportsDaylightSavingTime>
      </TimeZoneDto>
      <WheelChairAccessible>false</WheelChairAccessible>
      <Wifi>false</Wifi>
    </PlaceBasicDto>
  </Places>
  <Size>0</Size>
  <Total>0</Total>
</SearchPlaceResponse>