| GET,OPTIONS | /v1/coverage/self/certs |
|---|
<?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 CoverageSelfCert implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkerCertificationID=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Scope=null,
/** @var string|null */
public ?string $ExpiryLabel=null,
/** @var int|null */
public ?int $DaysLeft=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkerCertificationID'])) $this->WorkerCertificationID = $o['WorkerCertificationID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Scope'])) $this->Scope = $o['Scope'];
if (isset($o['ExpiryLabel'])) $this->ExpiryLabel = $o['ExpiryLabel'];
if (isset($o['DaysLeft'])) $this->DaysLeft = $o['DaysLeft'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkerCertificationID)) $o['WorkerCertificationID'] = $this->WorkerCertificationID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Scope)) $o['Scope'] = $this->Scope;
if (isset($this->ExpiryLabel)) $o['ExpiryLabel'] = $this->ExpiryLabel;
if (isset($this->DaysLeft)) $o['DaysLeft'] = $this->DaysLeft;
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfCertsResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<CoverageSelfCert>|null */
public ?array $Certs=null,
/** @var array<string>|null */
public ?array $NotYet=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Certs'])) $this->Certs = JsonConverters::fromArray('CoverageSelfCert', $o['Certs']);
if (isset($o['NotYet'])) $this->NotYet = JsonConverters::fromArray('string', $o['NotYet']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Certs)) $o['Certs'] = JsonConverters::toArray('CoverageSelfCert', $this->Certs);
if (isset($this->NotYet)) $o['NotYet'] = JsonConverters::toArray('string', $this->NotYet);
return empty($o) ? new class(){} : $o;
}
}
class CoverageSelfCertsRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP CoverageSelfCertsRequest 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.
GET /v1/coverage/self/certs HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Certs":[{"WorkerCertificationID":0,"Name":"String","Scope":"String","ExpiryLabel":"String","DaysLeft":0}],"NotYet":["String"]}