Field Squared API Services

<back to all web services

IntegrationRule

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.

The following routes are available for this service:
GET,PUT,DELETE/{WorkspaceId}/IntegrationRule/{Id}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class PossibleComparisons(str, Enum):
    LTE = 'LTE'
    LT = 'LT'
    GT = 'GT'
    GTE = 'GTE'
    EQ = 'EQ'
    NE = 'NE'
    NULL = 'NULL'
    NOTNULL = 'NOTNULL'
    CHG = 'CHG'
    STARTS = 'STARTS'
    LIKE = 'LIKE'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Condition:
    value_compared_to: Optional[str] = None
    value_to_compare: Optional[str] = None
    comparison_operator: Optional[PossibleComparisons] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConditionGroup:
    condition: Optional[Condition] = None
    precedence: int = 0
    group_identifier: int = 0
    boolean_operator: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConditionGroupItem:
    condition_groups: Optional[List[ConditionGroup]] = None
    precedence: int = 0
    group_identifier: int = 0
    boolean_operator: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Action:
    id: Optional[str] = None
    call_type: Optional[str] = None
    action_to_take: Optional[str] = None
    destination: Optional[str] = None
    external_id: Optional[str] = None
    external_parent_id: Optional[str] = None
    delete_type_if_not_exists: Optional[str] = None
    data_tree: Optional[Dict[str, Object]] = None
    data: Optional[str] = None
    data_types: Optional[Dict[str, Object]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RuleModuleDefinition:
    is_output_module: bool = False
    name: Optional[str] = None
    prerequisites: Optional[List[str]] = None
    parameters: Optional[Dict[str, Object]] = None
    type: Optional[str] = None
    output_action: Optional[Action] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IntegrationRule:
    """
    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.
    """

    workspace_id: Optional[str] = None
    name: Optional[str] = None
    data: Optional[Dict[str, Object]] = None
    object_type: Optional[str] = None
    id: Optional[str] = None
    condition_group_items: Optional[List[ConditionGroupItem]] = None
    actions_to_take: Optional[List[Action]] = None
    last_updated: datetime.datetime = datetime.datetime(1, 1, 1)
    module_pipeline: Optional[List[RuleModuleDefinition]] = None
    enabled: bool = False
    workday_restricted: bool = False
    teams: Optional[List[str]] = None
    allow_programmatic_trigger: bool = False

Python IntegrationRule 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

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"WorkspaceId":"String","Name":"String","Data":{"value":"String"},"ObjectType":"String","Id":"String","ConditionGroupItems":[{"ConditionGroups":[{"Condition":{"ValueComparedTo":"String","ValueToCompare":"String","ComparisonOperator":"LTE"},"Precedence":0,"GroupIdentifier":0,"BooleanOperator":"String"}],"Precedence":0,"GroupIdentifier":0,"BooleanOperator":"String"}],"ActionsToTake":[{"Id":"String","CallType":"String","ActionToTake":"String","Destination":"String","ExternalId":"String","ExternalParentId":"String","DeleteTypeIfNotExists":"String","DataTree":{"String":{}},"Data":"String","DataTypes":{"String":{}}}],"LastUpdated":"\/Date(-62135596800000-0000)\/","ModulePipeline":[{"IsOutputModule":false,"Name":"String","Prerequisites":["String"],"Parameters":{"String":{}},"Type":"String","OutputAction":{"Id":"String","CallType":"String","ActionToTake":"String","Destination":"String","ExternalId":"String","ExternalParentId":"String","DeleteTypeIfNotExists":"String","DataTree":{"String":{}},"Data":"String","DataTypes":{"String":{}}}}],"Enabled":false,"WorkdayRestricted":false,"Teams":["String"],"AllowProgrammaticTrigger":false}