Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /system/dialing-permissions |
---|
<?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 DialingPermissionInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $isoCode=null,
/** @var string|null */
public ?string $name=null,
/** @var bool|null */
public ?bool $lowRiskNumbersEnabled=null,
/** @var bool|null */
public ?bool $highRiskSpecialNumbersEnabled=null,
/** @var bool|null */
public ?bool $highRiskTollfraudNumbersEnabled=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['isoCode'])) $this->isoCode = $o['isoCode'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['lowRiskNumbersEnabled'])) $this->lowRiskNumbersEnabled = $o['lowRiskNumbersEnabled'];
if (isset($o['highRiskSpecialNumbersEnabled'])) $this->highRiskSpecialNumbersEnabled = $o['highRiskSpecialNumbersEnabled'];
if (isset($o['highRiskTollfraudNumbersEnabled'])) $this->highRiskTollfraudNumbersEnabled = $o['highRiskTollfraudNumbersEnabled'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->isoCode)) $o['isoCode'] = $this->isoCode;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->lowRiskNumbersEnabled)) $o['lowRiskNumbersEnabled'] = $this->lowRiskNumbersEnabled;
if (isset($this->highRiskSpecialNumbersEnabled)) $o['highRiskSpecialNumbersEnabled'] = $this->highRiskSpecialNumbersEnabled;
if (isset($this->highRiskTollfraudNumbersEnabled)) $o['highRiskTollfraudNumbersEnabled'] = $this->highRiskTollfraudNumbersEnabled;
return empty($o) ? new class(){} : $o;
}
}
class GetDialingPermissionsResponse implements JsonSerializable
{
public function __construct(
/** @var array<DialingPermissionInfo>|null */
public ?array $permissions=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['permissions'])) $this->permissions = JsonConverters::fromArray('DialingPermissionInfo', $o['permissions']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->permissions)) $o['permissions'] = JsonConverters::toArray('DialingPermissionInfo', $this->permissions);
return empty($o) ? new class(){} : $o;
}
}
/** @description Get all of the country based dialing permissions for this account */
// @Api(Description="Get all of the country based dialing permissions for this account")
class GetDialingPermissions implements IGet, JsonSerializable
{
public function __construct(
/** @description The account ID you want to retrieve for */
// @ApiMember(Description="The account ID you want to retrieve for")
/** @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 GetDialingPermissions DTOs
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 /system/dialing-permissions HTTP/1.1 Host: team.evovoice.io Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { permissions: [ { isoCode: String, name: String, lowRiskNumbersEnabled: False, highRiskSpecialNumbersEnabled: False, highRiskTollfraudNumbersEnabled: False } ] }