Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /addresses/{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 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;
}
}
/** @description Update a business address to be used with e911 */
// @Api(Description="Update a business address to be used with e911")
class PatchAddress implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $accountId=null,
/** @var string|null */
public ?string $addressId=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['accountId'])) $this->accountId = $o['accountId'];
if (isset($o['addressId'])) $this->addressId = $o['addressId'];
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->accountId)) $o['accountId'] = $this->accountId;
if (isset($this->addressId)) $o['addressId'] = $this->addressId;
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;
}
}
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.
POST /addresses/{addressId} HTTP/1.1
Host: team.evovoice.io
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"accountId":"String","addressId":"String","friendlyName":"String","emergencyEnabled":false,"customerName":"String","street":"String","city":"String","region":"String","postalCode":"String","isoCountry":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"id":"String","friendlyName":"String","emergencyEnabled":false,"customerName":"String","street":"String","city":"String","region":"String","postalCode":"String","isoCountry":"String"}