BokaMera.API.Host

<back to all web services

GetAllBookingQueueForUser

Requires Authentication
The following routes are available for this service:
GET/bookinguserqueue/userGet all queue items for the logged in user
<?php namespace dtos;

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 BookingUserQueuePriceResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CompanyId='',
        /** @var int */
        public int $Id=0,
        /** @var int */
        public int $BookingUserQueueId=0,
        /** @var int|null */
        public ?int $ServicePriceId=null,
        /** @var int|null */
        public ?int $Quantity=null
    ) {
    }

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

class GroupBookingSettings implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $Min=0,
        /** @var int */
        public int $Max=0
    ) {
    }

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

class MultipleResourceSettings implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $Min=0,
        /** @var int */
        public int $Max=0
    ) {
    }

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

class ServiceInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var int|null */
        public ?int $LengthInMinutes=null,
        /** @var int */
        public int $MaxNumberOfSpotsPerBooking=0,
        /** @var GroupBookingSettings|null */
        public ?GroupBookingSettings $GroupBooking=null,
        /** @var MultipleResourceSettings|null */
        public ?MultipleResourceSettings $MultipleResource=null,
        /** @var bool|null */
        public ?bool $IsGroupBooking=null,
        /** @var bool|null */
        public ?bool $IsPaymentEnabled=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = JsonConverters::from('string', $o['ImageUrl']);
        if (isset($o['LengthInMinutes'])) $this->LengthInMinutes = $o['LengthInMinutes'];
        if (isset($o['MaxNumberOfSpotsPerBooking'])) $this->MaxNumberOfSpotsPerBooking = $o['MaxNumberOfSpotsPerBooking'];
        if (isset($o['GroupBooking'])) $this->GroupBooking = JsonConverters::from('GroupBookingSettings', $o['GroupBooking']);
        if (isset($o['MultipleResource'])) $this->MultipleResource = JsonConverters::from('MultipleResourceSettings', $o['MultipleResource']);
        if (isset($o['IsGroupBooking'])) $this->IsGroupBooking = $o['IsGroupBooking'];
        if (isset($o['IsPaymentEnabled'])) $this->IsPaymentEnabled = $o['IsPaymentEnabled'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = JsonConverters::to('string', $this->ImageUrl);
        if (isset($this->LengthInMinutes)) $o['LengthInMinutes'] = $this->LengthInMinutes;
        if (isset($this->MaxNumberOfSpotsPerBooking)) $o['MaxNumberOfSpotsPerBooking'] = $this->MaxNumberOfSpotsPerBooking;
        if (isset($this->GroupBooking)) $o['GroupBooking'] = JsonConverters::to('GroupBookingSettings', $this->GroupBooking);
        if (isset($this->MultipleResource)) $o['MultipleResource'] = JsonConverters::to('MultipleResourceSettings', $this->MultipleResource);
        if (isset($this->IsGroupBooking)) $o['IsGroupBooking'] = $this->IsGroupBooking;
        if (isset($this->IsPaymentEnabled)) $o['IsPaymentEnabled'] = $this->IsPaymentEnabled;
        return empty($o) ? new class(){} : $o;
    }
}

class CompanyInfoResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $LogoType=null,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Street1=null,
        /** @var string|null */
        public ?string $Street2=null,
        /** @var string|null */
        public ?string $ZipCode=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $CountryId=null,
        /** @var string|null */
        public ?string $Longitude=null,
        /** @var string|null */
        public ?string $Latitude=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $HomePage=null,
        /** @var string|null */
        public ?string $SitePath=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['LogoType'])) $this->LogoType = JsonConverters::from('string', $o['LogoType']);
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Street1'])) $this->Street1 = $o['Street1'];
        if (isset($o['Street2'])) $this->Street2 = $o['Street2'];
        if (isset($o['ZipCode'])) $this->ZipCode = $o['ZipCode'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['CountryId'])) $this->CountryId = $o['CountryId'];
        if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
        if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['HomePage'])) $this->HomePage = $o['HomePage'];
        if (isset($o['SitePath'])) $this->SitePath = $o['SitePath'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->LogoType)) $o['LogoType'] = JsonConverters::to('string', $this->LogoType);
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Street1)) $o['Street1'] = $this->Street1;
        if (isset($this->Street2)) $o['Street2'] = $this->Street2;
        if (isset($this->ZipCode)) $o['ZipCode'] = $this->ZipCode;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->CountryId)) $o['CountryId'] = $this->CountryId;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->HomePage)) $o['HomePage'] = $this->HomePage;
        if (isset($this->SitePath)) $o['SitePath'] = $this->SitePath;
        return empty($o) ? new class(){} : $o;
    }
}

class BookingUserQueueItemResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $BookingUserQueueId=0,
        /** @var string */
        public string $CompanyId='',
        /** @var string */
        public string $CustomerId='',
        /** @var int */
        public int $ServiceId=0,
        /** @var DateTime */
        public DateTime $From=new DateTime(),
        /** @var DateTime */
        public DateTime $To=new DateTime(),
        /** @var int */
        public int $StatusCode=0,
        /** @var string|null */
        public ?string $StatusName=null,
        /** @var DateTime|null */
        public ?DateTime $SendConfirmationTime=null,
        /** @var array<BookingUserQueuePriceResponse>|null */
        public ?array $Quantities=null,
        /** @var ServiceInfoResponse|null */
        public ?ServiceInfoResponse $Service=null,
        /** @var CompanyInfoResponse|null */
        public ?CompanyInfoResponse $Company=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BookingUserQueueId'])) $this->BookingUserQueueId = $o['BookingUserQueueId'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['ServiceId'])) $this->ServiceId = $o['ServiceId'];
        if (isset($o['From'])) $this->From = JsonConverters::from('DateTime', $o['From']);
        if (isset($o['To'])) $this->To = JsonConverters::from('DateTime', $o['To']);
        if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
        if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
        if (isset($o['SendConfirmationTime'])) $this->SendConfirmationTime = JsonConverters::from('DateTime', $o['SendConfirmationTime']);
        if (isset($o['Quantities'])) $this->Quantities = JsonConverters::fromArray('BookingUserQueuePriceResponse', $o['Quantities']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('ServiceInfoResponse', $o['Service']);
        if (isset($o['Company'])) $this->Company = JsonConverters::from('CompanyInfoResponse', $o['Company']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BookingUserQueueId)) $o['BookingUserQueueId'] = $this->BookingUserQueueId;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->ServiceId)) $o['ServiceId'] = $this->ServiceId;
        if (isset($this->From)) $o['From'] = JsonConverters::to('DateTime', $this->From);
        if (isset($this->To)) $o['To'] = JsonConverters::to('DateTime', $this->To);
        if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
        if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
        if (isset($this->SendConfirmationTime)) $o['SendConfirmationTime'] = JsonConverters::to('DateTime', $this->SendConfirmationTime);
        if (isset($this->Quantities)) $o['Quantities'] = JsonConverters::toArray('BookingUserQueuePriceResponse', $this->Quantities);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('ServiceInfoResponse', $this->Service);
        if (isset($this->Company)) $o['Company'] = JsonConverters::to('CompanyInfoResponse', $this->Company);
        return empty($o) ? new class(){} : $o;
    }
}

class GetAllBookingQueueForUserResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<BookingUserQueueItemResponse>|null */
        public ?array $BookingUserQueueResponseList=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class GetAllBookingQueueForUser implements JsonSerializable
{
    public function __construct(
        /** @description The user id for your profile. If not set it will set it automatically from your session */
        // @ApiMember(Description="The user id for your profile. If not set it will set it automatically from your session")
        /** @var string|null */
        public ?string $UserId=null,

        /** @var DateTime|null */
        public ?DateTime $DateStart=null,
        /** @var DateTime|null */
        public ?DateTime $DateEnd=null,
        /** @description If you want to include the service information for the booking */
        // @ApiMember(DataType="boolean", Description="If you want to include the service information for the booking", ParameterType="query")
        /** @var bool|null */
        public ?bool $IncludeServiceInformation=null,

        /** @description If you want to include the company information for the booking */
        // @ApiMember(DataType="boolean", Description="If you want to include the company information for the booking", ParameterType="query")
        /** @var bool|null */
        public ?bool $IncludeCompanyInformation=null
    ) {
    }

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

PHP GetAllBookingQueueForUser DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /bookinguserqueue/user HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"BookingUserQueueResponseList":[{"BookingUserQueueId":0,"ServiceId":0,"StatusCode":0,"StatusName":"String","SendConfirmationTime":"0001-01-01T00:00:00","Quantities":[{"Id":0,"BookingUserQueueId":0,"ServicePriceId":0,"Quantity":0}],"Service":{"Id":0,"Name":"String","Description":"String","LengthInMinutes":0,"MaxNumberOfSpotsPerBooking":0,"GroupBooking":{"Active":false,"Min":0,"Max":0},"MultipleResource":{"Active":false,"Min":0,"Max":0},"IsGroupBooking":false,"IsPaymentEnabled":false},"Company":{"Name":"String","Category":"String","Street1":"String","Street2":"String","ZipCode":"String","City":"String","CountryId":"String","Longitude":"String","Latitude":"String","Phone":"String","Email":"String","HomePage":"String","SitePath":"String"}}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}