| GET | /v1/forms/go-audience |
|---|
<?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 FormGoPosition implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $SkillUID=null,
/** @var string|null */
public ?string $Name=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var bool|null */
public ?bool $Ticked=null,
/** @var int */
public int $Count=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SkillUID'])) $this->SkillUID = $o['SkillUID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['Ticked'])) $this->Ticked = $o['Ticked'];
if (isset($o['Count'])) $this->Count = $o['Count'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SkillUID)) $o['SkillUID'] = $this->SkillUID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->Ticked)) $o['Ticked'] = $this->Ticked;
if (isset($this->Count)) $o['Count'] = $this->Count;
return empty($o) ? new class(){} : $o;
}
}
class FormGoAudienceResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Audience=null,
/** @var array<FormGoPosition>|null */
public ?array $Positions=null,
/** @var int */
public int $Workers=0,
/** @var int */
public int $Seeing=0,
/** @var int */
public int $Submitted=0,
/** @var string|null */
public ?string $Note=null,
/** @var string|null */
public ?string $Empty=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Audience'])) $this->Audience = $o['Audience'];
if (isset($o['Positions'])) $this->Positions = JsonConverters::fromArray('FormGoPosition', $o['Positions']);
if (isset($o['Workers'])) $this->Workers = $o['Workers'];
if (isset($o['Seeing'])) $this->Seeing = $o['Seeing'];
if (isset($o['Submitted'])) $this->Submitted = $o['Submitted'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['Empty'])) $this->Empty = $o['Empty'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Audience)) $o['Audience'] = $this->Audience;
if (isset($this->Positions)) $o['Positions'] = JsonConverters::toArray('FormGoPosition', $this->Positions);
if (isset($this->Workers)) $o['Workers'] = $this->Workers;
if (isset($this->Seeing)) $o['Seeing'] = $this->Seeing;
if (isset($this->Submitted)) $o['Submitted'] = $this->Submitted;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->Empty)) $o['Empty'] = $this->Empty;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class FormGoAudienceRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $FormUID=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
return empty($o) ? new class(){} : $o;
}
}
PHP FormGoAudienceRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/forms/go-audience HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Audience":"String","Positions":[{"SkillUID":"String","Name":"String","Active":false,"Ticked":false,"Count":0}],"Workers":0,"Seeing":0,"Submitted":0,"Note":"String","Empty":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}