| GET,OPTIONS | /v1/getAddress/{AddressID} |
|---|
<?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 Address implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var int */
public int $AddressTypeID=0,
/** @var string|null */
public ?string $AddressContact=null,
/** @var string|null */
public ?string $AttentionTo=null,
/** @var string|null */
public ?string $AddressLine1=null,
/** @var string|null */
public ?string $AddressLine2=null,
/** @var string|null */
public ?string $AddressLine3=null,
/** @var string|null */
public ?string $AddressCity=null,
/** @var string|null */
public ?string $AddressState=null,
/** @var string|null */
public ?string $AddressZip=null,
/** @var string|null */
public ?string $AddressCountry=null,
/** @var string|null */
public ?string $PhoneNumber=null,
/** @var string|null */
public ?string $FaxNumber=null,
/** @var string */
public string $UID='',
/** @var string|null */
public ?string $Name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['AddressTypeID'])) $this->AddressTypeID = $o['AddressTypeID'];
if (isset($o['AddressContact'])) $this->AddressContact = $o['AddressContact'];
if (isset($o['AttentionTo'])) $this->AttentionTo = $o['AttentionTo'];
if (isset($o['AddressLine1'])) $this->AddressLine1 = $o['AddressLine1'];
if (isset($o['AddressLine2'])) $this->AddressLine2 = $o['AddressLine2'];
if (isset($o['AddressLine3'])) $this->AddressLine3 = $o['AddressLine3'];
if (isset($o['AddressCity'])) $this->AddressCity = $o['AddressCity'];
if (isset($o['AddressState'])) $this->AddressState = $o['AddressState'];
if (isset($o['AddressZip'])) $this->AddressZip = $o['AddressZip'];
if (isset($o['AddressCountry'])) $this->AddressCountry = $o['AddressCountry'];
if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
if (isset($o['FaxNumber'])) $this->FaxNumber = $o['FaxNumber'];
if (isset($o['UID'])) $this->UID = $o['UID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->AddressTypeID)) $o['AddressTypeID'] = $this->AddressTypeID;
if (isset($this->AddressContact)) $o['AddressContact'] = $this->AddressContact;
if (isset($this->AttentionTo)) $o['AttentionTo'] = $this->AttentionTo;
if (isset($this->AddressLine1)) $o['AddressLine1'] = $this->AddressLine1;
if (isset($this->AddressLine2)) $o['AddressLine2'] = $this->AddressLine2;
if (isset($this->AddressLine3)) $o['AddressLine3'] = $this->AddressLine3;
if (isset($this->AddressCity)) $o['AddressCity'] = $this->AddressCity;
if (isset($this->AddressState)) $o['AddressState'] = $this->AddressState;
if (isset($this->AddressZip)) $o['AddressZip'] = $this->AddressZip;
if (isset($this->AddressCountry)) $o['AddressCountry'] = $this->AddressCountry;
if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
if (isset($this->FaxNumber)) $o['FaxNumber'] = $this->FaxNumber;
if (isset($this->UID)) $o['UID'] = $this->UID;
if (isset($this->Name)) $o['Name'] = $this->Name;
return empty($o) ? new class(){} : $o;
}
}
class AddressResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var Address|null */
public ?Address $Address=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Address'])) $this->Address = JsonConverters::from('Address', $o['Address']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Address)) $o['Address'] = JsonConverters::to('Address', $this->Address);
return empty($o) ? new class(){} : $o;
}
}
class AddressRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AddressID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AddressID'])) $this->AddressID = $o['AddressID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AddressID)) $o['AddressID'] = $this->AddressID;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/getAddress/{AddressID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Address":{"ID":0,"AddressTypeID":0,"AddressContact":"String","AttentionTo":"String","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","AddressCity":"String","AddressState":"String","AddressZip":"String","AddressCountry":"String","PhoneNumber":"String","FaxNumber":"String","UID":"00000000000000000000000000000000","Name":"String"}}