Field Squared API Services

<back to all web services

AssetType

Represents a single asset type
.

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

enum CustomFieldDataType
{
    Text,
    Number,
    Decimal,
    Money,
    PhoneNumber,
    Ssn,
    List,
    Date,
    File,
    Barcode,
    GPS,
    Photo,
    Spacer,
    Separator,
    AutoNumber,
    TextArea,
    Contact,
    User,
    Asset,
    Checkbox,
    CoreAssetList,
    CoreTaskList,
    CoreParentTask,
    CoreContactList,
    ComboBox,
    DateTime,
    Time,
    Location,
    CoreLocation,
    Label,
    EventLog,
    Address,
    Catalog,
    CoreTeamList,
    Segment,
    CoreTimeSeries,
    TimeSeries,
    Command,
    AutoNumberNumeric,
    CatalogList,
    CatalogComboBox,
    DateRange,
    DocumentGrid,
    ReportLink,
    Hyperlink,
    PercentComplete,
    Chart,
    Range,
    ExternalId,
    AssetCatalog,
    Inventory,
    CoreTaskLaborItemTypes,
    CoreTaskLaborItems,
    ObjectList,
    CoreTimeZone,
}

class CustomField implements IConvertible
{
    String? Key;
    String? Label;
    bool? IsActive;
    bool? IsReadOnly;
    bool? IsHidden;
    bool? IsMandatory;
    bool? DisplayOnMap;
    CustomFieldDataType? CustomFieldDataType;
    String? Values;
    String? Prompt;
    String? Default;
    bool? DefaultAutoUpdate;
    String? RequiredIf;
    List<String>? Hidden;
    List<String>? ReadOnly;
    Map<String,dynamic?>? ControlArgs;
    String? IndexSlot;
    String? Index;

    CustomField({this.Key,this.Label,this.IsActive,this.IsReadOnly,this.IsHidden,this.IsMandatory,this.DisplayOnMap,this.CustomFieldDataType,this.Values,this.Prompt,this.Default,this.DefaultAutoUpdate,this.RequiredIf,this.Hidden,this.ReadOnly,this.ControlArgs,this.IndexSlot,this.Index});
    CustomField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Label = json['Label'];
        IsActive = json['IsActive'];
        IsReadOnly = json['IsReadOnly'];
        IsHidden = json['IsHidden'];
        IsMandatory = json['IsMandatory'];
        DisplayOnMap = json['DisplayOnMap'];
        CustomFieldDataType = JsonConverters.fromJson(json['CustomFieldDataType'],'CustomFieldDataType',context!);
        Values = json['Values'];
        Prompt = json['Prompt'];
        Default = json['Default'];
        DefaultAutoUpdate = json['DefaultAutoUpdate'];
        RequiredIf = json['RequiredIf'];
        Hidden = JsonConverters.fromJson(json['Hidden'],'List<String>',context!);
        ReadOnly = JsonConverters.fromJson(json['ReadOnly'],'List<String>',context!);
        ControlArgs = JsonConverters.fromJson(json['ControlArgs'],'Map<String,dynamic?>',context!);
        IndexSlot = json['IndexSlot'];
        Index = json['Index'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Label': Label,
        'IsActive': IsActive,
        'IsReadOnly': IsReadOnly,
        'IsHidden': IsHidden,
        'IsMandatory': IsMandatory,
        'DisplayOnMap': DisplayOnMap,
        'CustomFieldDataType': JsonConverters.toJson(CustomFieldDataType,'CustomFieldDataType',context!),
        'Values': Values,
        'Prompt': Prompt,
        'Default': Default,
        'DefaultAutoUpdate': DefaultAutoUpdate,
        'RequiredIf': RequiredIf,
        'Hidden': JsonConverters.toJson(Hidden,'List<String>',context!),
        'ReadOnly': JsonConverters.toJson(ReadOnly,'List<String>',context!),
        'ControlArgs': JsonConverters.toJson(ControlArgs,'Map<String,dynamic?>',context!),
        'IndexSlot': IndexSlot,
        'Index': Index
    };

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

/**
* Represents a single asset type.
*/
class AssetType implements IConvertible
{
    String? Workspace;
    String? Type;
    bool? IsActive;
    String? Name;
    String? Make;
    String? Model;
    String? Manuf;
    String? Barcode;
    String? Symbol;
    String? Color;
    double? LineThickness;
    double? Scale;
    double? VisibilityMin;
    double? VisibilityMax;
    bool? SyncNode;
    List<CustomField>? CustomFields;
    List<String>? AllowedParentTypes;
    List<String>? AllowedChildTypes;
    bool? UseLocationHistory;
    bool? IsMobileAsset;
    Map<String,String?>? Data;
    String? GeomType;
    bool? DocFilter;
    bool? ShowRelatedDocs;
    List<String>? AllowedDocTypes;
    String? TLA;
    bool? UseTLAOnMap;
    String? RoutingLocation;
    String? Fill;
    double? FillOpacity;
    bool? ShowAnno;
    String? AnnoColor;
    double? MaxAnnoVisibility;
    String? AnnoFont;
    bool? HideTypeLabel;
    bool? UseAddress;
    bool? UseFullScreen;
    int? TimeSeries;
    bool? IsUnselectable;
    List<String>? EditTeams;
    bool? IsWarehouse;
    bool? IsVehicle;
    Map<String,dynamic?>? CustomSymbol;
    List<String>? TaskSeriesTemplates;

    AssetType({this.Workspace,this.Type,this.IsActive,this.Name,this.Make,this.Model,this.Manuf,this.Barcode,this.Symbol,this.Color,this.LineThickness,this.Scale,this.VisibilityMin,this.VisibilityMax,this.SyncNode,this.CustomFields,this.AllowedParentTypes,this.AllowedChildTypes,this.UseLocationHistory,this.IsMobileAsset,this.Data,this.GeomType,this.DocFilter,this.ShowRelatedDocs,this.AllowedDocTypes,this.TLA,this.UseTLAOnMap,this.RoutingLocation,this.Fill,this.FillOpacity,this.ShowAnno,this.AnnoColor,this.MaxAnnoVisibility,this.AnnoFont,this.HideTypeLabel,this.UseAddress,this.UseFullScreen,this.TimeSeries,this.IsUnselectable,this.EditTeams,this.IsWarehouse,this.IsVehicle,this.CustomSymbol,this.TaskSeriesTemplates});
    AssetType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        Type = json['Type'];
        IsActive = json['IsActive'];
        Name = json['Name'];
        Make = json['Make'];
        Model = json['Model'];
        Manuf = json['Manuf'];
        Barcode = json['Barcode'];
        Symbol = json['Symbol'];
        Color = json['Color'];
        LineThickness = JsonConverters.toDouble(json['LineThickness']);
        Scale = JsonConverters.toDouble(json['Scale']);
        VisibilityMin = JsonConverters.toDouble(json['VisibilityMin']);
        VisibilityMax = JsonConverters.toDouble(json['VisibilityMax']);
        SyncNode = json['SyncNode'];
        CustomFields = JsonConverters.fromJson(json['CustomFields'],'List<CustomField>',context!);
        AllowedParentTypes = JsonConverters.fromJson(json['AllowedParentTypes'],'List<String>',context!);
        AllowedChildTypes = JsonConverters.fromJson(json['AllowedChildTypes'],'List<String>',context!);
        UseLocationHistory = json['UseLocationHistory'];
        IsMobileAsset = json['IsMobileAsset'];
        Data = JsonConverters.toStringMap(json['Data']);
        GeomType = json['GeomType'];
        DocFilter = json['DocFilter'];
        ShowRelatedDocs = json['ShowRelatedDocs'];
        AllowedDocTypes = JsonConverters.fromJson(json['AllowedDocTypes'],'List<String>',context!);
        TLA = json['TLA'];
        UseTLAOnMap = json['UseTLAOnMap'];
        RoutingLocation = json['RoutingLocation'];
        Fill = json['Fill'];
        FillOpacity = JsonConverters.toDouble(json['FillOpacity']);
        ShowAnno = json['ShowAnno'];
        AnnoColor = json['AnnoColor'];
        MaxAnnoVisibility = JsonConverters.toDouble(json['MaxAnnoVisibility']);
        AnnoFont = json['AnnoFont'];
        HideTypeLabel = json['HideTypeLabel'];
        UseAddress = json['UseAddress'];
        UseFullScreen = json['UseFullScreen'];
        TimeSeries = json['TimeSeries'];
        IsUnselectable = json['IsUnselectable'];
        EditTeams = JsonConverters.fromJson(json['EditTeams'],'List<String>',context!);
        IsWarehouse = json['IsWarehouse'];
        IsVehicle = json['IsVehicle'];
        CustomSymbol = JsonConverters.fromJson(json['CustomSymbol'],'Map<String,dynamic?>',context!);
        TaskSeriesTemplates = JsonConverters.fromJson(json['TaskSeriesTemplates'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'Type': Type,
        'IsActive': IsActive,
        'Name': Name,
        'Make': Make,
        'Model': Model,
        'Manuf': Manuf,
        'Barcode': Barcode,
        'Symbol': Symbol,
        'Color': Color,
        'LineThickness': LineThickness,
        'Scale': Scale,
        'VisibilityMin': VisibilityMin,
        'VisibilityMax': VisibilityMax,
        'SyncNode': SyncNode,
        'CustomFields': JsonConverters.toJson(CustomFields,'List<CustomField>',context!),
        'AllowedParentTypes': JsonConverters.toJson(AllowedParentTypes,'List<String>',context!),
        'AllowedChildTypes': JsonConverters.toJson(AllowedChildTypes,'List<String>',context!),
        'UseLocationHistory': UseLocationHistory,
        'IsMobileAsset': IsMobileAsset,
        'Data': Data,
        'GeomType': GeomType,
        'DocFilter': DocFilter,
        'ShowRelatedDocs': ShowRelatedDocs,
        'AllowedDocTypes': JsonConverters.toJson(AllowedDocTypes,'List<String>',context!),
        'TLA': TLA,
        'UseTLAOnMap': UseTLAOnMap,
        'RoutingLocation': RoutingLocation,
        'Fill': Fill,
        'FillOpacity': FillOpacity,
        'ShowAnno': ShowAnno,
        'AnnoColor': AnnoColor,
        'MaxAnnoVisibility': MaxAnnoVisibility,
        'AnnoFont': AnnoFont,
        'HideTypeLabel': HideTypeLabel,
        'UseAddress': UseAddress,
        'UseFullScreen': UseFullScreen,
        'TimeSeries': TimeSeries,
        'IsUnselectable': IsUnselectable,
        'EditTeams': JsonConverters.toJson(EditTeams,'List<String>',context!),
        'IsWarehouse': IsWarehouse,
        'IsVehicle': IsVehicle,
        'CustomSymbol': JsonConverters.toJson(CustomSymbol,'Map<String,dynamic?>',context!),
        'TaskSeriesTemplates': JsonConverters.toJson(TaskSeriesTemplates,'List<String>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'CustomFieldDataType': TypeInfo(TypeOf.Enum, enumValues:CustomFieldDataType.values),
    'CustomField': TypeInfo(TypeOf.Class, create:() => CustomField()),
    'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
    'AssetType': TypeInfo(TypeOf.Class, create:() => AssetType()),
    'List<CustomField>': TypeInfo(TypeOf.Class, create:() => <CustomField>[]),
});

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

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

{"Workspace":"String","Type":"String","IsActive":false,"Name":"String","Make":"String","Model":"String","Manuf":"String","Barcode":"String","Symbol":"String","Color":"String","LineThickness":0,"Scale":0,"VisibilityMin":0,"VisibilityMax":0,"SyncNode":false,"CustomFields":[{"Key":"String","Label":"String","IsActive":false,"IsReadOnly":false,"IsHidden":false,"IsMandatory":false,"DisplayOnMap":false,"CustomFieldDataType":"Text","Values":"String","Prompt":"String","Default":"String","DefaultAutoUpdate":false,"RequiredIf":"String","Hidden":["String"],"ReadOnly":["String"],"ControlArgs":{"String":"String"},"UseArrayMergeType":"Set","IndexSlot":"String","Index":"String"}],"AllowedParentTypes":["String"],"AllowedChildTypes":["String"],"UseLocationHistory":false,"IsMobileAsset":false,"Data":{"String":"String"},"GeomType":"String","DocFilter":false,"ShowRelatedDocs":false,"AllowedDocTypes":["String"],"TLA":"String","UseTLAOnMap":false,"RoutingLocation":"String","Fill":"String","FillOpacity":0,"ShowAnno":false,"AnnoColor":"String","MaxAnnoVisibility":0,"AnnoFont":"String","HideTypeLabel":false,"UseAddress":false,"UseFullScreen":false,"TimeSeries":0,"IsUnselectable":false,"EditTeams":["String"],"IsWarehouse":false,"IsVehicle":false,"CustomSymbol":{"String":{}},"TaskSeriesTemplates":["String"]}