Field Squared API Services

<back to all web services

InventoryTree

The following routes are available for this service:
GET/{Workspace}/InventoryTree
import 'package:servicestack/servicestack.dart';

class InventoryTree implements IConvertible
{
    String? Workspace;
    bool? IncludeInactive;
    String? OwningAsset;
    String? OwningTask;

    InventoryTree({this.Workspace,this.IncludeInactive,this.OwningAsset,this.OwningTask});
    InventoryTree.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        IncludeInactive = json['IncludeInactive'];
        OwningAsset = json['OwningAsset'];
        OwningTask = json['OwningTask'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'IncludeInactive': IncludeInactive,
        'OwningAsset': OwningAsset,
        'OwningTask': OwningTask
    };

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

abstract class InventoryTreeNode
{
    String? Type;
    int? DescendantCount;

    InventoryTreeNode({this.Type,this.DescendantCount});
    InventoryTreeNode.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Type': Type,
        'DescendantCount': DescendantCount
    };

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

class InventoryTreeResponse implements IConvertible
{
    int? RecordsAvailable;
    List<InventoryTreeNode>? Tree;

    InventoryTreeResponse({this.RecordsAvailable,this.Tree});
    InventoryTreeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'RecordsAvailable': RecordsAvailable,
        'Tree': JsonConverters.toJson(Tree,'List<InventoryTreeNode>',context!)
    };

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

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

Dart InventoryTree 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}/InventoryTree HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	RecordsAvailable: 0,
	Tree: 
	[
		{
			
		}
	]
}