| POST,OPTIONS | /v1/projects/{ProjectID}/ncrs/{NcrID}/disposition |
|---|
<?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 Ncr implements JsonSerializable
{
public function __construct(
/** @var int */
public int $NcrID=0,
/** @var string */
public string $NcrUID='',
/** @var int */
public int $ProjectID=0,
/** @var int|null */
public ?int $QcTestID=null,
/** @var string|null */
public ?string $NcrNo=null,
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $CostCode=null,
/** @var string|null */
public ?string $Disposition=null,
/** @var string|null */
public ?string $DispositionType=null,
/** @var string|null */
public ?string $CorrectiveAction=null,
/** @var string|null */
public ?string $DispositionedBy=null,
/** @var DateTime|null */
public ?DateTime $DispositionedAt=null,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var DateTime|null */
public ?DateTime $CreatedAt=null,
/** @var DateTime|null */
public ?DateTime $UpdatedAt=null,
/** @var string|null */
public ?string $TestNo=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NcrID'])) $this->NcrID = $o['NcrID'];
if (isset($o['NcrUID'])) $this->NcrUID = $o['NcrUID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['QcTestID'])) $this->QcTestID = $o['QcTestID'];
if (isset($o['NcrNo'])) $this->NcrNo = $o['NcrNo'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['CostCode'])) $this->CostCode = $o['CostCode'];
if (isset($o['Disposition'])) $this->Disposition = $o['Disposition'];
if (isset($o['DispositionType'])) $this->DispositionType = $o['DispositionType'];
if (isset($o['CorrectiveAction'])) $this->CorrectiveAction = $o['CorrectiveAction'];
if (isset($o['DispositionedBy'])) $this->DispositionedBy = $o['DispositionedBy'];
if (isset($o['DispositionedAt'])) $this->DispositionedAt = JsonConverters::from('DateTime', $o['DispositionedAt']);
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
if (isset($o['TestNo'])) $this->TestNo = $o['TestNo'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NcrID)) $o['NcrID'] = $this->NcrID;
if (isset($this->NcrUID)) $o['NcrUID'] = $this->NcrUID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->QcTestID)) $o['QcTestID'] = $this->QcTestID;
if (isset($this->NcrNo)) $o['NcrNo'] = $this->NcrNo;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->CostCode)) $o['CostCode'] = $this->CostCode;
if (isset($this->Disposition)) $o['Disposition'] = $this->Disposition;
if (isset($this->DispositionType)) $o['DispositionType'] = $this->DispositionType;
if (isset($this->CorrectiveAction)) $o['CorrectiveAction'] = $this->CorrectiveAction;
if (isset($this->DispositionedBy)) $o['DispositionedBy'] = $this->DispositionedBy;
if (isset($this->DispositionedAt)) $o['DispositionedAt'] = JsonConverters::to('DateTime', $this->DispositionedAt);
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
if (isset($this->TestNo)) $o['TestNo'] = $this->TestNo;
return empty($o) ? new class(){} : $o;
}
}
class NcrResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var Ncr|null */
public ?Ncr $Ncr=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Ncr'])) $this->Ncr = JsonConverters::from('Ncr', $o['Ncr']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Ncr)) $o['Ncr'] = JsonConverters::to('Ncr', $this->Ncr);
return empty($o) ? new class(){} : $o;
}
}
class NcrDispositionRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $NcrID=0,
/** @var string|null */
public ?string $DispositionType=null,
/** @var string|null */
public ?string $CorrectiveAction=null,
/** @var bool|null */
public ?bool $Close=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['NcrID'])) $this->NcrID = $o['NcrID'];
if (isset($o['DispositionType'])) $this->DispositionType = $o['DispositionType'];
if (isset($o['CorrectiveAction'])) $this->CorrectiveAction = $o['CorrectiveAction'];
if (isset($o['Close'])) $this->Close = $o['Close'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->NcrID)) $o['NcrID'] = $this->NcrID;
if (isset($this->DispositionType)) $o['DispositionType'] = $this->DispositionType;
if (isset($this->CorrectiveAction)) $o['CorrectiveAction'] = $this->CorrectiveAction;
if (isset($this->Close)) $o['Close'] = $this->Close;
return empty($o) ? new class(){} : $o;
}
}
PHP NcrDispositionRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/projects/{ProjectID}/ncrs/{NcrID}/disposition HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NcrDispositionRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Close>false</Close>
<CorrectiveAction>String</CorrectiveAction>
<DispositionType>String</DispositionType>
<NcrID>0</NcrID>
<ProjectID>0</ProjectID>
</NcrDispositionRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<NcrResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Ncr>
<CorrectiveAction>String</CorrectiveAction>
<CostCode>String</CostCode>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<Description>String</Description>
<Disposition>String</Disposition>
<DispositionType>String</DispositionType>
<DispositionedAt>0001-01-01T00:00:00</DispositionedAt>
<DispositionedBy>String</DispositionedBy>
<NcrID>0</NcrID>
<NcrNo>String</NcrNo>
<NcrUID>00000000-0000-0000-0000-000000000000</NcrUID>
<ProjectID>0</ProjectID>
<QcTestID>0</QcTestID>
<TestNo>String</TestNo>
<Title>String</Title>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
</Ncr>
<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>
</NcrResponse>