| GET | /v1/RefundPolicy |
|---|
<?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 RefundPolicy implements JsonSerializable
{
public function __construct(
/** @var int */
public int $DisplayOrder=0,
/** @var int */
public int $RefundPolicyId=0,
/** @var DateTime */
public DateTime $BeginDate=new DateTime(),
/** @var DateTime */
public DateTime $ExpireDate=new DateTime(),
/** @var string|null */
public ?string $RefundPolicyText=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DisplayOrder'])) $this->DisplayOrder = $o['DisplayOrder'];
if (isset($o['RefundPolicyId'])) $this->RefundPolicyId = $o['RefundPolicyId'];
if (isset($o['BeginDate'])) $this->BeginDate = JsonConverters::from('DateTime', $o['BeginDate']);
if (isset($o['ExpireDate'])) $this->ExpireDate = JsonConverters::from('DateTime', $o['ExpireDate']);
if (isset($o['RefundPolicyText'])) $this->RefundPolicyText = $o['RefundPolicyText'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DisplayOrder)) $o['DisplayOrder'] = $this->DisplayOrder;
if (isset($this->RefundPolicyId)) $o['RefundPolicyId'] = $this->RefundPolicyId;
if (isset($this->BeginDate)) $o['BeginDate'] = JsonConverters::to('DateTime', $this->BeginDate);
if (isset($this->ExpireDate)) $o['ExpireDate'] = JsonConverters::to('DateTime', $this->ExpireDate);
if (isset($this->RefundPolicyText)) $o['RefundPolicyText'] = $this->RefundPolicyText;
return empty($o) ? new class(){} : $o;
}
}
class RefundPolicyResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<RefundPolicy>|null */
public ?array $RefundPolicy=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['RefundPolicy'])) $this->RefundPolicy = JsonConverters::fromArray('RefundPolicy', $o['RefundPolicy']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->RefundPolicy)) $o['RefundPolicy'] = JsonConverters::toArray('RefundPolicy', $this->RefundPolicy);
return empty($o) ? new class(){} : $o;
}
}
class RefundPolicyRequest implements JsonSerializable
{
public function __construct(
/** @var array<RefundPolicy>|null */
public ?array $RefundPolicy=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RefundPolicy'])) $this->RefundPolicy = JsonConverters::fromArray('RefundPolicy', $o['RefundPolicy']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RefundPolicy)) $o['RefundPolicy'] = JsonConverters::toArray('RefundPolicy', $this->RefundPolicy);
return empty($o) ? new class(){} : $o;
}
}
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.
GET /v1/RefundPolicy HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
RefundPolicy:
[
{
DisplayOrder: 0,
RefundPolicyId: 0,
BeginDate: 0001-01-01,
ExpireDate: 0001-01-01,
RefundPolicyText: String
}
]
}