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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Field2Office.API.Model.Assets;
using Field2Office.API.Model.Workspaces;
using Field2Office.DomainObjects;

namespace Field2Office.API.Model.Assets
{
    ///<summary>
    ///Represents a single asset type.
    ///</summary>
    public partial class AssetType
    {
        public AssetType()
        {
            CustomFields = new List<CustomField>{};
            AllowedParentTypes = new List<string>{};
            AllowedChildTypes = new List<string>{};
            Data = new Dictionary<string, string>{};
            AllowedDocTypes = new List<string>{};
            EditTeams = new List<string>{};
            CustomSymbol = new Dictionary<string, Object>{};
            TaskSeriesTemplates = new List<string>{};
        }

        public virtual string Workspace { get; set; }
        public virtual string Type { get; set; }
        public virtual bool IsActive { get; set; }
        public virtual string Name { get; set; }
        public virtual string Make { get; set; }
        public virtual string Model { get; set; }
        public virtual string Manuf { get; set; }
        public virtual string Barcode { get; set; }
        public virtual string Symbol { get; set; }
        public virtual string Color { get; set; }
        public virtual double LineThickness { get; set; }
        public virtual double Scale { get; set; }
        public virtual double VisibilityMin { get; set; }
        public virtual double VisibilityMax { get; set; }
        public virtual bool SyncNode { get; set; }
        public virtual List<CustomField> CustomFields { get; set; }
        public virtual List<string> AllowedParentTypes { get; set; }
        public virtual List<string> AllowedChildTypes { get; set; }
        public virtual bool UseLocationHistory { get; set; }
        public virtual bool IsMobileAsset { get; set; }
        public virtual Dictionary<string, string> Data { get; set; }
        public virtual string GeomType { get; set; }
        public virtual bool DocFilter { get; set; }
        public virtual bool ShowRelatedDocs { get; set; }
        public virtual List<string> AllowedDocTypes { get; set; }
        public virtual string TLA { get; set; }
        public virtual bool UseTLAOnMap { get; set; }
        public virtual string RoutingLocation { get; set; }
        public virtual string Fill { get; set; }
        public virtual double FillOpacity { get; set; }
        public virtual bool ShowAnno { get; set; }
        public virtual string AnnoColor { get; set; }
        public virtual double MaxAnnoVisibility { get; set; }
        public virtual string AnnoFont { get; set; }
        public virtual bool HideTypeLabel { get; set; }
        public virtual bool UseAddress { get; set; }
        public virtual bool UseFullScreen { get; set; }
        public virtual int TimeSeries { get; set; }
        public virtual bool IsUnselectable { get; set; }
        public virtual List<string> EditTeams { get; set; }
        public virtual bool IsWarehouse { get; set; }
        public virtual bool IsVehicle { get; set; }
        public virtual Dictionary<string, Object> CustomSymbol { get; set; }
        public virtual List<string> TaskSeriesTemplates { get; set; }
    }

}

namespace Field2Office.API.Model.Workspaces
{
    public partial class CustomField
    {
        public CustomField()
        {
            Hidden = new List<string>{};
            ReadOnly = new List<string>{};
            ControlArgs = new Dictionary<string, Object>{};
        }

        public virtual string Key { get; set; }
        public virtual string Label { get; set; }
        public virtual bool IsActive { get; set; }
        public virtual bool IsReadOnly { get; set; }
        public virtual bool IsHidden { get; set; }
        public virtual bool IsMandatory { get; set; }
        public virtual bool DisplayOnMap { get; set; }
        public virtual CustomFieldDataType CustomFieldDataType { get; set; }
        public virtual string Values { get; set; }
        public virtual string Prompt { get; set; }
        public virtual string Default { get; set; }
        public virtual bool DefaultAutoUpdate { get; set; }
        public virtual string RequiredIf { get; set; }
        public virtual List<string> Hidden { get; set; }
        public virtual List<string> ReadOnly { get; set; }
        public virtual Dictionary<string, Object> ControlArgs { get; set; }
        public virtual string IndexSlot { get; set; }
        public virtual string Index { get; set; }
    }

}

namespace Field2Office.DomainObjects
{
    public 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,
    }

}

C# 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"]}