Field Squared API Services

<back to all web services

AssetQuery

/{Workspace}/AssetQuery allows flexible querying of assets using structured filters.
Supports various operators (eq, ne, contains, in, gt, lt, exists) for precise asset searches.
Can query by core fields (type, name, created) and custom data fields (data.EID, data.FDH_ID, etc.).
Example: POST with filters for exact matches on type='FDH' and data.EID='specific-value'

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

class QueryFilter implements IConvertible
{
    String? Field;
    String? Operator;
    dynamic? Value;

    QueryFilter({this.Field,this.Operator,this.Value});
    QueryFilter.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Field = json['Field'];
        Operator = json['Operator'];
        Value = JsonConverters.fromJson(json['Value'],'dynamic',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Field': Field,
        'Operator': Operator,
        'Value': JsonConverters.toJson(Value,'dynamic',context!)
    };

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

class SortCriteria implements IConvertible
{
    String? Field;
    String? Direction;

    SortCriteria({this.Field,this.Direction});
    SortCriteria.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Field': Field,
        'Direction': Direction
    };

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

/**
* /{Workspace}/AssetQuery allows flexible querying of assets using structured filters.Supports various operators (eq, ne, contains, in, gt, lt, exists) for precise asset searches.Can query by core fields (type, name, created) and custom data fields (data.EID, data.FDH_ID, etc.).Example: POST with filters for exact matches on type='FDH' and data.EID='specific-value'
*/
class AssetQuery implements IConvertible
{
    String? Workspace;
    List<QueryFilter>? Filters;
    int? RecStart;
    int? RecCount;
    List<SortCriteria>? Sort;
    bool? SuppressGeometry;

    AssetQuery({this.Workspace,this.Filters,this.RecStart,this.RecCount,this.Sort,this.SuppressGeometry});
    AssetQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        Filters = JsonConverters.fromJson(json['Filters'],'List<QueryFilter>',context!);
        RecStart = json['RecStart'];
        RecCount = json['RecCount'];
        Sort = JsonConverters.fromJson(json['Sort'],'List<SortCriteria>',context!);
        SuppressGeometry = json['SuppressGeometry'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'Filters': JsonConverters.toJson(Filters,'List<QueryFilter>',context!),
        'RecStart': RecStart,
        'RecCount': RecCount,
        'Sort': JsonConverters.toJson(Sort,'List<SortCriteria>',context!),
        'SuppressGeometry': SuppressGeometry
    };

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

class Schedule implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? VersionId;
    String? BasedOn;
    String? Start;
    String? End;
    String? TimeZone;
    List<String>? Users;
    List<String>? Teams;
    Map<String,dynamic?>? Data;

    Schedule({this.Workspace,this.ObjectId,this.VersionId,this.BasedOn,this.Start,this.End,this.TimeZone,this.Users,this.Teams,this.Data});
    Schedule.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        BasedOn = json['BasedOn'];
        Start = json['Start'];
        End = json['End'];
        TimeZone = json['TimeZone'];
        Users = JsonConverters.fromJson(json['Users'],'List<String>',context!);
        Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
        Data = JsonConverters.fromJson(json['Data'],'Map<String,dynamic?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'BasedOn': BasedOn,
        'Start': Start,
        'End': End,
        'TimeZone': TimeZone,
        'Users': JsonConverters.toJson(Users,'List<String>',context!),
        'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
        'Data': JsonConverters.toJson(Data,'Map<String,dynamic?>',context!)
    };

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

class DomainItem implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? VersionId;
    String? LastUpdated;

    DomainItem({this.Workspace,this.ObjectId,this.VersionId,this.LastUpdated});
    DomainItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        LastUpdated = json['LastUpdated'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'LastUpdated': LastUpdated
    };

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

class Location implements IConvertible
{
    double? y;
    double? x;

    Location({this.y,this.x});
    Location.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        y = JsonConverters.toDouble(json['y']);
        x = JsonConverters.toDouble(json['x']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'y': y,
        'x': x
    };

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

class Geometry implements IConvertible
{
    String? Type;
    List<Location>? Coordinates;

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

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

    Map<String, dynamic> toJson() => {
        'Type': Type,
        'Coordinates': JsonConverters.toJson(Coordinates,'List<Location>',context!)
    };

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

class MaintenanceRecord implements IConvertible
{
    String? DateTime;
    String? Notes;

    MaintenanceRecord({this.DateTime,this.Notes});
    MaintenanceRecord.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'DateTime': DateTime,
        'Notes': Notes
    };

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

class LocationHistory implements IConvertible
{
    String? Date;
    Location? Location;
    String? Barcode;
    String? Notes;
    bool? IsScan;

    LocationHistory({this.Date,this.Location,this.Barcode,this.Notes,this.IsScan});
    LocationHistory.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Date = json['Date'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        Barcode = json['Barcode'];
        Notes = json['Notes'];
        IsScan = json['IsScan'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Date': Date,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'Barcode': Barcode,
        'Notes': Notes,
        'IsScan': IsScan
    };

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

class ClassedItem implements IConvertible
{
    String? ObjectId;
    String? Class;
    String? VersionId;
    List<String>? Ancestors;
    String? Type;

    ClassedItem({this.ObjectId,this.Class,this.VersionId,this.Ancestors,this.Type});
    ClassedItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Class = json['Class'];
        VersionId = json['VersionId'];
        Ancestors = JsonConverters.fromJson(json['Ancestors'],'List<String>',context!);
        Type = json['Type'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Class': Class,
        'VersionId': VersionId,
        'Ancestors': JsonConverters.toJson(Ancestors,'List<String>',context!),
        'Type': Type
    };

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

class EventItem implements IConvertible
{
    String? ObjectId;
    String? Date;
    Location? Location;
    String? Barcode;
    String? Details;
    String? Type;
    bool? IsScan;
    String? User;
    String? SelectedBy;
    String? Status;
    String? StatusType;
    String? DateCreated;
    bool? Automatic;

    EventItem({this.ObjectId,this.Date,this.Location,this.Barcode,this.Details,this.Type,this.IsScan,this.User,this.SelectedBy,this.Status,this.StatusType,this.DateCreated,this.Automatic});
    EventItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Date = json['Date'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        Barcode = json['Barcode'];
        Details = json['Details'];
        Type = json['Type'];
        IsScan = json['IsScan'];
        User = json['User'];
        SelectedBy = json['SelectedBy'];
        Status = json['Status'];
        StatusType = json['StatusType'];
        DateCreated = json['DateCreated'];
        Automatic = json['Automatic'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Date': Date,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'Barcode': Barcode,
        'Details': Details,
        'Type': Type,
        'IsScan': IsScan,
        'User': User,
        'SelectedBy': SelectedBy,
        'Status': Status,
        'StatusType': StatusType,
        'DateCreated': DateCreated,
        'Automatic': Automatic
    };

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

class Anno implements IConvertible
{
    double? X;
    double? Y;
    double? R;
    double? S;
    String? T;

    Anno({this.X,this.Y,this.R,this.S,this.T});
    Anno.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        X = JsonConverters.toDouble(json['X']);
        Y = JsonConverters.toDouble(json['Y']);
        R = JsonConverters.toDouble(json['R']);
        S = JsonConverters.toDouble(json['S']);
        T = json['T'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'X': X,
        'Y': Y,
        'R': R,
        'S': S,
        'T': T
    };

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

class AddressBasic implements IConvertible
{
    String? Street;
    String? Unit;
    String? City;
    String? State;
    String? Zip;
    String? Country;
    Location? Location;

    AddressBasic({this.Street,this.Unit,this.City,this.State,this.Zip,this.Country,this.Location});
    AddressBasic.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Street = json['Street'];
        Unit = json['Unit'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        Country = json['Country'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Street': Street,
        'Unit': Unit,
        'City': City,
        'State': State,
        'Zip': Zip,
        'Country': Country,
        'Location': JsonConverters.toJson(Location,'Location',context!)
    };

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

class CustomDataField implements IConvertible
{
    String? Binding;
    String? Label;
    dynamic? Value;
    String? DataType;
    bool? IsReadOnly;
    bool? IsHidden;
    String? Values;

    CustomDataField({this.Binding,this.Label,this.Value,this.DataType,this.IsReadOnly,this.IsHidden,this.Values});
    CustomDataField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Binding = json['Binding'];
        Label = json['Label'];
        Value = JsonConverters.fromJson(json['Value'],'dynamic',context!);
        DataType = json['DataType'];
        IsReadOnly = json['IsReadOnly'];
        IsHidden = json['IsHidden'];
        Values = json['Values'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Binding': Binding,
        'Label': Label,
        'Value': JsonConverters.toJson(Value,'dynamic',context!),
        'DataType': DataType,
        'IsReadOnly': IsReadOnly,
        'IsHidden': IsHidden,
        'Values': Values
    };

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

/**
* Contains the data for an asset within the system.
*/
class Asset implements IConvertible
{
    String? Workspace;
    String? TimeZone;
    String? AssignedWorkspace;
    String? ObjectId;
    String? VersionId;
    String? BasedOn;
    String? ExternalId;
    String? Created;
    String? LastUpdated;
    String? Name;
    List<Schedule>? Schedules;
    List<DomainItem>? Documents;
    List<DomainItem>? Tasks;
    List<String>? TaskSeries;
    List<String>? TaskSeriesTemplates;
    List<DomainItem>? Users;
    String? Type;
    String? Symbol;
    Map<String,String?>? Data;
    Geometry? Geometry;
    List<MaintenanceRecord>? MaintenanceHistory;
    String? Parent;
    List<String>? Ancestors;
    List<LocationHistory>? LocationHistory;
    ClassedItem? Owner;
    bool? IsParent;
    List<String>? Assets;
    List<String>? Contacts;
    String? GeometryString;
    String? SourceProjection;
    List<EventItem>? Events;
    Anno? Anno;
    List<String>? Teams;
    AddressBasic? Address;
    String? CreatedBy;
    List<String>? InventoryItems;
    Map<String,dynamic?>? ActiveLaborTypes;
    int? Levels;
    int? AllAssests;
    String? Barcode;
    List<CustomDataField>? CustomDataFields;

    Asset({this.Workspace,this.TimeZone,this.AssignedWorkspace,this.ObjectId,this.VersionId,this.BasedOn,this.ExternalId,this.Created,this.LastUpdated,this.Name,this.Schedules,this.Documents,this.Tasks,this.TaskSeries,this.TaskSeriesTemplates,this.Users,this.Type,this.Symbol,this.Data,this.Geometry,this.MaintenanceHistory,this.Parent,this.Ancestors,this.LocationHistory,this.Owner,this.IsParent,this.Assets,this.Contacts,this.GeometryString,this.SourceProjection,this.Events,this.Anno,this.Teams,this.Address,this.CreatedBy,this.InventoryItems,this.ActiveLaborTypes,this.Levels,this.AllAssests,this.Barcode,this.CustomDataFields});
    Asset.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        TimeZone = json['TimeZone'];
        AssignedWorkspace = json['AssignedWorkspace'];
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        BasedOn = json['BasedOn'];
        ExternalId = json['ExternalId'];
        Created = json['Created'];
        LastUpdated = json['LastUpdated'];
        Name = json['Name'];
        Schedules = JsonConverters.fromJson(json['Schedules'],'List<Schedule>',context!);
        Documents = JsonConverters.fromJson(json['Documents'],'List<DomainItem>',context!);
        Tasks = JsonConverters.fromJson(json['Tasks'],'List<DomainItem>',context!);
        TaskSeries = JsonConverters.fromJson(json['TaskSeries'],'List<String>',context!);
        TaskSeriesTemplates = JsonConverters.fromJson(json['TaskSeriesTemplates'],'List<String>',context!);
        Users = JsonConverters.fromJson(json['Users'],'List<DomainItem>',context!);
        Type = json['Type'];
        Symbol = json['Symbol'];
        Data = JsonConverters.toStringMap(json['Data']);
        Geometry = JsonConverters.fromJson(json['Geometry'],'Geometry',context!);
        MaintenanceHistory = JsonConverters.fromJson(json['MaintenanceHistory'],'List<MaintenanceRecord>',context!);
        Parent = json['Parent'];
        Ancestors = JsonConverters.fromJson(json['Ancestors'],'List<String>',context!);
        LocationHistory = JsonConverters.fromJson(json['LocationHistory'],'List<LocationHistory>',context!);
        Owner = JsonConverters.fromJson(json['Owner'],'ClassedItem',context!);
        IsParent = json['IsParent'];
        Assets = JsonConverters.fromJson(json['Assets'],'List<String>',context!);
        Contacts = JsonConverters.fromJson(json['Contacts'],'List<String>',context!);
        GeometryString = json['GeometryString'];
        SourceProjection = json['SourceProjection'];
        Events = JsonConverters.fromJson(json['Events'],'List<EventItem>',context!);
        Anno = JsonConverters.fromJson(json['Anno'],'Anno',context!);
        Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
        Address = JsonConverters.fromJson(json['Address'],'AddressBasic',context!);
        CreatedBy = json['CreatedBy'];
        InventoryItems = JsonConverters.fromJson(json['InventoryItems'],'List<String>',context!);
        ActiveLaborTypes = JsonConverters.fromJson(json['ActiveLaborTypes'],'Map<String,dynamic?>',context!);
        Levels = json['Levels'];
        AllAssests = json['AllAssests'];
        Barcode = json['Barcode'];
        CustomDataFields = JsonConverters.fromJson(json['CustomDataFields'],'List<CustomDataField>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'TimeZone': TimeZone,
        'AssignedWorkspace': AssignedWorkspace,
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'BasedOn': BasedOn,
        'ExternalId': ExternalId,
        'Created': Created,
        'LastUpdated': LastUpdated,
        'Name': Name,
        'Schedules': JsonConverters.toJson(Schedules,'List<Schedule>',context!),
        'Documents': JsonConverters.toJson(Documents,'List<DomainItem>',context!),
        'Tasks': JsonConverters.toJson(Tasks,'List<DomainItem>',context!),
        'TaskSeries': JsonConverters.toJson(TaskSeries,'List<String>',context!),
        'TaskSeriesTemplates': JsonConverters.toJson(TaskSeriesTemplates,'List<String>',context!),
        'Users': JsonConverters.toJson(Users,'List<DomainItem>',context!),
        'Type': Type,
        'Symbol': Symbol,
        'Data': Data,
        'Geometry': JsonConverters.toJson(Geometry,'Geometry',context!),
        'MaintenanceHistory': JsonConverters.toJson(MaintenanceHistory,'List<MaintenanceRecord>',context!),
        'Parent': Parent,
        'Ancestors': JsonConverters.toJson(Ancestors,'List<String>',context!),
        'LocationHistory': JsonConverters.toJson(LocationHistory,'List<LocationHistory>',context!),
        'Owner': JsonConverters.toJson(Owner,'ClassedItem',context!),
        'IsParent': IsParent,
        'Assets': JsonConverters.toJson(Assets,'List<String>',context!),
        'Contacts': JsonConverters.toJson(Contacts,'List<String>',context!),
        'GeometryString': GeometryString,
        'SourceProjection': SourceProjection,
        'Events': JsonConverters.toJson(Events,'List<EventItem>',context!),
        'Anno': JsonConverters.toJson(Anno,'Anno',context!),
        'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
        'Address': JsonConverters.toJson(Address,'AddressBasic',context!),
        'CreatedBy': CreatedBy,
        'InventoryItems': JsonConverters.toJson(InventoryItems,'List<String>',context!),
        'ActiveLaborTypes': JsonConverters.toJson(ActiveLaborTypes,'Map<String,dynamic?>',context!),
        'Levels': Levels,
        'AllAssests': AllAssests,
        'Barcode': Barcode,
        'CustomDataFields': JsonConverters.toJson(CustomDataFields,'List<CustomDataField>',context!)
    };

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

class AssetQueryResponse implements IConvertible
{
    List<Asset>? Assets;
    int? TotalCount;
    int? RecStart;
    int? RecCount;

    AssetQueryResponse({this.Assets,this.TotalCount,this.RecStart,this.RecCount});
    AssetQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Assets = JsonConverters.fromJson(json['Assets'],'List<Asset>',context!);
        TotalCount = json['TotalCount'];
        RecStart = json['RecStart'];
        RecCount = json['RecCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Assets': JsonConverters.toJson(Assets,'List<Asset>',context!),
        'TotalCount': TotalCount,
        'RecStart': RecStart,
        'RecCount': RecCount
    };

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

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'QueryFilter': TypeInfo(TypeOf.Class, create:() => QueryFilter()),
    'SortCriteria': TypeInfo(TypeOf.Class, create:() => SortCriteria()),
    'AssetQuery': TypeInfo(TypeOf.Class, create:() => AssetQuery()),
    'List<QueryFilter>': TypeInfo(TypeOf.Class, create:() => <QueryFilter>[]),
    'List<SortCriteria>': TypeInfo(TypeOf.Class, create:() => <SortCriteria>[]),
    'Schedule': TypeInfo(TypeOf.Class, create:() => Schedule()),
    'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
    'DomainItem': TypeInfo(TypeOf.Class, create:() => DomainItem()),
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'Geometry': TypeInfo(TypeOf.Class, create:() => Geometry()),
    'List<Location>': TypeInfo(TypeOf.Class, create:() => <Location>[]),
    'MaintenanceRecord': TypeInfo(TypeOf.Class, create:() => MaintenanceRecord()),
    'LocationHistory': TypeInfo(TypeOf.Class, create:() => LocationHistory()),
    'ClassedItem': TypeInfo(TypeOf.Class, create:() => ClassedItem()),
    'EventItem': TypeInfo(TypeOf.Class, create:() => EventItem()),
    'Anno': TypeInfo(TypeOf.Class, create:() => Anno()),
    'AddressBasic': TypeInfo(TypeOf.Class, create:() => AddressBasic()),
    'CustomDataField': TypeInfo(TypeOf.Class, create:() => CustomDataField()),
    'Asset': TypeInfo(TypeOf.Class, create:() => Asset()),
    'List<Schedule>': TypeInfo(TypeOf.Class, create:() => <Schedule>[]),
    'List<DomainItem>': TypeInfo(TypeOf.Class, create:() => <DomainItem>[]),
    'List<MaintenanceRecord>': TypeInfo(TypeOf.Class, create:() => <MaintenanceRecord>[]),
    'List<LocationHistory>': TypeInfo(TypeOf.Class, create:() => <LocationHistory>[]),
    'List<EventItem>': TypeInfo(TypeOf.Class, create:() => <EventItem>[]),
    'List<CustomDataField>': TypeInfo(TypeOf.Class, create:() => <CustomDataField>[]),
    'AssetQueryResponse': TypeInfo(TypeOf.Class, create:() => AssetQueryResponse()),
    'List<Asset>': TypeInfo(TypeOf.Class, create:() => <Asset>[]),
});

Dart AssetQuery DTOs

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

HTTP + XML

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

POST /{Workspace}/AssetQuery HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AssetQuery xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Assets">
  <Filters>
    <QueryFilter>
      <Field>String</Field>
      <Operator>String</Operator>
      <Value />
    </QueryFilter>
  </Filters>
  <RecCount>0</RecCount>
  <RecStart>0</RecStart>
  <Sort>
    <SortCriteria>
      <Direction>String</Direction>
      <Field>String</Field>
    </SortCriteria>
  </Sort>
  <SuppressGeometry>false</SuppressGeometry>
  <Workspace>String</Workspace>
</AssetQuery>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AssetQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Assets">
  <Assets xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
    <d2p1:Asset>
      <d2p1:ActiveLaborTypes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringanyType>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value />
        </d4p1:KeyValueOfstringanyType>
      </d2p1:ActiveLaborTypes>
      <d2p1:Address>
        <d2p1:City>String</d2p1:City>
        <d2p1:Country>String</d2p1:Country>
        <d2p1:Location>
          <d2p1:x>0</d2p1:x>
          <d2p1:y>0</d2p1:y>
        </d2p1:Location>
        <d2p1:State>String</d2p1:State>
        <d2p1:Street>String</d2p1:Street>
        <d2p1:Unit>String</d2p1:Unit>
        <d2p1:Zip>String</d2p1:Zip>
      </d2p1:Address>
      <d2p1:AllAssests>0</d2p1:AllAssests>
      <d2p1:Ancestors xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:Ancestors>
      <d2p1:Anno>
        <d2p1:R>0</d2p1:R>
        <d2p1:S>0</d2p1:S>
        <d2p1:T>String</d2p1:T>
        <d2p1:X>0</d2p1:X>
        <d2p1:Y>0</d2p1:Y>
      </d2p1:Anno>
      <d2p1:Assets xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:Assets>
      <d2p1:AssignedWorkspace>String</d2p1:AssignedWorkspace>
      <d2p1:Barcode>String</d2p1:Barcode>
      <d2p1:BasedOn>String</d2p1:BasedOn>
      <d2p1:Contacts xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:Contacts>
      <d2p1:Created>String</d2p1:Created>
      <d2p1:CreatedBy>String</d2p1:CreatedBy>
      <d2p1:CustomDataFields xmlns:d4p1="http://schemas.datacontract.org/2004/07/Field2Office.Core.Model.Task">
        <d4p1:CustomDataField>
          <d4p1:Binding>String</d4p1:Binding>
          <d4p1:DataType>String</d4p1:DataType>
          <d4p1:IsHidden>false</d4p1:IsHidden>
          <d4p1:IsReadOnly>false</d4p1:IsReadOnly>
          <d4p1:Label>String</d4p1:Label>
          <d4p1:Value />
          <d4p1:Values>String</d4p1:Values>
        </d4p1:CustomDataField>
      </d2p1:CustomDataFields>
      <d2p1:Data xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d2p1:Data>
      <d2p1:Documents>
        <d2p1:DomainItem>
          <d2p1:LastUpdated>String</d2p1:LastUpdated>
          <d2p1:ObjectId>String</d2p1:ObjectId>
          <d2p1:VersionId>String</d2p1:VersionId>
          <d2p1:Workspace>String</d2p1:Workspace>
        </d2p1:DomainItem>
      </d2p1:Documents>
      <d2p1:Events>
        <d2p1:EventItem>
          <d2p1:Automatic>false</d2p1:Automatic>
          <d2p1:Barcode>String</d2p1:Barcode>
          <d2p1:Date>String</d2p1:Date>
          <d2p1:DateCreated>String</d2p1:DateCreated>
          <d2p1:Details>String</d2p1:Details>
          <d2p1:IsScan>false</d2p1:IsScan>
          <d2p1:Location>
            <d2p1:x>0</d2p1:x>
            <d2p1:y>0</d2p1:y>
          </d2p1:Location>
          <d2p1:ObjectId>String</d2p1:ObjectId>
          <d2p1:SelectedBy>String</d2p1:SelectedBy>
          <d2p1:Status>String</d2p1:Status>
          <d2p1:StatusType>String</d2p1:StatusType>
          <d2p1:Type>String</d2p1:Type>
          <d2p1:User>String</d2p1:User>
        </d2p1:EventItem>
      </d2p1:Events>
      <d2p1:ExternalId>String</d2p1:ExternalId>
      <d2p1:Geometry>
        <d2p1:Coordinates>
          <d2p1:Location>
            <d2p1:x>0</d2p1:x>
            <d2p1:y>0</d2p1:y>
          </d2p1:Location>
        </d2p1:Coordinates>
        <d2p1:Type>String</d2p1:Type>
      </d2p1:Geometry>
      <d2p1:GeometryString>String</d2p1:GeometryString>
      <d2p1:InventoryItems xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:InventoryItems>
      <d2p1:IsParent>false</d2p1:IsParent>
      <d2p1:LastUpdated>String</d2p1:LastUpdated>
      <d2p1:Levels>0</d2p1:Levels>
      <d2p1:LocationHistory>
        <d2p1:LocationHistory>
          <d2p1:Barcode>String</d2p1:Barcode>
          <d2p1:Date>String</d2p1:Date>
          <d2p1:IsScan>false</d2p1:IsScan>
          <d2p1:Location>
            <d2p1:x>0</d2p1:x>
            <d2p1:y>0</d2p1:y>
          </d2p1:Location>
          <d2p1:Notes>String</d2p1:Notes>
        </d2p1:LocationHistory>
      </d2p1:LocationHistory>
      <d2p1:MaintenanceHistory>
        <d2p1:MaintenanceRecord>
          <d2p1:DateTime>String</d2p1:DateTime>
          <d2p1:Notes>String</d2p1:Notes>
        </d2p1:MaintenanceRecord>
      </d2p1:MaintenanceHistory>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:ObjectId>String</d2p1:ObjectId>
      <d2p1:Owner>
        <d2p1:Ancestors xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </d2p1:Ancestors>
        <d2p1:Class>String</d2p1:Class>
        <d2p1:ObjectId>String</d2p1:ObjectId>
        <d2p1:Type>String</d2p1:Type>
        <d2p1:VersionId>String</d2p1:VersionId>
      </d2p1:Owner>
      <d2p1:Parent>String</d2p1:Parent>
      <d2p1:Schedules xmlns:d4p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Schedules">
        <d4p1:Schedule>
          <d4p1:BasedOn>String</d4p1:BasedOn>
          <d4p1:Data xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringanyType>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value />
            </d6p1:KeyValueOfstringanyType>
          </d4p1:Data>
          <d4p1:End>String</d4p1:End>
          <d4p1:ObjectId>String</d4p1:ObjectId>
          <d4p1:Start>String</d4p1:Start>
          <d4p1:Teams xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:Teams>
          <d4p1:TimeZone>String</d4p1:TimeZone>
          <d4p1:Users xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:string>String</d6p1:string>
          </d4p1:Users>
          <d4p1:VersionId>String</d4p1:VersionId>
          <d4p1:Workspace>String</d4p1:Workspace>
        </d4p1:Schedule>
      </d2p1:Schedules>
      <d2p1:SourceProjection>String</d2p1:SourceProjection>
      <d2p1:Symbol>String</d2p1:Symbol>
      <d2p1:TaskSeries xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:TaskSeries>
      <d2p1:TaskSeriesTemplates xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:TaskSeriesTemplates>
      <d2p1:Tasks>
        <d2p1:DomainItem>
          <d2p1:LastUpdated>String</d2p1:LastUpdated>
          <d2p1:ObjectId>String</d2p1:ObjectId>
          <d2p1:VersionId>String</d2p1:VersionId>
          <d2p1:Workspace>String</d2p1:Workspace>
        </d2p1:DomainItem>
      </d2p1:Tasks>
      <d2p1:Teams xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:Teams>
      <d2p1:TimeZone>String</d2p1:TimeZone>
      <d2p1:Type>String</d2p1:Type>
      <d2p1:Users>
        <d2p1:DomainItem>
          <d2p1:LastUpdated>String</d2p1:LastUpdated>
          <d2p1:ObjectId>String</d2p1:ObjectId>
          <d2p1:VersionId>String</d2p1:VersionId>
          <d2p1:Workspace>String</d2p1:Workspace>
        </d2p1:DomainItem>
      </d2p1:Users>
      <d2p1:VersionId>String</d2p1:VersionId>
      <d2p1:Workspace>String</d2p1:Workspace>
    </d2p1:Asset>
  </Assets>
  <RecCount>0</RecCount>
  <RecStart>0</RecStart>
  <TotalCount>0</TotalCount>
</AssetQueryResponse>