| GET | /v1/resource-conflicts |
|---|
<?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 ResourceConflictBookingDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Project=null,
/** @var string|null */
public ?string $Job=null,
/** @var string|null */
public ?string $Window=null,
/** @var string|null */
public ?string $Tag=null,
/** @var bool|null */
public ?bool $Hot=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Project'])) $this->Project = $o['Project'];
if (isset($o['Job'])) $this->Job = $o['Job'];
if (isset($o['Window'])) $this->Window = $o['Window'];
if (isset($o['Tag'])) $this->Tag = $o['Tag'];
if (isset($o['Hot'])) $this->Hot = $o['Hot'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Project)) $o['Project'] = $this->Project;
if (isset($this->Job)) $o['Job'] = $this->Job;
if (isset($this->Window)) $o['Window'] = $this->Window;
if (isset($this->Tag)) $o['Tag'] = $this->Tag;
if (isset($this->Hot)) $o['Hot'] = $this->Hot;
return empty($o) ? new class(){} : $o;
}
}
class ResourceConflictOptionDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Note=null,
/** @var bool|null */
public ?bool $Clears=null,
/** @var bool|null */
public ?bool $Recommended=null,
/** @var string|null */
public ?string $Why=null,
/** @var string|null */
public ?string $ActionJson=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['Clears'])) $this->Clears = $o['Clears'];
if (isset($o['Recommended'])) $this->Recommended = $o['Recommended'];
if (isset($o['Why'])) $this->Why = $o['Why'];
if (isset($o['ActionJson'])) $this->ActionJson = $o['ActionJson'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->Clears)) $o['Clears'] = $this->Clears;
if (isset($this->Recommended)) $o['Recommended'] = $this->Recommended;
if (isset($this->Why)) $o['Why'] = $this->Why;
if (isset($this->ActionJson)) $o['ActionJson'] = $this->ActionJson;
return empty($o) ? new class(){} : $o;
}
}
class ResourceConflictDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Severity=null,
/** @var string|null */
public ?string $Summary=null,
/** @var array<ResourceConflictBookingDto>|null */
public ?array $Bookings=null,
/** @var array<ResourceConflictOptionDto>|null */
public ?array $Options=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Severity'])) $this->Severity = $o['Severity'];
if (isset($o['Summary'])) $this->Summary = $o['Summary'];
if (isset($o['Bookings'])) $this->Bookings = JsonConverters::fromArray('ResourceConflictBookingDto', $o['Bookings']);
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('ResourceConflictOptionDto', $o['Options']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Severity)) $o['Severity'] = $this->Severity;
if (isset($this->Summary)) $o['Summary'] = $this->Summary;
if (isset($this->Bookings)) $o['Bookings'] = JsonConverters::toArray('ResourceConflictBookingDto', $this->Bookings);
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('ResourceConflictOptionDto', $this->Options);
return empty($o) ? new class(){} : $o;
}
}
class ResourceConflictsResponse implements JsonSerializable
{
public function __construct(
/** @var array<ResourceConflictDto>|null */
public ?array $Conflicts=null,
/** @var int */
public int $EquipmentWatched=0,
/** @var int */
public int $WorkersWatched=0,
/** @var int */
public int $CrewsWatched=0,
/** @var int */
public int $ResolvedInWindow=0,
/** @var bool|null */
public ?bool $CanResolve=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Conflicts'])) $this->Conflicts = JsonConverters::fromArray('ResourceConflictDto', $o['Conflicts']);
if (isset($o['EquipmentWatched'])) $this->EquipmentWatched = $o['EquipmentWatched'];
if (isset($o['WorkersWatched'])) $this->WorkersWatched = $o['WorkersWatched'];
if (isset($o['CrewsWatched'])) $this->CrewsWatched = $o['CrewsWatched'];
if (isset($o['ResolvedInWindow'])) $this->ResolvedInWindow = $o['ResolvedInWindow'];
if (isset($o['CanResolve'])) $this->CanResolve = $o['CanResolve'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Conflicts)) $o['Conflicts'] = JsonConverters::toArray('ResourceConflictDto', $this->Conflicts);
if (isset($this->EquipmentWatched)) $o['EquipmentWatched'] = $this->EquipmentWatched;
if (isset($this->WorkersWatched)) $o['WorkersWatched'] = $this->WorkersWatched;
if (isset($this->CrewsWatched)) $o['CrewsWatched'] = $this->CrewsWatched;
if (isset($this->ResolvedInWindow)) $o['ResolvedInWindow'] = $this->ResolvedInWindow;
if (isset($this->CanResolve)) $o['CanResolve'] = $this->CanResolve;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class ResourceConflictsRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Window=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Window'])) $this->Window = $o['Window'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Window)) $o['Window'] = $this->Window;
return empty($o) ? new class(){} : $o;
}
}
PHP ResourceConflictsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/resource-conflicts HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"Conflicts":[{"Id":"String","Kind":"String","Name":"String","Severity":"String","Summary":"String","Bookings":[{"Project":"String","Job":"String","Window":"String","Tag":"String","Hot":false}],"Options":[{"Id":"String","Label":"String","Note":"String","Clears":false,"Recommended":false,"Why":"String","ActionJson":"String"}]}],"EquipmentWatched":0,"WorkersWatched":0,"CrewsWatched":0,"ResolvedInWindow":0,"CanResolve":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}