Field Squared API Services

<back to all web services

RuleModuleOutput

Returns output of each module for the rule specified. When called without a requestid, the rule will be
executed by an integration server and the shape and first 10 rows of the output of each module will be stored. The service will return a requestID. When
queried with a previously generated requestid, the service will return the stored data if it's available.

The following routes are available for this service:
GET/{Workspace}/RuleModuleOutput/{RuleId}
GET/{Workspace}/RuleModuleOutput/ReturnLast/{RuleId}
import 'package:servicestack/servicestack.dart';

class MetadataItem implements IConvertible
{
    String? Name;
    String? Datatype;
    String? Length;
    String? Label;

    MetadataItem({this.Name,this.Datatype,this.Length,this.Label});
    MetadataItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        Datatype = json['Datatype'];
        Length = json['Length'];
        Label = json['Label'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'Datatype': Datatype,
        'Length': Length,
        'Label': Label
    };

    getTypeName() => "MetadataItem";
    TypeContext? context = _ctx;
}

class IntegrationDataTable implements IConvertible
{
    String? Name;
    List<MetadataItem>? Columns;
    List<List<String>>? Rows;

    IntegrationDataTable({this.Name,this.Columns,this.Rows});
    IntegrationDataTable.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        Columns = JsonConverters.fromJson(json['Columns'],'List<MetadataItem>',context!);
        Rows = JsonConverters.fromJson(json['Rows'],'List<List<String>>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'Columns': JsonConverters.toJson(Columns,'List<MetadataItem>',context!),
        'Rows': JsonConverters.toJson(Rows,'List<List<String>>',context!)
    };

    getTypeName() => "IntegrationDataTable";
    TypeContext? context = _ctx;
}

/**
* Returns output of each module for the rule specified.  When called without a requestid, the rule will be executed by an integration server and the shape and first 10 rows of the output of each module will be stored.  The service will return a requestID.  When queried with a previously generated requestid, the service will return the stored data if it's available. 
*/
class RuleModuleOutput implements IConvertible
{
    String? Workspace;
    String? RuleId;
    String? RequestId;
    List<IntegrationDataTable>? DataTables;

    RuleModuleOutput({this.Workspace,this.RuleId,this.RequestId,this.DataTables});
    RuleModuleOutput.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        RuleId = json['RuleId'];
        RequestId = json['RequestId'];
        DataTables = JsonConverters.fromJson(json['DataTables'],'List<IntegrationDataTable>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'RuleId': RuleId,
        'RequestId': RequestId,
        'DataTables': JsonConverters.toJson(DataTables,'List<IntegrationDataTable>',context!)
    };

    getTypeName() => "RuleModuleOutput";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'MetadataItem': TypeInfo(TypeOf.Class, create:() => MetadataItem()),
    'IntegrationDataTable': TypeInfo(TypeOf.Class, create:() => IntegrationDataTable()),
    'List<MetadataItem>': TypeInfo(TypeOf.Class, create:() => <MetadataItem>[]),
    'List<List<String>>': TypeInfo(TypeOf.Class, create:() => <List<String>>[]),
    'RuleModuleOutput': TypeInfo(TypeOf.Class, create:() => RuleModuleOutput()),
    'List<IntegrationDataTable>': TypeInfo(TypeOf.Class, create:() => <IntegrationDataTable>[]),
});

Dart RuleModuleOutput DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /{Workspace}/RuleModuleOutput/{RuleId} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml