Trendsic Platform Service

<back to all web services

ResourceConflictsRequest

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResourceConflictsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <CanResolve>false</CanResolve>
  <Conflicts>
    <ResourceConflictDto>
      <Bookings>
        <ResourceConflictBookingDto>
          <Hot>false</Hot>
          <Job>String</Job>
          <Project>String</Project>
          <Tag>String</Tag>
          <Window>String</Window>
        </ResourceConflictBookingDto>
      </Bookings>
      <Id>String</Id>
      <Kind>String</Kind>
      <Name>String</Name>
      <Options>
        <ResourceConflictOptionDto>
          <ActionJson>String</ActionJson>
          <Clears>false</Clears>
          <Id>String</Id>
          <Label>String</Label>
          <Note>String</Note>
          <Recommended>false</Recommended>
          <Why>String</Why>
        </ResourceConflictOptionDto>
      </Options>
      <Severity>String</Severity>
      <Summary>String</Summary>
    </ResourceConflictDto>
  </Conflicts>
  <CrewsWatched>0</CrewsWatched>
  <EquipmentWatched>0</EquipmentWatched>
  <ResolvedInWindow>0</ResolvedInWindow>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <WorkersWatched>0</WorkersWatched>
</ResourceConflictsResponse>