POST | /v1/OutOfMarketArea | Save list of all Out Of Market Area Commission Numbers | Save list of all Out Of Market Area Commission Numbers |
---|
<?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 CommRow implements JsonSerializable
{
public function __construct(
/** @var int */
public int $row=0,
/** @var string */
public string $comm=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['row'])) $this->row = $o['row'];
if (isset($o['comm'])) $this->comm = $o['comm'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->row)) $o['row'] = $this->row;
if (isset($this->comm)) $o['comm'] = $this->comm;
return empty($o) ? new class(){} : $o;
}
}
class OutOfMarketAreaCommsValidationError implements JsonSerializable
{
public function __construct(
/** @var string */
public string $message='',
/** @var int */
public int $row=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['row'])) $this->row = $o['row'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->row)) $o['row'] = $this->row;
return empty($o) ? new class(){} : $o;
}
}
class PostOutOfMarketAreaCommsJobsResponse implements JsonSerializable
{
public function __construct(
/** @var array<CommRow>|null */
public ?array $comms=null,
/** @var array<OutOfMarketAreaCommsValidationError>|null */
public ?array $validationErrors=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['comms'])) $this->comms = JsonConverters::fromArray('CommRow', $o['comms']);
if (isset($o['validationErrors'])) $this->validationErrors = JsonConverters::fromArray('OutOfMarketAreaCommsValidationError', $o['validationErrors']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->comms)) $o['comms'] = JsonConverters::toArray('CommRow', $this->comms);
if (isset($this->validationErrors)) $o['validationErrors'] = JsonConverters::toArray('OutOfMarketAreaCommsValidationError', $this->validationErrors);
return empty($o) ? new class(){} : $o;
}
}
class PostOutOfMarketAreaCommsJobsRequest implements IGet, JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP PostOutOfMarketAreaCommsJobsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/OutOfMarketArea HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { comms: [ { row: 0, comm: String } ], validationErrors: [ { message: String, row: 0 } ] }