| GET | /v1/forms/{FormUID}/automations |
|---|
import 'package:servicestack/servicestack.dart';
class FormAutomationRule implements IConvertible
{
int? WorkflowId;
String? Name;
String? Sentence;
String? State;
String? StateText;
String? Numbers;
String? Warn;
bool? AnyApplication;
bool? AlsoOthers;
String? SharedText;
bool? FromStarter;
String? EngineLink;
FormAutomationRule({this.WorkflowId,this.Name,this.Sentence,this.State,this.StateText,this.Numbers,this.Warn,this.AnyApplication,this.AlsoOthers,this.SharedText,this.FromStarter,this.EngineLink});
FormAutomationRule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
WorkflowId = json['WorkflowId'];
Name = json['Name'];
Sentence = json['Sentence'];
State = json['State'];
StateText = json['StateText'];
Numbers = json['Numbers'];
Warn = json['Warn'];
AnyApplication = json['AnyApplication'];
AlsoOthers = json['AlsoOthers'];
SharedText = json['SharedText'];
FromStarter = json['FromStarter'];
EngineLink = json['EngineLink'];
return this;
}
Map<String, dynamic> toJson() => {
'WorkflowId': WorkflowId,
'Name': Name,
'Sentence': Sentence,
'State': State,
'StateText': StateText,
'Numbers': Numbers,
'Warn': Warn,
'AnyApplication': AnyApplication,
'AlsoOthers': AlsoOthers,
'SharedText': SharedText,
'FromStarter': FromStarter,
'EngineLink': EngineLink
};
getTypeName() => "FormAutomationRule";
TypeContext? context = _ctx;
}
class FormAutomationStarter implements IConvertible
{
String? Key;
String? Name;
String? Text;
bool? Added;
FormAutomationStarter({this.Key,this.Name,this.Text,this.Added});
FormAutomationStarter.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Text = json['Text'];
Added = json['Added'];
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Text': Text,
'Added': Added
};
getTypeName() => "FormAutomationStarter";
TypeContext? context = _ctx;
}
class FormMappingRow implements IConvertible
{
String? Field;
String? FieldKey;
String? Target;
String? Tone;
String? Note;
FormMappingRow({this.Field,this.FieldKey,this.Target,this.Tone,this.Note});
FormMappingRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Field = json['Field'];
FieldKey = json['FieldKey'];
Target = json['Target'];
Tone = json['Tone'];
Note = json['Note'];
return this;
}
Map<String, dynamic> toJson() => {
'Field': Field,
'FieldKey': FieldKey,
'Target': Target,
'Tone': Tone,
'Note': Note
};
getTypeName() => "FormMappingRow";
TypeContext? context = _ctx;
}
class FormAutomationsResponse implements IConvertible
{
List<FormAutomationRule>? Rules = [];
List<FormAutomationStarter>? Starters = [];
List<FormMappingRow>? Mapping = [];
String? MapSummary;
bool? CanAdd;
String? AddRefusal;
bool? CanToggle;
bool? CanRemove;
bool? CanOpenEngine;
List<String>? ReservedKeys = [];
List<String>? TestableFields = [];
ResponseStatus? ResponseStatus;
FormAutomationsResponse({this.Rules,this.Starters,this.Mapping,this.MapSummary,this.CanAdd,this.AddRefusal,this.CanToggle,this.CanRemove,this.CanOpenEngine,this.ReservedKeys,this.TestableFields,this.ResponseStatus});
FormAutomationsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Rules = JsonConverters.fromJson(json['Rules'],'List<FormAutomationRule>',context!);
Starters = JsonConverters.fromJson(json['Starters'],'List<FormAutomationStarter>',context!);
Mapping = JsonConverters.fromJson(json['Mapping'],'List<FormMappingRow>',context!);
MapSummary = json['MapSummary'];
CanAdd = json['CanAdd'];
AddRefusal = json['AddRefusal'];
CanToggle = json['CanToggle'];
CanRemove = json['CanRemove'];
CanOpenEngine = json['CanOpenEngine'];
ReservedKeys = JsonConverters.fromJson(json['ReservedKeys'],'List<String>',context!);
TestableFields = JsonConverters.fromJson(json['TestableFields'],'List<String>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Rules': JsonConverters.toJson(Rules,'List<FormAutomationRule>',context!),
'Starters': JsonConverters.toJson(Starters,'List<FormAutomationStarter>',context!),
'Mapping': JsonConverters.toJson(Mapping,'List<FormMappingRow>',context!),
'MapSummary': MapSummary,
'CanAdd': CanAdd,
'AddRefusal': AddRefusal,
'CanToggle': CanToggle,
'CanRemove': CanRemove,
'CanOpenEngine': CanOpenEngine,
'ReservedKeys': JsonConverters.toJson(ReservedKeys,'List<String>',context!),
'TestableFields': JsonConverters.toJson(TestableFields,'List<String>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "FormAutomationsResponse";
TypeContext? context = _ctx;
}
class FormAutomationsRequest implements IConvertible
{
String? FormUID;
FormAutomationsRequest({this.FormUID});
FormAutomationsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FormUID = json['FormUID'];
return this;
}
Map<String, dynamic> toJson() => {
'FormUID': FormUID
};
getTypeName() => "FormAutomationsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FormAutomationRule': TypeInfo(TypeOf.Class, create:() => FormAutomationRule()),
'FormAutomationStarter': TypeInfo(TypeOf.Class, create:() => FormAutomationStarter()),
'FormMappingRow': TypeInfo(TypeOf.Class, create:() => FormMappingRow()),
'FormAutomationsResponse': TypeInfo(TypeOf.Class, create:() => FormAutomationsResponse()),
'List<FormAutomationRule>': TypeInfo(TypeOf.Class, create:() => <FormAutomationRule>[]),
'List<FormAutomationStarter>': TypeInfo(TypeOf.Class, create:() => <FormAutomationStarter>[]),
'List<FormMappingRow>': TypeInfo(TypeOf.Class, create:() => <FormMappingRow>[]),
'FormAutomationsRequest': TypeInfo(TypeOf.Class, create:() => FormAutomationsRequest()),
});
Dart FormAutomationsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
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
}
}
}