Trendsic Platform Service

<back to all web services

EngineRunsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/engine/runs
import 'package:servicestack/servicestack.dart';

class WorkflowRunStepView implements IConvertible
{
    int? StepId;
    String? NodeId;
    String? Name;
    String? Kind;
    String? Status;
    int? DurationMs;
    String? Input;
    String? Output;
    String? Note;
    String? BranchReason;
    int? Attempts;

    WorkflowRunStepView({this.StepId,this.NodeId,this.Name,this.Kind,this.Status,this.DurationMs,this.Input,this.Output,this.Note,this.BranchReason,this.Attempts});
    WorkflowRunStepView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StepId = json['StepId'];
        NodeId = json['NodeId'];
        Name = json['Name'];
        Kind = json['Kind'];
        Status = json['Status'];
        DurationMs = json['DurationMs'];
        Input = json['Input'];
        Output = json['Output'];
        Note = json['Note'];
        BranchReason = json['BranchReason'];
        Attempts = json['Attempts'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StepId': StepId,
        'NodeId': NodeId,
        'Name': Name,
        'Kind': Kind,
        'Status': Status,
        'DurationMs': DurationMs,
        'Input': Input,
        'Output': Output,
        'Note': Note,
        'BranchReason': BranchReason,
        'Attempts': Attempts
    };

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

class WorkflowRunView implements IConvertible
{
    int? RunId;
    String? RunKey;
    int? WorkflowId;
    String? WorkflowName;
    int? VersionNum;
    String? Status;
    String? RecordLabel;
    String? RecordHref;
    String? WaitReason;
    DateTime? RunAfter;
    int? Attempts;
    int? MaxAttempts;
    DateTime? StartedAt;
    DateTime? FinishedAt;
    int? DurationMs;
    List<WorkflowRunStepView>? Steps = [];

    WorkflowRunView({this.RunId,this.RunKey,this.WorkflowId,this.WorkflowName,this.VersionNum,this.Status,this.RecordLabel,this.RecordHref,this.WaitReason,this.RunAfter,this.Attempts,this.MaxAttempts,this.StartedAt,this.FinishedAt,this.DurationMs,this.Steps});
    WorkflowRunView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RunId = json['RunId'];
        RunKey = json['RunKey'];
        WorkflowId = json['WorkflowId'];
        WorkflowName = json['WorkflowName'];
        VersionNum = json['VersionNum'];
        Status = json['Status'];
        RecordLabel = json['RecordLabel'];
        RecordHref = json['RecordHref'];
        WaitReason = json['WaitReason'];
        RunAfter = JsonConverters.fromJson(json['RunAfter'],'DateTime',context!);
        Attempts = json['Attempts'];
        MaxAttempts = json['MaxAttempts'];
        StartedAt = JsonConverters.fromJson(json['StartedAt'],'DateTime',context!);
        FinishedAt = JsonConverters.fromJson(json['FinishedAt'],'DateTime',context!);
        DurationMs = json['DurationMs'];
        Steps = JsonConverters.fromJson(json['Steps'],'List<WorkflowRunStepView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RunId': RunId,
        'RunKey': RunKey,
        'WorkflowId': WorkflowId,
        'WorkflowName': WorkflowName,
        'VersionNum': VersionNum,
        'Status': Status,
        'RecordLabel': RecordLabel,
        'RecordHref': RecordHref,
        'WaitReason': WaitReason,
        'RunAfter': JsonConverters.toJson(RunAfter,'DateTime',context!),
        'Attempts': Attempts,
        'MaxAttempts': MaxAttempts,
        'StartedAt': JsonConverters.toJson(StartedAt,'DateTime',context!),
        'FinishedAt': JsonConverters.toJson(FinishedAt,'DateTime',context!),
        'DurationMs': DurationMs,
        'Steps': JsonConverters.toJson(Steps,'List<WorkflowRunStepView>',context!)
    };

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

class EngineRunsResponse implements IConvertible
{
    List<WorkflowRunView>? Runs = [];
    ResponseStatus? ResponseStatus;

    EngineRunsResponse({this.Runs,this.ResponseStatus});
    EngineRunsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Runs = JsonConverters.fromJson(json['Runs'],'List<WorkflowRunView>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Runs': JsonConverters.toJson(Runs,'List<WorkflowRunView>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class EngineRunsRequest implements IConvertible
{
    String? Status;
    int? WorkflowId;
    int? Top;

    EngineRunsRequest({this.Status,this.WorkflowId,this.Top});
    EngineRunsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Status = json['Status'];
        WorkflowId = json['WorkflowId'];
        Top = json['Top'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Status': Status,
        'WorkflowId': WorkflowId,
        'Top': Top
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'WorkflowRunStepView': TypeInfo(TypeOf.Class, create:() => WorkflowRunStepView()),
    'WorkflowRunView': TypeInfo(TypeOf.Class, create:() => WorkflowRunView()),
    'List<WorkflowRunStepView>': TypeInfo(TypeOf.Class, create:() => <WorkflowRunStepView>[]),
    'EngineRunsResponse': TypeInfo(TypeOf.Class, create:() => EngineRunsResponse()),
    'List<WorkflowRunView>': TypeInfo(TypeOf.Class, create:() => <WorkflowRunView>[]),
    'EngineRunsRequest': TypeInfo(TypeOf.Class, create:() => EngineRunsRequest()),
});

Dart EngineRunsRequest DTOs

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

HTTP + CSV

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

GET /v1/engine/runs HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Runs":[{"RunId":0,"RunKey":"String","WorkflowId":0,"WorkflowName":"String","VersionNum":0,"Status":"String","RecordLabel":"String","RecordHref":"String","WaitReason":"String","RunAfter":"0001-01-01T00:00:00.0000000","Attempts":0,"MaxAttempts":0,"StartedAt":"0001-01-01T00:00:00.0000000","FinishedAt":"0001-01-01T00:00:00.0000000","DurationMs":0,"Steps":[{"StepId":0,"NodeId":"String","Name":"String","Kind":"String","Status":"String","DurationMs":0,"Input":"String","Output":"String","Note":"String","BranchReason":"String","Attempts":0}]}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}