BokaMera.API.Host

<back to all web services

ReplayVossErrorLog

Requires Authentication
Required role:superadmin
The following routes are available for this service:
POST/voss/errorlog/{Id}/replayRe-enqueue the Voss operation captured by a logged failure
<?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 VossErrorLogQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $CompanyId=null,
        /** @var int */
        public int $TypeId=0,
        /** @var string */
        public string $TypeName='',
        /** @var int */
        public int $Source=0,
        /** @var string */
        public string $SourceName='',
        /** @var string */
        public string $Comments='',
        /** @var string */
        public string $MetaData='',
        /** @var string */
        public string $QueueName='',
        /** @var string */
        public string $MessageType='',
        /** @var int|null */
        public ?int $DeliveryCount=null,
        /** @var string */
        public string $DeadLetterReason='',
        /** @var bool|null */
        public ?bool $Resolved=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['TypeId'])) $this->TypeId = $o['TypeId'];
        if (isset($o['TypeName'])) $this->TypeName = $o['TypeName'];
        if (isset($o['Source'])) $this->Source = $o['Source'];
        if (isset($o['SourceName'])) $this->SourceName = $o['SourceName'];
        if (isset($o['Comments'])) $this->Comments = $o['Comments'];
        if (isset($o['MetaData'])) $this->MetaData = $o['MetaData'];
        if (isset($o['QueueName'])) $this->QueueName = $o['QueueName'];
        if (isset($o['MessageType'])) $this->MessageType = $o['MessageType'];
        if (isset($o['DeliveryCount'])) $this->DeliveryCount = $o['DeliveryCount'];
        if (isset($o['DeadLetterReason'])) $this->DeadLetterReason = $o['DeadLetterReason'];
        if (isset($o['Resolved'])) $this->Resolved = $o['Resolved'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->TypeId)) $o['TypeId'] = $this->TypeId;
        if (isset($this->TypeName)) $o['TypeName'] = $this->TypeName;
        if (isset($this->Source)) $o['Source'] = $this->Source;
        if (isset($this->SourceName)) $o['SourceName'] = $this->SourceName;
        if (isset($this->Comments)) $o['Comments'] = $this->Comments;
        if (isset($this->MetaData)) $o['MetaData'] = $this->MetaData;
        if (isset($this->QueueName)) $o['QueueName'] = $this->QueueName;
        if (isset($this->MessageType)) $o['MessageType'] = $this->MessageType;
        if (isset($this->DeliveryCount)) $o['DeliveryCount'] = $this->DeliveryCount;
        if (isset($this->DeadLetterReason)) $o['DeadLetterReason'] = $this->DeadLetterReason;
        if (isset($this->Resolved)) $o['Resolved'] = $this->Resolved;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class ReplayVossErrorLog implements JsonSerializable
{
    public function __construct(
        /** @description VossErrorLog id to replay */
        // @ApiMember(Description="VossErrorLog id to replay", IsRequired=true)
        /** @var int */
        public int $Id=0
    ) {
    }

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

PHP ReplayVossErrorLog DTOs

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

HTTP + CSV

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

POST /voss/errorlog/{Id}/replay HTTP/1.1 
Host: api-staging.bookmore.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Id":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","TypeId":0,"TypeName":"String","Source":0,"SourceName":"String","Comments":"String","MetaData":"String","QueueName":"String","MessageType":"String","DeliveryCount":0,"DeadLetterReason":"String","Resolved":false}