| GET | /v1/forms/{FormUID}/automations |
|---|
<?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 FormAutomationRule implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkflowId=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Sentence=null,
/** @var string|null */
public ?string $State=null,
/** @var string|null */
public ?string $StateText=null,
/** @var string|null */
public ?string $Numbers=null,
/** @var string|null */
public ?string $Warn=null,
/** @var bool|null */
public ?bool $AnyApplication=null,
/** @var bool|null */
public ?bool $AlsoOthers=null,
/** @var string|null */
public ?string $SharedText=null,
/** @var bool|null */
public ?bool $FromStarter=null,
/** @var string|null */
public ?string $EngineLink=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkflowId'])) $this->WorkflowId = $o['WorkflowId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Sentence'])) $this->Sentence = $o['Sentence'];
if (isset($o['State'])) $this->State = $o['State'];
if (isset($o['StateText'])) $this->StateText = $o['StateText'];
if (isset($o['Numbers'])) $this->Numbers = $o['Numbers'];
if (isset($o['Warn'])) $this->Warn = $o['Warn'];
if (isset($o['AnyApplication'])) $this->AnyApplication = $o['AnyApplication'];
if (isset($o['AlsoOthers'])) $this->AlsoOthers = $o['AlsoOthers'];
if (isset($o['SharedText'])) $this->SharedText = $o['SharedText'];
if (isset($o['FromStarter'])) $this->FromStarter = $o['FromStarter'];
if (isset($o['EngineLink'])) $this->EngineLink = $o['EngineLink'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkflowId)) $o['WorkflowId'] = $this->WorkflowId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Sentence)) $o['Sentence'] = $this->Sentence;
if (isset($this->State)) $o['State'] = $this->State;
if (isset($this->StateText)) $o['StateText'] = $this->StateText;
if (isset($this->Numbers)) $o['Numbers'] = $this->Numbers;
if (isset($this->Warn)) $o['Warn'] = $this->Warn;
if (isset($this->AnyApplication)) $o['AnyApplication'] = $this->AnyApplication;
if (isset($this->AlsoOthers)) $o['AlsoOthers'] = $this->AlsoOthers;
if (isset($this->SharedText)) $o['SharedText'] = $this->SharedText;
if (isset($this->FromStarter)) $o['FromStarter'] = $this->FromStarter;
if (isset($this->EngineLink)) $o['EngineLink'] = $this->EngineLink;
return empty($o) ? new class(){} : $o;
}
}
class FormAutomationStarter implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Key=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Text=null,
/** @var bool|null */
public ?bool $Added=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Key'])) $this->Key = $o['Key'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Added'])) $this->Added = $o['Added'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Key)) $o['Key'] = $this->Key;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Added)) $o['Added'] = $this->Added;
return empty($o) ? new class(){} : $o;
}
}
class FormMappingRow implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Field=null,
/** @var string|null */
public ?string $FieldKey=null,
/** @var string|null */
public ?string $Target=null,
/** @var string|null */
public ?string $Tone=null,
/** @var string|null */
public ?string $Note=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Field'])) $this->Field = $o['Field'];
if (isset($o['FieldKey'])) $this->FieldKey = $o['FieldKey'];
if (isset($o['Target'])) $this->Target = $o['Target'];
if (isset($o['Tone'])) $this->Tone = $o['Tone'];
if (isset($o['Note'])) $this->Note = $o['Note'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Field)) $o['Field'] = $this->Field;
if (isset($this->FieldKey)) $o['FieldKey'] = $this->FieldKey;
if (isset($this->Target)) $o['Target'] = $this->Target;
if (isset($this->Tone)) $o['Tone'] = $this->Tone;
if (isset($this->Note)) $o['Note'] = $this->Note;
return empty($o) ? new class(){} : $o;
}
}
class FormAutomationsResponse implements JsonSerializable
{
public function __construct(
/** @var array<FormAutomationRule>|null */
public ?array $Rules=null,
/** @var array<FormAutomationStarter>|null */
public ?array $Starters=null,
/** @var array<FormMappingRow>|null */
public ?array $Mapping=null,
/** @var string|null */
public ?string $MapSummary=null,
/** @var bool|null */
public ?bool $CanAdd=null,
/** @var string|null */
public ?string $AddRefusal=null,
/** @var bool|null */
public ?bool $CanToggle=null,
/** @var bool|null */
public ?bool $CanRemove=null,
/** @var bool|null */
public ?bool $CanOpenEngine=null,
/** @var array<string>|null */
public ?array $ReservedKeys=null,
/** @var array<string>|null */
public ?array $TestableFields=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Rules'])) $this->Rules = JsonConverters::fromArray('FormAutomationRule', $o['Rules']);
if (isset($o['Starters'])) $this->Starters = JsonConverters::fromArray('FormAutomationStarter', $o['Starters']);
if (isset($o['Mapping'])) $this->Mapping = JsonConverters::fromArray('FormMappingRow', $o['Mapping']);
if (isset($o['MapSummary'])) $this->MapSummary = $o['MapSummary'];
if (isset($o['CanAdd'])) $this->CanAdd = $o['CanAdd'];
if (isset($o['AddRefusal'])) $this->AddRefusal = $o['AddRefusal'];
if (isset($o['CanToggle'])) $this->CanToggle = $o['CanToggle'];
if (isset($o['CanRemove'])) $this->CanRemove = $o['CanRemove'];
if (isset($o['CanOpenEngine'])) $this->CanOpenEngine = $o['CanOpenEngine'];
if (isset($o['ReservedKeys'])) $this->ReservedKeys = JsonConverters::fromArray('string', $o['ReservedKeys']);
if (isset($o['TestableFields'])) $this->TestableFields = JsonConverters::fromArray('string', $o['TestableFields']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Rules)) $o['Rules'] = JsonConverters::toArray('FormAutomationRule', $this->Rules);
if (isset($this->Starters)) $o['Starters'] = JsonConverters::toArray('FormAutomationStarter', $this->Starters);
if (isset($this->Mapping)) $o['Mapping'] = JsonConverters::toArray('FormMappingRow', $this->Mapping);
if (isset($this->MapSummary)) $o['MapSummary'] = $this->MapSummary;
if (isset($this->CanAdd)) $o['CanAdd'] = $this->CanAdd;
if (isset($this->AddRefusal)) $o['AddRefusal'] = $this->AddRefusal;
if (isset($this->CanToggle)) $o['CanToggle'] = $this->CanToggle;
if (isset($this->CanRemove)) $o['CanRemove'] = $this->CanRemove;
if (isset($this->CanOpenEngine)) $o['CanOpenEngine'] = $this->CanOpenEngine;
if (isset($this->ReservedKeys)) $o['ReservedKeys'] = JsonConverters::toArray('string', $this->ReservedKeys);
if (isset($this->TestableFields)) $o['TestableFields'] = JsonConverters::toArray('string', $this->TestableFields);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class FormAutomationsRequest 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 FormAutomationsRequest 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/{FormUID}/automations HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Rules":[{"WorkflowId":0,"Name":"String","Sentence":"String","State":"String","StateText":"String","Numbers":"String","Warn":"String","AnyApplication":false,"AlsoOthers":false,"SharedText":"String","FromStarter":false,"EngineLink":"String"}],"Starters":[{"Key":"String","Name":"String","Text":"String","Added":false}],"Mapping":[{"Field":"String","FieldKey":"String","Target":"String","Tone":"String","Note":"String"}],"MapSummary":"String","CanAdd":false,"AddRefusal":"String","CanToggle":false,"CanRemove":false,"CanOpenEngine":false,"ReservedKeys":["String"],"TestableFields":["String"],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}