Evo Voice

<back to all web services

ListAddresses

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
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;
    }
}

PHP ListAddresses DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"addresses":[{"id":"String","friendlyName":"String","emergencyEnabled":false,"customerName":"String","street":"String","city":"String","region":"String","postalCode":"String","isoCountry":"String"}]}