Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /addresses |
---|
<?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 AddressInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $friendlyName=null,
/** @var bool|null */
public ?bool $emergencyEnabled=null,
/** @var string|null */
public ?string $customerName=null,
/** @var string|null */
public ?string $street=null,
/** @var string|null */
public ?string $city=null,
/** @var string|null */
public ?string $region=null,
/** @var string|null */
public ?string $postalCode=null,
/** @var string|null */
public ?string $isoCountry=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['friendlyName'])) $this->friendlyName = $o['friendlyName'];
if (isset($o['emergencyEnabled'])) $this->emergencyEnabled = $o['emergencyEnabled'];
if (isset($o['customerName'])) $this->customerName = $o['customerName'];
if (isset($o['street'])) $this->street = $o['street'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['region'])) $this->region = $o['region'];
if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
if (isset($o['isoCountry'])) $this->isoCountry = $o['isoCountry'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->friendlyName)) $o['friendlyName'] = $this->friendlyName;
if (isset($this->emergencyEnabled)) $o['emergencyEnabled'] = $this->emergencyEnabled;
if (isset($this->customerName)) $o['customerName'] = $this->customerName;
if (isset($this->street)) $o['street'] = $this->street;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->region)) $o['region'] = $this->region;
if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
if (isset($this->isoCountry)) $o['isoCountry'] = $this->isoCountry;
return empty($o) ? new class(){} : $o;
}
}
class ListAddressesResponse implements JsonSerializable
{
public function __construct(
/** @var array<AddressInfo>|null */
public ?array $addresses=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['addresses'])) $this->addresses = JsonConverters::fromArray('AddressInfo', $o['addresses']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->addresses)) $o['addresses'] = JsonConverters::toArray('AddressInfo', $this->addresses);
return empty($o) ? new class(){} : $o;
}
}
class ListAddresses implements JsonSerializable
{
public function __construct(
/** @description The account ID whose addresses you want */
// @ApiMember(Description="The account ID whose addresses you want")
/** @var string|null */
public ?string $accountId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
return empty($o) ? new class(){} : $o;
}
}
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.
GET /addresses HTTP/1.1 Host: team.evovoice.io Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ListAddressesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Settings"> <Addresses> <AddressInfo> <City>String</City> <CustomerName>String</CustomerName> <EmergencyEnabled>false</EmergencyEnabled> <FriendlyName>String</FriendlyName> <ISOCountry>String</ISOCountry> <Id>String</Id> <PostalCode>String</PostalCode> <Region>String</Region> <Street>String</Street> </AddressInfo> </Addresses> </ListAddressesResponse>