| GET,PUT,DELETE | /{WorkspaceId}/IntegrationRule/{Id} |
|---|
import 'package:servicestack/servicestack.dart';
enum PossibleComparisons
{
LTE,
LT,
GT,
GTE,
EQ,
NE,
NULL,
NOTNULL,
CHG,
STARTS,
LIKE,
}
class Condition implements IConvertible
{
String? ValueComparedTo;
String? ValueToCompare;
PossibleComparisons? ComparisonOperator;
Condition({this.ValueComparedTo,this.ValueToCompare,this.ComparisonOperator});
Condition.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ValueComparedTo = json['ValueComparedTo'];
ValueToCompare = json['ValueToCompare'];
ComparisonOperator = JsonConverters.fromJson(json['ComparisonOperator'],'PossibleComparisons',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ValueComparedTo': ValueComparedTo,
'ValueToCompare': ValueToCompare,
'ComparisonOperator': JsonConverters.toJson(ComparisonOperator,'PossibleComparisons',context!)
};
getTypeName() => "Condition";
TypeContext? context = _ctx;
}
class ConditionGroup implements IConvertible
{
Condition? Condition;
int? Precedence;
int? GroupIdentifier;
String? BooleanOperator;
ConditionGroup({this.Condition,this.Precedence,this.GroupIdentifier,this.BooleanOperator});
ConditionGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Condition = JsonConverters.fromJson(json['Condition'],'Condition',context!);
Precedence = json['Precedence'];
GroupIdentifier = json['GroupIdentifier'];
BooleanOperator = json['BooleanOperator'];
return this;
}
Map<String, dynamic> toJson() => {
'Condition': JsonConverters.toJson(Condition,'Condition',context!),
'Precedence': Precedence,
'GroupIdentifier': GroupIdentifier,
'BooleanOperator': BooleanOperator
};
getTypeName() => "ConditionGroup";
TypeContext? context = _ctx;
}
class ConditionGroupItem implements IConvertible
{
List<ConditionGroup>? ConditionGroups;
int? Precedence;
int? GroupIdentifier;
String? BooleanOperator;
ConditionGroupItem({this.ConditionGroups,this.Precedence,this.GroupIdentifier,this.BooleanOperator});
ConditionGroupItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ConditionGroups = JsonConverters.fromJson(json['ConditionGroups'],'List<ConditionGroup>',context!);
Precedence = json['Precedence'];
GroupIdentifier = json['GroupIdentifier'];
BooleanOperator = json['BooleanOperator'];
return this;
}
Map<String, dynamic> toJson() => {
'ConditionGroups': JsonConverters.toJson(ConditionGroups,'List<ConditionGroup>',context!),
'Precedence': Precedence,
'GroupIdentifier': GroupIdentifier,
'BooleanOperator': BooleanOperator
};
getTypeName() => "ConditionGroupItem";
TypeContext? context = _ctx;
}
class Action implements IConvertible
{
String? Id;
String? CallType;
String? ActionToTake;
String? Destination;
String? ExternalId;
String? ExternalParentId;
String? DeleteTypeIfNotExists;
Map<String,dynamic?>? DataTree;
String? Data;
Map<String,dynamic?>? DataTypes;
Action({this.Id,this.CallType,this.ActionToTake,this.Destination,this.ExternalId,this.ExternalParentId,this.DeleteTypeIfNotExists,this.DataTree,this.Data,this.DataTypes});
Action.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
CallType = json['CallType'];
ActionToTake = json['ActionToTake'];
Destination = json['Destination'];
ExternalId = json['ExternalId'];
ExternalParentId = json['ExternalParentId'];
DeleteTypeIfNotExists = json['DeleteTypeIfNotExists'];
DataTree = JsonConverters.fromJson(json['DataTree'],'Map<String,dynamic?>',context!);
Data = json['Data'];
DataTypes = JsonConverters.fromJson(json['DataTypes'],'Map<String,dynamic?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'CallType': CallType,
'ActionToTake': ActionToTake,
'Destination': Destination,
'ExternalId': ExternalId,
'ExternalParentId': ExternalParentId,
'DeleteTypeIfNotExists': DeleteTypeIfNotExists,
'DataTree': JsonConverters.toJson(DataTree,'Map<String,dynamic?>',context!),
'Data': Data,
'DataTypes': JsonConverters.toJson(DataTypes,'Map<String,dynamic?>',context!)
};
getTypeName() => "Action";
TypeContext? context = _ctx;
}
class RuleModuleDefinition implements IConvertible
{
bool? IsOutputModule;
String? Name;
List<String>? Prerequisites;
Map<String,dynamic?>? Parameters;
String? Type;
Action? OutputAction;
RuleModuleDefinition({this.IsOutputModule,this.Name,this.Prerequisites,this.Parameters,this.Type,this.OutputAction});
RuleModuleDefinition.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
IsOutputModule = json['IsOutputModule'];
Name = json['Name'];
Prerequisites = JsonConverters.fromJson(json['Prerequisites'],'List<String>',context!);
Parameters = JsonConverters.fromJson(json['Parameters'],'Map<String,dynamic?>',context!);
Type = json['Type'];
OutputAction = JsonConverters.fromJson(json['OutputAction'],'Action',context!);
return this;
}
Map<String, dynamic> toJson() => {
'IsOutputModule': IsOutputModule,
'Name': Name,
'Prerequisites': JsonConverters.toJson(Prerequisites,'List<String>',context!),
'Parameters': JsonConverters.toJson(Parameters,'Map<String,dynamic?>',context!),
'Type': Type,
'OutputAction': JsonConverters.toJson(OutputAction,'Action',context!)
};
getTypeName() => "RuleModuleDefinition";
TypeContext? context = _ctx;
}
/**
* Represents a set of rules what the system reads to take a particular set of actions. These dtos allow transfer of that data from the client to the server and vice versa.
*/
class IntegrationRule implements IConvertible
{
String? WorkspaceId;
String? Name;
Map<String,dynamic?>? Data;
String? ObjectType;
String? Id;
List<ConditionGroupItem>? ConditionGroupItems;
List<Action>? ActionsToTake;
DateTime? LastUpdated;
List<RuleModuleDefinition>? ModulePipeline;
bool? Enabled;
bool? WorkdayRestricted;
List<String>? Teams;
bool? AllowProgrammaticTrigger;
IntegrationRule({this.WorkspaceId,this.Name,this.Data,this.ObjectType,this.Id,this.ConditionGroupItems,this.ActionsToTake,this.LastUpdated,this.ModulePipeline,this.Enabled,this.WorkdayRestricted,this.Teams,this.AllowProgrammaticTrigger});
IntegrationRule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
WorkspaceId = json['WorkspaceId'];
Name = json['Name'];
Data = JsonConverters.fromJson(json['Data'],'Map<String,dynamic?>',context!);
ObjectType = json['ObjectType'];
Id = json['Id'];
ConditionGroupItems = JsonConverters.fromJson(json['ConditionGroupItems'],'List<ConditionGroupItem>',context!);
ActionsToTake = JsonConverters.fromJson(json['ActionsToTake'],'List<Action>',context!);
LastUpdated = JsonConverters.fromJson(json['LastUpdated'],'DateTime',context!);
ModulePipeline = JsonConverters.fromJson(json['ModulePipeline'],'List<RuleModuleDefinition>',context!);
Enabled = json['Enabled'];
WorkdayRestricted = json['WorkdayRestricted'];
Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
AllowProgrammaticTrigger = json['AllowProgrammaticTrigger'];
return this;
}
Map<String, dynamic> toJson() => {
'WorkspaceId': WorkspaceId,
'Name': Name,
'Data': JsonConverters.toJson(Data,'Map<String,dynamic?>',context!),
'ObjectType': ObjectType,
'Id': Id,
'ConditionGroupItems': JsonConverters.toJson(ConditionGroupItems,'List<ConditionGroupItem>',context!),
'ActionsToTake': JsonConverters.toJson(ActionsToTake,'List<Action>',context!),
'LastUpdated': JsonConverters.toJson(LastUpdated,'DateTime',context!),
'ModulePipeline': JsonConverters.toJson(ModulePipeline,'List<RuleModuleDefinition>',context!),
'Enabled': Enabled,
'WorkdayRestricted': WorkdayRestricted,
'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
'AllowProgrammaticTrigger': AllowProgrammaticTrigger
};
getTypeName() => "IntegrationRule";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'PossibleComparisons': TypeInfo(TypeOf.Enum, enumValues:PossibleComparisons.values),
'Condition': TypeInfo(TypeOf.Class, create:() => Condition()),
'ConditionGroup': TypeInfo(TypeOf.Class, create:() => ConditionGroup()),
'ConditionGroupItem': TypeInfo(TypeOf.Class, create:() => ConditionGroupItem()),
'List<ConditionGroup>': TypeInfo(TypeOf.Class, create:() => <ConditionGroup>[]),
'Action': TypeInfo(TypeOf.Class, create:() => Action()),
'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
'RuleModuleDefinition': TypeInfo(TypeOf.Class, create:() => RuleModuleDefinition()),
'IntegrationRule': TypeInfo(TypeOf.Class, create:() => IntegrationRule()),
'List<ConditionGroupItem>': TypeInfo(TypeOf.Class, create:() => <ConditionGroupItem>[]),
'List<Action>': TypeInfo(TypeOf.Class, create:() => <Action>[]),
'List<RuleModuleDefinition>': TypeInfo(TypeOf.Class, create:() => <RuleModuleDefinition>[]),
});
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.
PUT /{WorkspaceId}/IntegrationRule/{Id} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<IntegrationRule xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<ActionsToTake>
<Action>
<ActionToTake>String</ActionToTake>
<CallType>String</CallType>
<Data>String</Data>
<DataTree xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</DataTree>
<DataTypes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</DataTypes>
<DeleteTypeIfNotExists>String</DeleteTypeIfNotExists>
<Destination>String</Destination>
<ExternalId>String</ExternalId>
<ExternalParentId>String</ExternalParentId>
<Id>String</Id>
</Action>
</ActionsToTake>
<AllowProgrammaticTrigger>false</AllowProgrammaticTrigger>
<ConditionGroupItems>
<ConditionGroupItem>
<BooleanOperator>String</BooleanOperator>
<ConditionGroups>
<ConditionGroup>
<BooleanOperator>String</BooleanOperator>
<Condition>
<ComparisonOperator>LTE</ComparisonOperator>
<ValueComparedTo>String</ValueComparedTo>
<ValueToCompare>String</ValueToCompare>
</Condition>
<GroupIdentifier>0</GroupIdentifier>
<Precedence>0</Precedence>
</ConditionGroup>
</ConditionGroups>
<GroupIdentifier>0</GroupIdentifier>
<Precedence>0</Precedence>
</ConditionGroupItem>
</ConditionGroupItems>
<Data xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringanyType>
<d2p1:Key>value</d2p1:Key>
<d2p1:Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">String</d2p1:Value>
</d2p1:KeyValueOfstringanyType>
</Data>
<Enabled>false</Enabled>
<Id>String</Id>
<LastUpdated>0001-01-01T00:00:00</LastUpdated>
<ModulePipeline xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Integration">
<d2p1:RuleModuleDefinition>
<d2p1:IsOutputModule>false</d2p1:IsOutputModule>
<d2p1:Name>String</d2p1:Name>
<d2p1:OutputAction>
<ActionToTake>String</ActionToTake>
<CallType>String</CallType>
<Data>String</Data>
<DataTree xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringanyType>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value />
</d5p1:KeyValueOfstringanyType>
</DataTree>
<DataTypes xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringanyType>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value />
</d5p1:KeyValueOfstringanyType>
</DataTypes>
<DeleteTypeIfNotExists>String</DeleteTypeIfNotExists>
<Destination>String</Destination>
<ExternalId>String</ExternalId>
<ExternalParentId>String</ExternalParentId>
<Id>String</Id>
</d2p1:OutputAction>
<d2p1:Parameters xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</d2p1:Parameters>
<d2p1:Prerequisites xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</d2p1:Prerequisites>
<d2p1:Type>String</d2p1:Type>
</d2p1:RuleModuleDefinition>
</ModulePipeline>
<Name>String</Name>
<ObjectType>String</ObjectType>
<Teams xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Teams>
<WorkdayRestricted>false</WorkdayRestricted>
<WorkspaceId>String</WorkspaceId>
<_data>String</_data>
</IntegrationRule>