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 datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class CustomFieldDataType(str, Enum):
    TEXT = 'Text'
    NUMBER = 'Number'
    DECIMAL = 'Decimal'
    MONEY = 'Money'
    PHONE_NUMBER = 'PhoneNumber'
    SSN = 'Ssn'
    LIST = 'List'
    DATE = 'Date'
    FILE = 'File'
    BARCODE = 'Barcode'
    GPS = 'GPS'
    PHOTO = 'Photo'
    SPACER = 'Spacer'
    SEPARATOR = 'Separator'
    AUTO_NUMBER = 'AutoNumber'
    TEXT_AREA = 'TextArea'
    CONTACT = 'Contact'
    USER = 'User'
    ASSET = 'Asset'
    CHECKBOX = 'Checkbox'
    CORE_ASSET_LIST = 'CoreAssetList'
    CORE_TASK_LIST = 'CoreTaskList'
    CORE_PARENT_TASK = 'CoreParentTask'
    CORE_CONTACT_LIST = 'CoreContactList'
    COMBO_BOX = 'ComboBox'
    DATE_TIME = 'DateTime'
    TIME = 'Time'
    LOCATION = 'Location'
    CORE_LOCATION = 'CoreLocation'
    LABEL = 'Label'
    EVENT_LOG = 'EventLog'
    ADDRESS = 'Address'
    CATALOG = 'Catalog'
    CORE_TEAM_LIST = 'CoreTeamList'
    SEGMENT = 'Segment'
    CORE_TIME_SERIES = 'CoreTimeSeries'
    TIME_SERIES = 'TimeSeries'
    COMMAND = 'Command'
    AUTO_NUMBER_NUMERIC = 'AutoNumberNumeric'
    CATALOG_LIST = 'CatalogList'
    CATALOG_COMBO_BOX = 'CatalogComboBox'
    DATE_RANGE = 'DateRange'
    DOCUMENT_GRID = 'DocumentGrid'
    REPORT_LINK = 'ReportLink'
    HYPERLINK = 'Hyperlink'
    PERCENT_COMPLETE = 'PercentComplete'
    CHART = 'Chart'
    RANGE = 'Range'
    EXTERNAL_ID = 'ExternalId'
    ASSET_CATALOG = 'AssetCatalog'
    INVENTORY = 'Inventory'
    CORE_TASK_LABOR_ITEM_TYPES = 'CoreTaskLaborItemTypes'
    CORE_TASK_LABOR_ITEMS = 'CoreTaskLaborItems'
    OBJECT_LIST = 'ObjectList'
    CORE_TIME_ZONE = 'CoreTimeZone'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomField:
    key: Optional[str] = None
    label: Optional[str] = None
    is_active: bool = False
    is_read_only: bool = False
    is_hidden: bool = False
    is_mandatory: bool = False
    display_on_map: bool = False
    custom_field_data_type: Optional[CustomFieldDataType] = None
    values: Optional[str] = None
    prompt: Optional[str] = None
    default: Optional[str] = None
    default_auto_update: bool = False
    required_if: Optional[str] = None
    hidden: Optional[List[str]] = None
    read_only: Optional[List[str]] = None
    control_args: Optional[Dict[str, Object]] = None
    index_slot: Optional[str] = None
    index: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AssetType:
    """
    Represents a single asset type.
    """

    workspace: Optional[str] = None
    type: Optional[str] = None
    is_active: bool = False
    name: Optional[str] = None
    make: Optional[str] = None
    model: Optional[str] = None
    manuf: Optional[str] = None
    barcode: Optional[str] = None
    symbol: Optional[str] = None
    color: Optional[str] = None
    line_thickness: float = 0.0
    scale: float = 0.0
    visibility_min: float = 0.0
    visibility_max: float = 0.0
    sync_node: bool = False
    custom_fields: Optional[List[CustomField]] = None
    allowed_parent_types: Optional[List[str]] = None
    allowed_child_types: Optional[List[str]] = None
    use_location_history: bool = False
    is_mobile_asset: bool = False
    data: Optional[Dict[str, str]] = None
    geom_type: Optional[str] = None
    doc_filter: bool = False
    show_related_docs: bool = False
    allowed_doc_types: Optional[List[str]] = None
    tla: Optional[str] = None
    use_t_l_a_on_map: bool = False
    routing_location: Optional[str] = None
    fill: Optional[str] = None
    fill_opacity: float = 0.0
    show_anno: bool = False
    anno_color: Optional[str] = None
    max_anno_visibility: float = 0.0
    anno_font: Optional[str] = None
    hide_type_label: bool = False
    use_address: bool = False
    use_full_screen: bool = False
    time_series: int = 0
    is_unselectable: bool = False
    edit_teams: Optional[List[str]] = None
    is_warehouse: bool = False
    is_vehicle: bool = False
    custom_symbol: Optional[Dict[str, Object]] = None
    task_series_templates: Optional[List[str]] = None

Python 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"]}