| DELETE | /v1/c/device/{Id} |
|---|
<?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 CustomerDeviceResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var int */
public int $Devices=0,
/** @var int */
public int $Sent=0,
/** @var bool|null */
public ?bool $PushConfigured=null,
/** @var string|null */
public ?string $Payload=null,
/** @var string|null */
public ?string $Message=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Devices'])) $this->Devices = $o['Devices'];
if (isset($o['Sent'])) $this->Sent = $o['Sent'];
if (isset($o['PushConfigured'])) $this->PushConfigured = $o['PushConfigured'];
if (isset($o['Payload'])) $this->Payload = $o['Payload'];
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Devices)) $o['Devices'] = $this->Devices;
if (isset($this->Sent)) $o['Sent'] = $this->Sent;
if (isset($this->PushConfigured)) $o['PushConfigured'] = $this->PushConfigured;
if (isset($this->Payload)) $o['Payload'] = $this->Payload;
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class CustomerDeviceRevokeRequest implements JsonSerializable
{
public function __construct(
/** @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 CustomerDeviceRevokeRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
DELETE /v1/c/device/{Id} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Id":0,"Devices":0,"Sent":0,"PushConfigured":false,"Payload":"String","Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}