| Requires any of the permissions: | DISPATCH:HAUL:MANAGE, DISPATCH:JOB:MANAGE, DISPATCH:ONDEMAND:MANAGE |
| POST,OPTIONS | /v1/dispatch/holds/suggestion/dismiss |
|---|
<?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 DispatchHoldView implements JsonSerializable
{
public function __construct(
/** @var int */
public int $HoldId=0,
/** @var string|null */
public ?string $Code=null,
/** @var string|null */
public ?string $ScopeKind=null,
/** @var string|null */
public ?string $ScopeKey=null,
/** @var string|null */
public ?string $ScopeLabel=null,
/** @var string|null */
public ?string $Reason=null,
/** @var string|null */
public ?string $Note=null,
/** @var DateTime */
public DateTime $StartUtc=new DateTime(),
/** @var DateTime */
public DateTime $EndUtc=new DateTime(),
/** @var string|null */
public ?string $Source=null,
/** @var string|null */
public ?string $IncidentRef=null,
/** @var DateTime|null */
public ?DateTime $LiftedUtc=null,
/** @var string|null */
public ?string $LiftedBy=null,
/** @var DateTime|null */
public ?DateTime $CreatedUtc=null,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var string|null */
public ?string $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['HoldId'])) $this->HoldId = $o['HoldId'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['ScopeKind'])) $this->ScopeKind = $o['ScopeKind'];
if (isset($o['ScopeKey'])) $this->ScopeKey = $o['ScopeKey'];
if (isset($o['ScopeLabel'])) $this->ScopeLabel = $o['ScopeLabel'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['StartUtc'])) $this->StartUtc = JsonConverters::from('DateTime', $o['StartUtc']);
if (isset($o['EndUtc'])) $this->EndUtc = JsonConverters::from('DateTime', $o['EndUtc']);
if (isset($o['Source'])) $this->Source = $o['Source'];
if (isset($o['IncidentRef'])) $this->IncidentRef = $o['IncidentRef'];
if (isset($o['LiftedUtc'])) $this->LiftedUtc = JsonConverters::from('DateTime', $o['LiftedUtc']);
if (isset($o['LiftedBy'])) $this->LiftedBy = $o['LiftedBy'];
if (isset($o['CreatedUtc'])) $this->CreatedUtc = JsonConverters::from('DateTime', $o['CreatedUtc']);
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['Status'])) $this->Status = $o['Status'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->HoldId)) $o['HoldId'] = $this->HoldId;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->ScopeKind)) $o['ScopeKind'] = $this->ScopeKind;
if (isset($this->ScopeKey)) $o['ScopeKey'] = $this->ScopeKey;
if (isset($this->ScopeLabel)) $o['ScopeLabel'] = $this->ScopeLabel;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->StartUtc)) $o['StartUtc'] = JsonConverters::to('DateTime', $this->StartUtc);
if (isset($this->EndUtc)) $o['EndUtc'] = JsonConverters::to('DateTime', $this->EndUtc);
if (isset($this->Source)) $o['Source'] = $this->Source;
if (isset($this->IncidentRef)) $o['IncidentRef'] = $this->IncidentRef;
if (isset($this->LiftedUtc)) $o['LiftedUtc'] = JsonConverters::to('DateTime', $this->LiftedUtc);
if (isset($this->LiftedBy)) $o['LiftedBy'] = $this->LiftedBy;
if (isset($this->CreatedUtc)) $o['CreatedUtc'] = JsonConverters::to('DateTime', $this->CreatedUtc);
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->Status)) $o['Status'] = $this->Status;
return empty($o) ? new class(){} : $o;
}
}
class DispatchOfflineWindowView implements JsonSerializable
{
public function __construct(
/** @var int */
public int $OfflineWindowId=0,
/** @var string|null */
public ?string $FromHour=null,
/** @var string|null */
public ?string $ToHour=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['OfflineWindowId'])) $this->OfflineWindowId = $o['OfflineWindowId'];
if (isset($o['FromHour'])) $this->FromHour = $o['FromHour'];
if (isset($o['ToHour'])) $this->ToHour = $o['ToHour'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->OfflineWindowId)) $o['OfflineWindowId'] = $this->OfflineWindowId;
if (isset($this->FromHour)) $o['FromHour'] = $this->FromHour;
if (isset($this->ToHour)) $o['ToHour'] = $this->ToHour;
return empty($o) ? new class(){} : $o;
}
}
class DispatchHoldScopeView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Key=null,
/** @var string|null */
public ?string $Label=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Key'])) $this->Key = $o['Key'];
if (isset($o['Label'])) $this->Label = $o['Label'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Key)) $o['Key'] = $this->Key;
if (isset($this->Label)) $o['Label'] = $this->Label;
return empty($o) ? new class(){} : $o;
}
}
class DispatchHoldSuggestionView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ForDate=null,
/** @var string|null */
public ?string $Kind=null,
/** @var int */
public int $Severity=0,
/** @var string|null */
public ?string $Headline=null,
/** @var string|null */
public ?string $DayLabel=null,
/** @var string|null */
public ?string $ScopeKind=null,
/** @var string|null */
public ?string $ScopeLabel=null,
/** @var string|null */
public ?string $Reason=null,
/** @var DateTime */
public DateTime $StartUtc=new DateTime(),
/** @var DateTime */
public DateTime $EndUtc=new DateTime(),
/** @var string|null */
public ?string $WindowLocal=null,
/** @var string|null */
public ?string $Text=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ForDate'])) $this->ForDate = $o['ForDate'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Severity'])) $this->Severity = $o['Severity'];
if (isset($o['Headline'])) $this->Headline = $o['Headline'];
if (isset($o['DayLabel'])) $this->DayLabel = $o['DayLabel'];
if (isset($o['ScopeKind'])) $this->ScopeKind = $o['ScopeKind'];
if (isset($o['ScopeLabel'])) $this->ScopeLabel = $o['ScopeLabel'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['StartUtc'])) $this->StartUtc = JsonConverters::from('DateTime', $o['StartUtc']);
if (isset($o['EndUtc'])) $this->EndUtc = JsonConverters::from('DateTime', $o['EndUtc']);
if (isset($o['WindowLocal'])) $this->WindowLocal = $o['WindowLocal'];
if (isset($o['Text'])) $this->Text = $o['Text'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ForDate)) $o['ForDate'] = $this->ForDate;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Severity)) $o['Severity'] = $this->Severity;
if (isset($this->Headline)) $o['Headline'] = $this->Headline;
if (isset($this->DayLabel)) $o['DayLabel'] = $this->DayLabel;
if (isset($this->ScopeKind)) $o['ScopeKind'] = $this->ScopeKind;
if (isset($this->ScopeLabel)) $o['ScopeLabel'] = $this->ScopeLabel;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->StartUtc)) $o['StartUtc'] = JsonConverters::to('DateTime', $this->StartUtc);
if (isset($this->EndUtc)) $o['EndUtc'] = JsonConverters::to('DateTime', $this->EndUtc);
if (isset($this->WindowLocal)) $o['WindowLocal'] = $this->WindowLocal;
if (isset($this->Text)) $o['Text'] = $this->Text;
return empty($o) ? new class(){} : $o;
}
}
class DispatchHoldsResponse implements JsonSerializable
{
public function __construct(
/** @var array<DispatchHoldView>|null */
public ?array $Holds=null,
/** @var array<DispatchOfflineWindowView>|null */
public ?array $Windows=null,
/** @var array<DispatchHoldScopeView>|null */
public ?array $Scopes=null,
/** @var DispatchHoldSuggestionView|null */
public ?DispatchHoldSuggestionView $Suggestion=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Holds'])) $this->Holds = JsonConverters::fromArray('DispatchHoldView', $o['Holds']);
if (isset($o['Windows'])) $this->Windows = JsonConverters::fromArray('DispatchOfflineWindowView', $o['Windows']);
if (isset($o['Scopes'])) $this->Scopes = JsonConverters::fromArray('DispatchHoldScopeView', $o['Scopes']);
if (isset($o['Suggestion'])) $this->Suggestion = JsonConverters::from('DispatchHoldSuggestionView', $o['Suggestion']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Holds)) $o['Holds'] = JsonConverters::toArray('DispatchHoldView', $this->Holds);
if (isset($this->Windows)) $o['Windows'] = JsonConverters::toArray('DispatchOfflineWindowView', $this->Windows);
if (isset($this->Scopes)) $o['Scopes'] = JsonConverters::toArray('DispatchHoldScopeView', $this->Scopes);
if (isset($this->Suggestion)) $o['Suggestion'] = JsonConverters::to('DispatchHoldSuggestionView', $this->Suggestion);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class DispatchHoldSuggestionDismissRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ForDate=null,
/** @var string|null */
public ?string $Kind=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ForDate'])) $this->ForDate = $o['ForDate'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ForDate)) $o['ForDate'] = $this->ForDate;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
return empty($o) ? new class(){} : $o;
}
}
PHP DispatchHoldSuggestionDismissRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dispatch/holds/suggestion/dismiss HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"ForDate":"String","Kind":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Holds":[{"HoldId":0,"Code":"String","ScopeKind":"String","ScopeKey":"String","ScopeLabel":"String","Reason":"String","Note":"String","StartUtc":"0001-01-01T00:00:00.0000000","EndUtc":"0001-01-01T00:00:00.0000000","Source":"String","IncidentRef":"String","LiftedUtc":"0001-01-01T00:00:00.0000000","LiftedBy":"String","CreatedUtc":"0001-01-01T00:00:00.0000000","CreatedBy":"String","Status":"String"}],"Windows":[{"OfflineWindowId":0,"FromHour":"String","ToHour":"String"}],"Scopes":[{"Kind":"String","Key":"String","Label":"String"}],"Suggestion":{"ForDate":"String","Kind":"String","Severity":0,"Headline":"String","DayLabel":"String","ScopeKind":"String","ScopeLabel":"String","Reason":"String","StartUtc":"0001-01-01T00:00:00.0000000","EndUtc":"0001-01-01T00:00:00.0000000","WindowLocal":"String","Text":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}