Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /reports |
---|
<?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};
enum ReportStatuses : string
{
case Queued = 'Queued';
case Running = 'Running';
case Completed = 'Completed';
case Error = 'Error';
}
class ReportInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $name=null,
/** @var ReportStatuses|null */
public ?ReportStatuses $status=null,
/** @var string|null */
public ?string $statusMessage=null,
/** @var string|null */
public ?string $dateCreated=null,
/** @var string|null */
public ?string $dateUpdated=null,
/** @var string|null */
public ?string $downloadLink=null,
/** @var string|null */
public ?string $jobId=null,
/** @var string|null */
public ?string $emailAddressToNotify=null,
/** @var string|null */
public ?string $server=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['status'])) $this->status = JsonConverters::from('ReportStatuses', $o['status']);
if (isset($o['statusMessage'])) $this->statusMessage = $o['statusMessage'];
if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
if (isset($o['dateUpdated'])) $this->dateUpdated = $o['dateUpdated'];
if (isset($o['downloadLink'])) $this->downloadLink = $o['downloadLink'];
if (isset($o['jobId'])) $this->jobId = $o['jobId'];
if (isset($o['emailAddressToNotify'])) $this->emailAddressToNotify = $o['emailAddressToNotify'];
if (isset($o['server'])) $this->server = $o['server'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->status)) $o['status'] = JsonConverters::to('ReportStatuses', $this->status);
if (isset($this->statusMessage)) $o['statusMessage'] = $this->statusMessage;
if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
if (isset($this->dateUpdated)) $o['dateUpdated'] = $this->dateUpdated;
if (isset($this->downloadLink)) $o['downloadLink'] = $this->downloadLink;
if (isset($this->jobId)) $o['jobId'] = $this->jobId;
if (isset($this->emailAddressToNotify)) $o['emailAddressToNotify'] = $this->emailAddressToNotify;
if (isset($this->server)) $o['server'] = $this->server;
return empty($o) ? new class(){} : $o;
}
}
class ListReportsResponse implements JsonSerializable
{
public function __construct(
/** @var array<ReportInfo>|null */
public ?array $reports=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['reports'])) $this->reports = JsonConverters::fromArray('ReportInfo', $o['reports']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->reports)) $o['reports'] = JsonConverters::toArray('ReportInfo', $this->reports);
return empty($o) ? new class(){} : $o;
}
}
/** @description Returns all of the active/completed reports for the current user */
// @Api(Description="Returns all of the active/completed reports for the current user")
class ListReports implements JsonSerializable
{
public function __construct(
/** @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 .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /reports HTTP/1.1 Host: team.evovoice.io Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"reports":[{"id":"String","name":"String","status":"Queued","statusMessage":"String","dateCreated":"String","dateUpdated":"String","downloadLink":"String","jobId":"String","emailAddressToNotify":"String","server":"String"}]}