GET | /values/endpoint/unique |
---|
<?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 GetUniqueEndpointValueResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['value'])) $this->value = $o['value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->value)) $o['value'] = $this->value;
return empty($o) ? new class(){} : $o;
}
}
/** @description Get a unique number string value for an endpoint field */
// @Api(Description="Get a unique number string value for an endpoint field")
class GetUniqueEndpointValue implements JsonSerializable
{
public function __construct(
/** @description The account ID you are interested in */
// @ApiMember(Description="The account ID you are interested in")
/** @var string|null */
public ?string $accountId=null,
/** @description The endpoint field you want a unique value for */
// @ApiMember(Description="The endpoint field you want a unique value for")
/** @var string|null */
public ?string $fieldName=null,
/** @description The prefix to use for the value */
// @ApiMember(Description="The prefix to use for the value")
/** @var string|null */
public ?string $prefix=null,
/** @description The length of the value */
// @ApiMember(Description="The length of the value")
/** @var int */
public int $length=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
if (isset($o['fieldName'])) $this->fieldName = $o['fieldName'];
if (isset($o['prefix'])) $this->prefix = $o['prefix'];
if (isset($o['length'])) $this->length = $o['length'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
if (isset($this->fieldName)) $o['fieldName'] = $this->fieldName;
if (isset($this->prefix)) $o['prefix'] = $this->prefix;
if (isset($this->length)) $o['length'] = $this->length;
return empty($o) ? new class(){} : $o;
}
}
PHP GetUniqueEndpointValue DTOs
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 /values/endpoint/unique HTTP/1.1 Host: team.evovoice.io Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetUniqueEndpointValueResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Values"> <Value>String</Value> </GetUniqueEndpointValueResponse>