| GET | /v1/forms/{FormUID}/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};
class FormReportBar implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Label=null,
/** @var int */
public int $N=0,
/** @var float */
public float $Value=0.0,
/** @var string|null */
public ?string $Text=null,
/** @var string|null */
public ?string $Tone=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['N'])) $this->N = $o['N'];
if (isset($o['Value'])) $this->Value = $o['Value'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Tone'])) $this->Tone = $o['Tone'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->N)) $o['N'] = $this->N;
if (isset($this->Value)) $o['Value'] = $this->Value;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Tone)) $o['Tone'] = $this->Tone;
return empty($o) ? new class(){} : $o;
}
}
class FormReportResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Submissions=0,
/** @var int */
public int $Decided=0,
/** @var int */
public int $Approved=0,
/** @var string|null */
public ?string $RateText=null,
/** @var string|null */
public ?string $DecisionText=null,
/** @var int */
public int $Drafts=0,
/** @var int */
public int $Sla=0,
/** @var int */
public int $DraftDays=0,
/** @var bool|null */
public ?bool $IsRecord=null,
/** @var array<FormReportBar>|null */
public ?array $Weeks=null,
/** @var array<FormReportBar>|null */
public ?array $Stages=null,
/** @var array<FormReportBar>|null */
public ?array $Pages=null,
/** @var int */
public int $Started=0,
/** @var int */
public int $SubmittedPct=0,
/** @var string|null */
public ?string $DropFrom=null,
/** @var int */
public int $DropN=0,
/** @var array<FormReportBar>|null */
public ?array $Durations=null,
/** @var array<FormReportBar>|null */
public ?array $Fields=null,
/** @var string|null */
public ?string $Field=null,
/** @var string|null */
public ?string $FieldLabel=null,
/** @var array<FormReportBar>|null */
public ?array $Options=null,
/** @var array<FormReportBar>|null */
public ?array $Reasons=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Submissions'])) $this->Submissions = $o['Submissions'];
if (isset($o['Decided'])) $this->Decided = $o['Decided'];
if (isset($o['Approved'])) $this->Approved = $o['Approved'];
if (isset($o['RateText'])) $this->RateText = $o['RateText'];
if (isset($o['DecisionText'])) $this->DecisionText = $o['DecisionText'];
if (isset($o['Drafts'])) $this->Drafts = $o['Drafts'];
if (isset($o['Sla'])) $this->Sla = $o['Sla'];
if (isset($o['DraftDays'])) $this->DraftDays = $o['DraftDays'];
if (isset($o['IsRecord'])) $this->IsRecord = $o['IsRecord'];
if (isset($o['Weeks'])) $this->Weeks = JsonConverters::fromArray('FormReportBar', $o['Weeks']);
if (isset($o['Stages'])) $this->Stages = JsonConverters::fromArray('FormReportBar', $o['Stages']);
if (isset($o['Pages'])) $this->Pages = JsonConverters::fromArray('FormReportBar', $o['Pages']);
if (isset($o['Started'])) $this->Started = $o['Started'];
if (isset($o['SubmittedPct'])) $this->SubmittedPct = $o['SubmittedPct'];
if (isset($o['DropFrom'])) $this->DropFrom = $o['DropFrom'];
if (isset($o['DropN'])) $this->DropN = $o['DropN'];
if (isset($o['Durations'])) $this->Durations = JsonConverters::fromArray('FormReportBar', $o['Durations']);
if (isset($o['Fields'])) $this->Fields = JsonConverters::fromArray('FormReportBar', $o['Fields']);
if (isset($o['Field'])) $this->Field = $o['Field'];
if (isset($o['FieldLabel'])) $this->FieldLabel = $o['FieldLabel'];
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('FormReportBar', $o['Options']);
if (isset($o['Reasons'])) $this->Reasons = JsonConverters::fromArray('FormReportBar', $o['Reasons']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Submissions)) $o['Submissions'] = $this->Submissions;
if (isset($this->Decided)) $o['Decided'] = $this->Decided;
if (isset($this->Approved)) $o['Approved'] = $this->Approved;
if (isset($this->RateText)) $o['RateText'] = $this->RateText;
if (isset($this->DecisionText)) $o['DecisionText'] = $this->DecisionText;
if (isset($this->Drafts)) $o['Drafts'] = $this->Drafts;
if (isset($this->Sla)) $o['Sla'] = $this->Sla;
if (isset($this->DraftDays)) $o['DraftDays'] = $this->DraftDays;
if (isset($this->IsRecord)) $o['IsRecord'] = $this->IsRecord;
if (isset($this->Weeks)) $o['Weeks'] = JsonConverters::toArray('FormReportBar', $this->Weeks);
if (isset($this->Stages)) $o['Stages'] = JsonConverters::toArray('FormReportBar', $this->Stages);
if (isset($this->Pages)) $o['Pages'] = JsonConverters::toArray('FormReportBar', $this->Pages);
if (isset($this->Started)) $o['Started'] = $this->Started;
if (isset($this->SubmittedPct)) $o['SubmittedPct'] = $this->SubmittedPct;
if (isset($this->DropFrom)) $o['DropFrom'] = $this->DropFrom;
if (isset($this->DropN)) $o['DropN'] = $this->DropN;
if (isset($this->Durations)) $o['Durations'] = JsonConverters::toArray('FormReportBar', $this->Durations);
if (isset($this->Fields)) $o['Fields'] = JsonConverters::toArray('FormReportBar', $this->Fields);
if (isset($this->Field)) $o['Field'] = $this->Field;
if (isset($this->FieldLabel)) $o['FieldLabel'] = $this->FieldLabel;
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('FormReportBar', $this->Options);
if (isset($this->Reasons)) $o['Reasons'] = JsonConverters::toArray('FormReportBar', $this->Reasons);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class FormReportRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $FormUID='',
/** @var string|null */
public ?string $Field=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
if (isset($o['Field'])) $this->Field = $o['Field'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
if (isset($this->Field)) $o['Field'] = $this->Field;
return empty($o) ? new class(){} : $o;
}
}
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 /v1/forms/{FormUID}/reports HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FormReportResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Approved>0</Approved>
<Decided>0</Decided>
<DecisionText>String</DecisionText>
<DraftDays>0</DraftDays>
<Drafts>0</Drafts>
<DropFrom>String</DropFrom>
<DropN>0</DropN>
<Durations>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Durations>
<Field>String</Field>
<FieldLabel>String</FieldLabel>
<Fields>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Fields>
<IsRecord>false</IsRecord>
<Options>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Options>
<Pages>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Pages>
<RateText>String</RateText>
<Reasons>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Reasons>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<Sla>0</Sla>
<Stages>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Stages>
<Started>0</Started>
<Submissions>0</Submissions>
<SubmittedPct>0</SubmittedPct>
<Weeks>
<FormReportBar>
<Id>String</Id>
<Label>String</Label>
<N>0</N>
<Text>String</Text>
<Tone>String</Tone>
<Value>0</Value>
</FormReportBar>
</Weeks>
</FormReportResponse>