Trendsic Platform Service

<back to all web services

ReportManagerObjectFieldsRequest

The following routes are available for this service:
GET,OPTIONS/v1/ReportManager/api/Objects/{Table}/fields
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

abstract class ReportManagerRequest<T>
{
    ReportManagerRequest();
    ReportManagerRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "ReportManagerRequest<$T>";
    TypeContext? context = _ctx;
}

// @DataContract
class ReportManagerObjectData implements IConvertible
{
    // @DataMember(Name="id")
    String? id;

    // @DataMember(Name="name")
    String? name;

    // @DataMember(Name="filter")
    bool? filter;

    // @DataMember(Name="edit")
    bool? edit;

    // @DataMember(Name="type")
    String? type;

    // @DataMember(Name="ref")
    String? ref;

    // @DataMember(Name="key")
    bool? key;

    // @DataMember(Name="show")
    bool? Show;

    ReportManagerObjectData({this.id,this.name,this.filter,this.edit,this.type,this.ref,this.key,this.Show});
    ReportManagerObjectData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['ID'];
        name = json['Name'];
        filter = json['Filter'];
        edit = json['Edit'];
        type = json['TypeName'];
        ref = json['Ref'];
        key = json['IsKey'];
        Show = json['IsLabel'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'filter': filter,
        'edit': edit,
        'type': type,
        'ref': ref,
        'key': key,
        'Show': Show
    };

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

// @DataContract
class ReportManagerObjectRef implements IConvertible
{
    // @DataMember(Name="id")
    int? id;

    // @DataMember(Name="target")
    String? target;

    // @DataMember(Name="source")
    String? source;

    // @DataMember(Name="name")
    String? name;

    ReportManagerObjectRef({this.id,this.target,this.source,this.name});
    ReportManagerObjectRef.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['ID'];
        target = json['Target'];
        source = json['Source'];
        name = json['Name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'target': target,
        'source': source,
        'name': name
    };

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

// @DataContract
class ReportManagerObject implements IReportManagerDocument, IConvertible
{
    // @DataMember(Name="id")
    String? id;

    // @DataMember(Name="name")
    String? name;

    // @DataMember(Name="data")
    List<ReportManagerObjectData>? data = [];

    // @DataMember(Name="refs")
    List<ReportManagerObjectRef>? refs = [];

    ReportManagerObject({this.id,this.name,this.data,this.refs});
    ReportManagerObject.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['ID'];
        name = json['Name'];
        data = JsonConverters.fromJson(json['Fields'],'List<ReportManagerObjectData>',context!);
        refs = JsonConverters.fromJson(json['References'],'List<ReportManagerObjectRef>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'data': JsonConverters.toJson(data,'List<ReportManagerObjectData>',context!),
        'refs': JsonConverters.toJson(refs,'List<ReportManagerObjectRef>',context!)
    };

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

class ReportManagerObjectFieldsRequest extends ReportManagerRequest<ReportManagerObject> implements IConvertible
{
    String? Table;

    ReportManagerObjectFieldsRequest({this.Table});
    ReportManagerObjectFieldsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Table = json['Table'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Table': Table
    });

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'ReportManagerRequest<T>': TypeInfo(TypeOf.GenericDef,create:() => ReportManagerRequest()),
    'ReportManagerObjectData': TypeInfo(TypeOf.Class, create:() => ReportManagerObjectData()),
    'ReportManagerObjectRef': TypeInfo(TypeOf.Class, create:() => ReportManagerObjectRef()),
    'ReportManagerObject': TypeInfo(TypeOf.Class, create:() => ReportManagerObject()),
    'List<ReportManagerObjectData>': TypeInfo(TypeOf.Class, create:() => <ReportManagerObjectData>[]),
    'List<ReportManagerObjectRef>': TypeInfo(TypeOf.Class, create:() => <ReportManagerObjectRef>[]),
    'ReportManagerObjectFieldsRequest': TypeInfo(TypeOf.Class, create:() => ReportManagerObjectFieldsRequest()),
});

Dart ReportManagerObjectFieldsRequest 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 /v1/ReportManager/api/Objects/{Table}/fields HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

[{"id":"String","name":"String","data":[{"id":"String","name":"String","filter":false,"edit":false,"type":"String","ref":"String","key":false,"show":false}],"refs":[{"id":0,"target":"String","source":"String","name":"String"}]}]