Field Squared API Services

<back to all web services

InternalMetadata

Returns a standardized metadata for an internal object.

The following routes are available for this service:
GET/{Workspace}/InternalMetadata/{ObjectType}
GET/{Workspace}/InternalMetadata/{ObjectType}/{SubObjectType}
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;
}

/**
* Returns a standardized metadata for an internal object. 
*/
class InternalMetadata implements IConvertible
{
    String? Workspace;
    String? ObjectType;
    String? SubObjectType;
    List<MetadataItem>? Items;

    InternalMetadata({this.Workspace,this.ObjectType,this.SubObjectType,this.Items});
    InternalMetadata.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectType = json['ObjectType'];
        SubObjectType = json['SubObjectType'];
        Items = JsonConverters.fromJson(json['Items'],'List<MetadataItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectType': ObjectType,
        'SubObjectType': SubObjectType,
        'Items': JsonConverters.toJson(Items,'List<MetadataItem>',context!)
    };

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

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

Dart InternalMetadata DTOs

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

HTTP + JSV

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

GET /{Workspace}/InternalMetadata/{ObjectType} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv