| 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 .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}/automations HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FormAutomationsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<AddRefusal>String</AddRefusal>
<CanAdd>false</CanAdd>
<CanOpenEngine>false</CanOpenEngine>
<CanRemove>false</CanRemove>
<CanToggle>false</CanToggle>
<MapSummary>String</MapSummary>
<Mapping>
<FormMappingRow>
<Field>String</Field>
<FieldKey>String</FieldKey>
<Note>String</Note>
<Target>String</Target>
<Tone>String</Tone>
</FormMappingRow>
</Mapping>
<ReservedKeys xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</ReservedKeys>
<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>
<Rules>
<FormAutomationRule>
<AlsoOthers>false</AlsoOthers>
<AnyApplication>false</AnyApplication>
<EngineLink>String</EngineLink>
<FromStarter>false</FromStarter>
<Name>String</Name>
<Numbers>String</Numbers>
<Sentence>String</Sentence>
<SharedText>String</SharedText>
<State>String</State>
<StateText>String</StateText>
<Warn>String</Warn>
<WorkflowId>0</WorkflowId>
</FormAutomationRule>
</Rules>
<Starters>
<FormAutomationStarter>
<Added>false</Added>
<Key>String</Key>
<Name>String</Name>
<Text>String</Text>
</FormAutomationStarter>
</Starters>
<TestableFields xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</TestableFields>
</FormAutomationsResponse>