| GET | /v1/coverage/policies/templates |
|---|
<?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 CoverageRingDef implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Key=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Sub=null,
/** @var int|null */
public ?int $WaitMinutes=null,
/** @var bool|null */
public ?bool $Enabled=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Key'])) $this->Key = $o['Key'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Sub'])) $this->Sub = $o['Sub'];
if (isset($o['WaitMinutes'])) $this->WaitMinutes = $o['WaitMinutes'];
if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Key)) $o['Key'] = $this->Key;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Sub)) $o['Sub'] = $this->Sub;
if (isset($this->WaitMinutes)) $o['WaitMinutes'] = $this->WaitMinutes;
if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
return empty($o) ? new class(){} : $o;
}
}
class CoveragePolicyPrefs implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $AssignmentMode=null,
/** @var int */
public int $RestHours=0,
/** @var int */
public int $OtThresholdHours=0,
/** @var int */
public int $RingWaitMinutes=0,
/** @var string|null */
public ?string $QuietStart=null,
/** @var string|null */
public ?string $QuietEnd=null,
/** @var bool|null */
public ?bool $RescheduleAllowed=null,
/** @var string|null */
public ?string $QuietMode=null,
/** @var array<CoverageRingDef>|null */
public ?array $Rings=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AssignmentMode'])) $this->AssignmentMode = $o['AssignmentMode'];
if (isset($o['RestHours'])) $this->RestHours = $o['RestHours'];
if (isset($o['OtThresholdHours'])) $this->OtThresholdHours = $o['OtThresholdHours'];
if (isset($o['RingWaitMinutes'])) $this->RingWaitMinutes = $o['RingWaitMinutes'];
if (isset($o['QuietStart'])) $this->QuietStart = $o['QuietStart'];
if (isset($o['QuietEnd'])) $this->QuietEnd = $o['QuietEnd'];
if (isset($o['RescheduleAllowed'])) $this->RescheduleAllowed = $o['RescheduleAllowed'];
if (isset($o['QuietMode'])) $this->QuietMode = $o['QuietMode'];
if (isset($o['Rings'])) $this->Rings = JsonConverters::fromArray('CoverageRingDef', $o['Rings']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AssignmentMode)) $o['AssignmentMode'] = $this->AssignmentMode;
if (isset($this->RestHours)) $o['RestHours'] = $this->RestHours;
if (isset($this->OtThresholdHours)) $o['OtThresholdHours'] = $this->OtThresholdHours;
if (isset($this->RingWaitMinutes)) $o['RingWaitMinutes'] = $this->RingWaitMinutes;
if (isset($this->QuietStart)) $o['QuietStart'] = $this->QuietStart;
if (isset($this->QuietEnd)) $o['QuietEnd'] = $this->QuietEnd;
if (isset($this->RescheduleAllowed)) $o['RescheduleAllowed'] = $this->RescheduleAllowed;
if (isset($this->QuietMode)) $o['QuietMode'] = $this->QuietMode;
if (isset($this->Rings)) $o['Rings'] = JsonConverters::toArray('CoverageRingDef', $this->Rings);
return empty($o) ? new class(){} : $o;
}
}
class CoverageRuleDocSection implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $H=null,
/** @var string|null */
public ?string $T=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['H'])) $this->H = $o['H'];
if (isset($o['T'])) $this->T = $o['T'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->H)) $o['H'] = $this->H;
if (isset($this->T)) $o['T'] = $this->T;
return empty($o) ? new class(){} : $o;
}
}
class CoverageRuleTuneOption implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Sub=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Sub'])) $this->Sub = $o['Sub'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Sub)) $o['Sub'] = $this->Sub;
return empty($o) ? new class(){} : $o;
}
}
class CoverageRuleTune implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Intro=null,
/** @var array<CoverageRuleTuneOption>|null */
public ?array $Options=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Intro'])) $this->Intro = $o['Intro'];
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('CoverageRuleTuneOption', $o['Options']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Intro)) $o['Intro'] = $this->Intro;
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('CoverageRuleTuneOption', $this->Options);
return empty($o) ? new class(){} : $o;
}
}
class CoverageRuleDef implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $RuleId=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Demand=null,
/** @var string|null */
public ?string $SourcePolicyName=null,
/** @var string|null */
public ?string $CascadeLevel=null,
/** @var string|null */
public ?string $Why=null,
/** @var string|null */
public ?string $Change=null,
/** @var string|null */
public ?string $OverrideWho=null,
/** @var string|null */
public ?string $OverrideConsequence=null,
/** @var string|null */
public ?string $NoNote=null,
/** @var array<string,string>|null */
public ?array $Params=null,
/** @var array<CoverageRuleDocSection>|null */
public ?array $Doc=null,
/** @var CoverageRuleTune|null */
public ?CoverageRuleTune $Tune=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RuleId'])) $this->RuleId = $o['RuleId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Demand'])) $this->Demand = $o['Demand'];
if (isset($o['SourcePolicyName'])) $this->SourcePolicyName = $o['SourcePolicyName'];
if (isset($o['CascadeLevel'])) $this->CascadeLevel = $o['CascadeLevel'];
if (isset($o['Why'])) $this->Why = $o['Why'];
if (isset($o['Change'])) $this->Change = $o['Change'];
if (isset($o['OverrideWho'])) $this->OverrideWho = $o['OverrideWho'];
if (isset($o['OverrideConsequence'])) $this->OverrideConsequence = $o['OverrideConsequence'];
if (isset($o['NoNote'])) $this->NoNote = $o['NoNote'];
if (isset($o['Params'])) $this->Params = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Params']);
if (isset($o['Doc'])) $this->Doc = JsonConverters::fromArray('CoverageRuleDocSection', $o['Doc']);
if (isset($o['Tune'])) $this->Tune = JsonConverters::from('CoverageRuleTune', $o['Tune']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RuleId)) $o['RuleId'] = $this->RuleId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Demand)) $o['Demand'] = $this->Demand;
if (isset($this->SourcePolicyName)) $o['SourcePolicyName'] = $this->SourcePolicyName;
if (isset($this->CascadeLevel)) $o['CascadeLevel'] = $this->CascadeLevel;
if (isset($this->Why)) $o['Why'] = $this->Why;
if (isset($this->Change)) $o['Change'] = $this->Change;
if (isset($this->OverrideWho)) $o['OverrideWho'] = $this->OverrideWho;
if (isset($this->OverrideConsequence)) $o['OverrideConsequence'] = $this->OverrideConsequence;
if (isset($this->NoNote)) $o['NoNote'] = $this->NoNote;
if (isset($this->Params)) $o['Params'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Params);
if (isset($this->Doc)) $o['Doc'] = JsonConverters::toArray('CoverageRuleDocSection', $this->Doc);
if (isset($this->Tune)) $o['Tune'] = JsonConverters::to('CoverageRuleTune', $this->Tune);
return empty($o) ? new class(){} : $o;
}
}
class CoveragePolicyDoc implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Intro=null,
/** @var string|null */
public ?string $LockLine=null,
/** @var string|null */
public ?string $TemplateName=null,
/** @var CoveragePolicyPrefs|null */
public ?CoveragePolicyPrefs $Prefs=null,
/** @var array<CoverageRuleDef>|null */
public ?array $Rules=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Intro'])) $this->Intro = $o['Intro'];
if (isset($o['LockLine'])) $this->LockLine = $o['LockLine'];
if (isset($o['TemplateName'])) $this->TemplateName = $o['TemplateName'];
if (isset($o['Prefs'])) $this->Prefs = JsonConverters::from('CoveragePolicyPrefs', $o['Prefs']);
if (isset($o['Rules'])) $this->Rules = JsonConverters::fromArray('CoverageRuleDef', $o['Rules']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Intro)) $o['Intro'] = $this->Intro;
if (isset($this->LockLine)) $o['LockLine'] = $this->LockLine;
if (isset($this->TemplateName)) $o['TemplateName'] = $this->TemplateName;
if (isset($this->Prefs)) $o['Prefs'] = JsonConverters::to('CoveragePolicyPrefs', $this->Prefs);
if (isset($this->Rules)) $o['Rules'] = JsonConverters::toArray('CoverageRuleDef', $this->Rules);
return empty($o) ? new class(){} : $o;
}
}
class CoverageTemplateInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Key=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Sub=null,
/** @var CoveragePolicyDoc|null */
public ?CoveragePolicyDoc $Doc=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Key'])) $this->Key = $o['Key'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Sub'])) $this->Sub = $o['Sub'];
if (isset($o['Doc'])) $this->Doc = JsonConverters::from('CoveragePolicyDoc', $o['Doc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Key)) $o['Key'] = $this->Key;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Sub)) $o['Sub'] = $this->Sub;
if (isset($this->Doc)) $o['Doc'] = JsonConverters::to('CoveragePolicyDoc', $this->Doc);
return empty($o) ? new class(){} : $o;
}
}
class CoverageTemplatesResponse implements JsonSerializable
{
public function __construct(
/** @var array<CoverageTemplateInfo>|null */
public ?array $Templates=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Templates'])) $this->Templates = JsonConverters::fromArray('CoverageTemplateInfo', $o['Templates']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Templates)) $o['Templates'] = JsonConverters::toArray('CoverageTemplateInfo', $this->Templates);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class CoverageTemplatesRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP CoverageTemplatesRequest 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/policies/templates HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Templates":[{"Key":"String","Name":"String","Sub":"String","Doc":{"Intro":"String","LockLine":"String","TemplateName":"String","Prefs":{"AssignmentMode":"String","RestHours":0,"OtThresholdHours":0,"RingWaitMinutes":0,"QuietStart":"String","QuietEnd":"String","RescheduleAllowed":false,"QuietMode":"String","Rings":[{"Key":"String","Label":"String","Sub":"String","WaitMinutes":0,"Enabled":false}]},"Rules":[{"RuleId":"String","Name":"String","Kind":"String","Demand":"String","SourcePolicyName":"String","CascadeLevel":"String","Why":"String","Change":"String","OverrideWho":"String","OverrideConsequence":"String","NoNote":"String","Params":{"String":"String"},"Doc":[{"H":"String","T":"String"}],"Tune":{"Intro":"String","Options":[{"Label":"String","Sub":"String"}]}}]}}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}