Field Squared API Services

<back to all web services

DiscreetDocumentSchema

The following routes are available for this service:
GET, PUT, POST, DELETE/{Workspace}/DiscreetDocumentSchema
GET, PUT POST, DELETE/{Workspace}/DiscreetDocumentSchema/{Type}
import 'package:servicestack/servicestack.dart';

class DiscreetDocumentField implements IConvertible
{
    String? Key;
    String? Name;
    String? Description;
    String? DataType;
    bool? Indexed;

    DiscreetDocumentField({this.Key,this.Name,this.Description,this.DataType,this.Indexed});
    DiscreetDocumentField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Name = json['Name'];
        Description = json['Description'];
        DataType = json['DataType'];
        Indexed = json['Indexed'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Name': Name,
        'Description': Description,
        'DataType': DataType,
        'Indexed': Indexed
    };

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

class DiscreetDocumentSchema implements IConvertible
{
    String? Workspace;
    String? Created;
    String? LastUpdated;
    String? Type;
    String? Name;
    String? Description;
    List<DiscreetDocumentField>? FieldDefs;
    bool? Enabled;

    DiscreetDocumentSchema({this.Workspace,this.Created,this.LastUpdated,this.Type,this.Name,this.Description,this.FieldDefs,this.Enabled});
    DiscreetDocumentSchema.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        Created = json['Created'];
        LastUpdated = json['LastUpdated'];
        Type = json['Type'];
        Name = json['Name'];
        Description = json['Description'];
        FieldDefs = JsonConverters.fromJson(json['FieldDefs'],'List<DiscreetDocumentField>',context!);
        Enabled = json['Enabled'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'Created': Created,
        'LastUpdated': LastUpdated,
        'Type': Type,
        'Name': Name,
        'Description': Description,
        'FieldDefs': JsonConverters.toJson(FieldDefs,'List<DiscreetDocumentField>',context!),
        'Enabled': Enabled
    };

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

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

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

POST /{Workspace}/DiscreetDocumentSchema HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Workspace":"String","Created":"String","LastUpdated":"String","Type":"String","Name":"String","Description":"String","FieldDefs":[{"Key":"String","Name":"String","Description":"String","DataType":"String","Indexed":false}],"Enabled":false}