| 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 .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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/json
HTTP/1.1 200 OK
Content-Type: application/json
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"}}}