GET | /v1/GetDataProcess/{ProcessId} |
---|
<?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 DataProcessLog implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var int */
public int $dataProcess_Id=0,
/** @var int */
public int $rowNumber=0,
/** @var int */
public int $failureReasonId=0,
/** @var string */
public string $failureReason='',
/** @var string */
public string $metaData='',
/** @var string */
public string $metaData2='',
/** @var bool|null */
public ?bool $hasFailed=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['dataProcess_Id'])) $this->dataProcess_Id = $o['dataProcess_Id'];
if (isset($o['rowNumber'])) $this->rowNumber = $o['rowNumber'];
if (isset($o['failureReasonId'])) $this->failureReasonId = $o['failureReasonId'];
if (isset($o['failureReason'])) $this->failureReason = $o['failureReason'];
if (isset($o['metaData'])) $this->metaData = $o['metaData'];
if (isset($o['metaData2'])) $this->metaData2 = $o['metaData2'];
if (isset($o['hasFailed'])) $this->hasFailed = $o['hasFailed'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->dataProcess_Id)) $o['dataProcess_Id'] = $this->dataProcess_Id;
if (isset($this->rowNumber)) $o['rowNumber'] = $this->rowNumber;
if (isset($this->failureReasonId)) $o['failureReasonId'] = $this->failureReasonId;
if (isset($this->failureReason)) $o['failureReason'] = $this->failureReason;
if (isset($this->metaData)) $o['metaData'] = $this->metaData;
if (isset($this->metaData2)) $o['metaData2'] = $this->metaData2;
if (isset($this->hasFailed)) $o['hasFailed'] = $this->hasFailed;
return empty($o) ? new class(){} : $o;
}
}
class CurrentDataProcessResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var int */
public int $type=0,
/** @var int */
public int $status=0,
/** @var string */
public string $statusName='',
/** @var int */
public int $totalRecords=0,
/** @var int */
public int $processedRecords=0,
/** @var string */
public string $fileName='',
/** @var string */
public string $originalFileName='',
/** @var string */
public string $dateCreated='',
/** @var string */
public string $dateStarted='',
/** @var string */
public string $dateFinished='',
/** @var string */
public string $gasId='',
/** @var array<DataProcessLog>|null */
public ?array $dataProcessResultLogs=null,
/** @var int */
public int $failedCount=0,
/** @var int */
public int $successCount=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['statusName'])) $this->statusName = $o['statusName'];
if (isset($o['totalRecords'])) $this->totalRecords = $o['totalRecords'];
if (isset($o['processedRecords'])) $this->processedRecords = $o['processedRecords'];
if (isset($o['fileName'])) $this->fileName = $o['fileName'];
if (isset($o['originalFileName'])) $this->originalFileName = $o['originalFileName'];
if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
if (isset($o['dateStarted'])) $this->dateStarted = $o['dateStarted'];
if (isset($o['dateFinished'])) $this->dateFinished = $o['dateFinished'];
if (isset($o['gasId'])) $this->gasId = $o['gasId'];
if (isset($o['dataProcessResultLogs'])) $this->dataProcessResultLogs = JsonConverters::fromArray('DataProcessLog', $o['dataProcessResultLogs']);
if (isset($o['failedCount'])) $this->failedCount = $o['failedCount'];
if (isset($o['successCount'])) $this->successCount = $o['successCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->statusName)) $o['statusName'] = $this->statusName;
if (isset($this->totalRecords)) $o['totalRecords'] = $this->totalRecords;
if (isset($this->processedRecords)) $o['processedRecords'] = $this->processedRecords;
if (isset($this->fileName)) $o['fileName'] = $this->fileName;
if (isset($this->originalFileName)) $o['originalFileName'] = $this->originalFileName;
if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
if (isset($this->dateStarted)) $o['dateStarted'] = $this->dateStarted;
if (isset($this->dateFinished)) $o['dateFinished'] = $this->dateFinished;
if (isset($this->gasId)) $o['gasId'] = $this->gasId;
if (isset($this->dataProcessResultLogs)) $o['dataProcessResultLogs'] = JsonConverters::toArray('DataProcessLog', $this->dataProcessResultLogs);
if (isset($this->failedCount)) $o['failedCount'] = $this->failedCount;
if (isset($this->successCount)) $o['successCount'] = $this->successCount;
return empty($o) ? new class(){} : $o;
}
}
class GetDataProcessRequest implements IGet, JsonSerializable
{
public function __construct(
/** @var int */
public int $processId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['processId'])) $this->processId = $o['processId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->processId)) $o['processId'] = $this->processId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetDataProcessRequest 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/GetDataProcess/{ProcessId} HTTP/1.1 Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"id":0,"type":0,"status":0,"statusName":"String","totalRecords":0,"processedRecords":0,"fileName":"String","originalFileName":"String","dateCreated":"String","dateStarted":"String","dateFinished":"String","gasId":"String","dataProcessResultLogs":[{"id":0,"dataProcess_Id":0,"rowNumber":0,"failureReasonId":0,"failureReason":"String","metaData":"String","metaData2":"String","hasFailed":false}],"failedCount":0,"successCount":0}