CoreService

<back to all web services

GetActionDefinition

Action - CRUD

Returns the definition

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/actions/{Id}/definitionReturns the action definition
GET/actions/{Id}/definitionReturns the action definition
import 'package:servicestack/servicestack.dart';

class TemplateDefinitionDto implements IConvertible
{
    /**
    * The schema version of the attached definition
    */
    int schemaVersion = 0;
    /**
    * The template definition/body either as json or yaml
    */
    String definition = "";

    TemplateDefinitionDto({this.schemaVersion,this.definition});
    TemplateDefinitionDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        schemaVersion = json['schemaVersion'];
        definition = json['definition'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'schemaVersion': schemaVersion,
        'definition': definition
    };

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

enum TemplateLanguages
{
    Json,
    Yaml,
}

/**
* Returns the definition
*/
// @Api(Description="Returns the definition")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(TemplateDefinitionDto), StatusCode=200)
class GetActionDefinition implements IGetSingleRequest, IHasTenantName, IGet, IConvertible
{
    // @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
    String id = "";

    // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    // @Validate(Validator="NotEmpty")
    String tenantName = "";

    // @ApiMember(IsRequired=true, ParameterType="query")
    TemplateLanguages definitionFormat;

    /**
    * If true, also soft deleted items will be returned
    */
    // @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
    bool? includeDeleted;

    // @ApiMember(ParameterType="query", Verb="GET")
    bool? includeReferencedObjects;

    GetActionDefinition({this.id,this.tenantName,this.definitionFormat,this.includeDeleted,this.includeReferencedObjects});
    GetActionDefinition.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        tenantName = json['tenantName'];
        definitionFormat = JsonConverters.fromJson(json['definitionFormat'],'TemplateLanguages',context!);
        includeDeleted = json['includeDeleted'];
        includeReferencedObjects = json['includeReferencedObjects'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'tenantName': tenantName,
        'definitionFormat': JsonConverters.toJson(definitionFormat,'TemplateLanguages',context!),
        'includeDeleted': includeDeleted,
        'includeReferencedObjects': includeReferencedObjects
    };

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

TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
    'TemplateDefinitionDto': TypeInfo(TypeOf.Class, create:() => TemplateDefinitionDto()),
    'TemplateLanguages': TypeInfo(TypeOf.Enum, enumValues:TemplateLanguages.values),
    'GetActionDefinition': TypeInfo(TypeOf.Class, create:() => GetActionDefinition()),
});

Dart GetActionDefinition 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.

GET /api/actions/{Id}/definition HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"schemaVersion":0,"definition":"String"}