BusinessApi

<back to all web services

PlaceUpdateRequest

Business
Requires Authentication
Required role:Business
The following routes are available for this service:
POST/place/update
<?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 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';
}

PHP PlaceUpdateRequest 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.

POST /place/update HTTP/1.1 
Host: business-api.brovs.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PlaceUpdateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BusinessApi.Dto">
  <Email>String</Email>
  <Latitude>0</Latitude>
  <Longitude>0</Longitude>
  <Name>String</Name>
  <OpeningHours xmlns:d2p1="http://schemas.datacontract.org/2004/07/Entities.Common">
    <d2p1:Weekly>
      <d2p1:Friday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Friday>
      <d2p1:Monday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Monday>
      <d2p1:Saturday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Saturday>
      <d2p1:Sunday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Sunday>
      <d2p1:Thursday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Thursday>
      <d2p1:Tuesday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Tuesday>
      <d2p1:Wednesday>
        <d2p1:CloseAtHour>0</d2p1:CloseAtHour>
        <d2p1:CloseAtMinute>0</d2p1:CloseAtMinute>
        <d2p1:OpenAtHour>0</d2p1:OpenAtHour>
        <d2p1:OpenAtMinute>0</d2p1:OpenAtMinute>
      </d2p1:Wednesday>
    </d2p1:Weekly>
  </OpeningHours>
  <OutdoorSeating>false</OutdoorSeating>
  <Overview>String</Overview>
  <Parking xmlns:d2p1="http://schemas.datacontract.org/2004/07/Entities.Database">
    <d2p1:Parking>StreetParking</d2p1:Parking>
  </Parking>
  <PaymentOptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/Entities.Database">
    <d2p1:PaymentOption>Visa</d2p1:PaymentOption>
  </PaymentOptions>
  <Phone>String</Phone>
  <PlaceId>0</PlaceId>
  <PostalCode>String</PostalCode>
  <Region>String</Region>
  <SaveFoodAndMoney>false</SaveFoodAndMoney>
  <Street>String</Street>
  <WebShop>String</WebShop>
  <Website>String</Website>
  <WheelChairAccessible>false</WheelChairAccessible>
  <Wifi>false</Wifi>
</PlaceUpdateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PlaceUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BusinessApi.Dto">
  <PlaceId>0</PlaceId>
</PlaceUpdateResponse>