CPU.Notifications

<back to all web services

TwilioError

The following routes are available for this service:
POST/twilioError
<?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 TwilioError implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $accountSid=null,
        /** @var string|null */
        public ?string $sid=null,
        /** @var string|null */
        public ?string $parentAccountSid=null,
        /** @var string|null */
        public ?string $timestamp=null,
        /** @var string|null */
        public ?string $level=null,
        /** @var string|null */
        public ?string $payloadType=null,
        /** @var string|null */
        public ?string $payload=null
    ) {
    }

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

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

POST /twilioError HTTP/1.1 
Host: cpmwebservices-t.clarkpud.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	accountSid: String,
	sid: String,
	parentAccountSid: String,
	timestamp: String,
	level: String,
	payloadType: String,
	payload: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

0