| GET | /{Workspace}/API/Asset/Schema | ||
|---|---|---|---|
| GET, PUT, POST, DELETE | /{Workspace}/API/Asset/{Id} | ||
| GET, PUT, POST, DELETE | /{Workspace}/API/Asset | ||
| GET | /{Workspace}/API/Asset/Schema/{AssetType} |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class PublicAsset
{
@DataMember
public String Id = null;
@DataMember
public String Workspace = null;
@DataMember
public String AssetType = null;
@DataMember
public Asset Asset = null;
@DataMember
public ArrayList<Asset> Assets = null;
public String getId() { return Id; }
public PublicAsset setId(String value) { this.Id = value; return this; }
public String getWorkspace() { return Workspace; }
public PublicAsset setWorkspace(String value) { this.Workspace = value; return this; }
public String getAssetType() { return AssetType; }
public PublicAsset setAssetType(String value) { this.AssetType = value; return this; }
public Asset getAsset() { return Asset; }
public PublicAsset setAsset(Asset value) { this.Asset = value; return this; }
public ArrayList<Asset> getAssets() { return Assets; }
public PublicAsset setAssets(ArrayList<Asset> value) { this.Assets = value; return this; }
}
/**
* Contains the data for an asset within the system.
*/
public static class Asset
{
public String Workspace = null;
public String TimeZone = null;
public String AssignedWorkspace = null;
public String ObjectId = null;
public String VersionId = null;
public String BasedOn = null;
public String ExternalId = null;
public String Created = null;
public String LastUpdated = null;
public String Name = null;
public ArrayList<Schedule> Schedules = null;
public ArrayList<DomainItem> Documents = null;
public ArrayList<DomainItem> Tasks = null;
public ArrayList<String> TaskSeries = null;
public ArrayList<String> TaskSeriesTemplates = null;
public ArrayList<DomainItem> Users = null;
public String Type = null;
public String Symbol = null;
public HashMap<String,String> Data = null;
public Geometry Geometry = null;
public ArrayList<MaintenanceRecord> MaintenanceHistory = null;
public String Parent = null;
public ArrayList<String> Ancestors = null;
public ArrayList<LocationHistory> LocationHistory = null;
public ClassedItem Owner = null;
public Boolean IsParent = null;
public ArrayList<String> Assets = null;
public ArrayList<String> Contacts = null;
public String GeometryString = null;
public String SourceProjection = null;
public ArrayList<EventItem> Events = null;
public Anno Anno = null;
public ArrayList<String> Teams = null;
public AddressBasic Address = null;
public String CreatedBy = null;
public ArrayList<String> InventoryItems = null;
public HashMap<String,Object> ActiveLaborTypes = null;
public Integer Levels = null;
public Integer AllAssests = null;
public String Barcode = null;
public ArrayList<CustomDataField> CustomDataFields = null;
public String getWorkspace() { return Workspace; }
public Asset setWorkspace(String value) { this.Workspace = value; return this; }
public String getTimeZone() { return TimeZone; }
public Asset setTimeZone(String value) { this.TimeZone = value; return this; }
public String getAssignedWorkspace() { return AssignedWorkspace; }
public Asset setAssignedWorkspace(String value) { this.AssignedWorkspace = value; return this; }
public String getObjectId() { return ObjectId; }
public Asset setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public Asset setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Asset setBasedOn(String value) { this.BasedOn = value; return this; }
public String getExternalId() { return ExternalId; }
public Asset setExternalId(String value) { this.ExternalId = value; return this; }
public String getCreated() { return Created; }
public Asset setCreated(String value) { this.Created = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public Asset setLastUpdated(String value) { this.LastUpdated = value; return this; }
public String getName() { return Name; }
public Asset setName(String value) { this.Name = value; return this; }
public ArrayList<Schedule> getSchedules() { return Schedules; }
public Asset setSchedules(ArrayList<Schedule> value) { this.Schedules = value; return this; }
public ArrayList<DomainItem> getDocuments() { return Documents; }
public Asset setDocuments(ArrayList<DomainItem> value) { this.Documents = value; return this; }
public ArrayList<DomainItem> getTasks() { return Tasks; }
public Asset setTasks(ArrayList<DomainItem> value) { this.Tasks = value; return this; }
public ArrayList<String> getTaskSeries() { return TaskSeries; }
public Asset setTaskSeries(ArrayList<String> value) { this.TaskSeries = value; return this; }
public ArrayList<String> getTaskSeriesTemplates() { return TaskSeriesTemplates; }
public Asset setTaskSeriesTemplates(ArrayList<String> value) { this.TaskSeriesTemplates = value; return this; }
public ArrayList<DomainItem> getUsers() { return Users; }
public Asset setUsers(ArrayList<DomainItem> value) { this.Users = value; return this; }
public String getType() { return Type; }
public Asset setType(String value) { this.Type = value; return this; }
public String getSymbol() { return Symbol; }
public Asset setSymbol(String value) { this.Symbol = value; return this; }
public HashMap<String,String> getData() { return Data; }
public Asset setData(HashMap<String,String> value) { this.Data = value; return this; }
public Geometry getGeometry() { return Geometry; }
public Asset setGeometry(Geometry value) { this.Geometry = value; return this; }
public ArrayList<MaintenanceRecord> getMaintenanceHistory() { return MaintenanceHistory; }
public Asset setMaintenanceHistory(ArrayList<MaintenanceRecord> value) { this.MaintenanceHistory = value; return this; }
public String getParent() { return Parent; }
public Asset setParent(String value) { this.Parent = value; return this; }
public ArrayList<String> getAncestors() { return Ancestors; }
public Asset setAncestors(ArrayList<String> value) { this.Ancestors = value; return this; }
public ArrayList<LocationHistory> getLocationHistory() { return LocationHistory; }
public Asset setLocationHistory(ArrayList<LocationHistory> value) { this.LocationHistory = value; return this; }
public ClassedItem getOwner() { return Owner; }
public Asset setOwner(ClassedItem value) { this.Owner = value; return this; }
public Boolean getIsParent() { return IsParent; }
public Asset setIsParent(Boolean value) { this.IsParent = value; return this; }
public ArrayList<String> getAssets() { return Assets; }
public Asset setAssets(ArrayList<String> value) { this.Assets = value; return this; }
public ArrayList<String> getContacts() { return Contacts; }
public Asset setContacts(ArrayList<String> value) { this.Contacts = value; return this; }
public String getGeometryString() { return GeometryString; }
public Asset setGeometryString(String value) { this.GeometryString = value; return this; }
public String getSourceProjection() { return SourceProjection; }
public Asset setSourceProjection(String value) { this.SourceProjection = value; return this; }
public ArrayList<EventItem> getEvents() { return Events; }
public Asset setEvents(ArrayList<EventItem> value) { this.Events = value; return this; }
public Anno getAnno() { return Anno; }
public Asset setAnno(Anno value) { this.Anno = value; return this; }
public ArrayList<String> getTeams() { return Teams; }
public Asset setTeams(ArrayList<String> value) { this.Teams = value; return this; }
public AddressBasic getAddress() { return Address; }
public Asset setAddress(AddressBasic value) { this.Address = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public Asset setCreatedBy(String value) { this.CreatedBy = value; return this; }
public ArrayList<String> getInventoryItems() { return InventoryItems; }
public Asset setInventoryItems(ArrayList<String> value) { this.InventoryItems = value; return this; }
public HashMap<String,Object> getActiveLaborTypes() { return ActiveLaborTypes; }
public Asset setActiveLaborTypes(HashMap<String,Object> value) { this.ActiveLaborTypes = value; return this; }
public Integer getLevels() { return Levels; }
public Asset setLevels(Integer value) { this.Levels = value; return this; }
public Integer getAllAssests() { return AllAssests; }
public Asset setAllAssests(Integer value) { this.AllAssests = value; return this; }
public String getBarcode() { return Barcode; }
public Asset setBarcode(String value) { this.Barcode = value; return this; }
public ArrayList<CustomDataField> getCustomDataFields() { return CustomDataFields; }
public Asset setCustomDataFields(ArrayList<CustomDataField> value) { this.CustomDataFields = value; return this; }
}
public static class Schedule
{
public String Workspace = null;
public String ObjectId = null;
public String VersionId = null;
public String BasedOn = null;
public String Start = null;
public String End = null;
public String TimeZone = null;
public ArrayList<String> Users = null;
public ArrayList<String> Teams = null;
public HashMap<String,Object> Data = null;
public String getWorkspace() { return Workspace; }
public Schedule setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public Schedule setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public Schedule setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Schedule setBasedOn(String value) { this.BasedOn = value; return this; }
public String getStart() { return Start; }
public Schedule setStart(String value) { this.Start = value; return this; }
public String getEnd() { return End; }
public Schedule setEnd(String value) { this.End = value; return this; }
public String getTimeZone() { return TimeZone; }
public Schedule setTimeZone(String value) { this.TimeZone = value; return this; }
public ArrayList<String> getUsers() { return Users; }
public Schedule setUsers(ArrayList<String> value) { this.Users = value; return this; }
public ArrayList<String> getTeams() { return Teams; }
public Schedule setTeams(ArrayList<String> value) { this.Teams = value; return this; }
public HashMap<String,Object> getData() { return Data; }
public Schedule setData(HashMap<String,Object> value) { this.Data = value; return this; }
}
public static class DomainItem
{
public String Workspace = null;
public String ObjectId = null;
public String VersionId = null;
public String LastUpdated = null;
public String getWorkspace() { return Workspace; }
public DomainItem setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public DomainItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public DomainItem setVersionId(String value) { this.VersionId = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public DomainItem setLastUpdated(String value) { this.LastUpdated = value; return this; }
}
public static class Geometry
{
public String Type = null;
public ArrayList<Location> Coordinates = null;
public String getType() { return Type; }
public Geometry setType(String value) { this.Type = value; return this; }
public ArrayList<Location> getCoordinates() { return Coordinates; }
public Geometry setCoordinates(ArrayList<Location> value) { this.Coordinates = value; return this; }
}
public static class Location
{
public Double y = null;
public Double x = null;
public Double getY() { return y; }
public Location setY(Double value) { this.y = value; return this; }
public Double getX() { return x; }
public Location setX(Double value) { this.x = value; return this; }
}
public static class MaintenanceRecord
{
public String DateTime = null;
public String Notes = null;
public String getDateTime() { return DateTime; }
public MaintenanceRecord setDateTime(String value) { this.DateTime = value; return this; }
public String getNotes() { return Notes; }
public MaintenanceRecord setNotes(String value) { this.Notes = value; return this; }
}
public static class LocationHistory
{
public String Date = null;
public Location Location = null;
public String Barcode = null;
public String Notes = null;
public Boolean IsScan = null;
public String getDate() { return Date; }
public LocationHistory setDate(String value) { this.Date = value; return this; }
public Location getLocation() { return Location; }
public LocationHistory setLocation(Location value) { this.Location = value; return this; }
public String getBarcode() { return Barcode; }
public LocationHistory setBarcode(String value) { this.Barcode = value; return this; }
public String getNotes() { return Notes; }
public LocationHistory setNotes(String value) { this.Notes = value; return this; }
public Boolean getIsScan() { return IsScan; }
public LocationHistory setIsScan(Boolean value) { this.IsScan = value; return this; }
}
public static class ClassedItem
{
public String ObjectId = null;
public String Class = null;
public String VersionId = null;
public ArrayList<String> Ancestors = null;
public String Type = null;
public String getObjectId() { return ObjectId; }
public ClassedItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getClass() { return Class; }
public ClassedItem setClass(String value) { this.Class = value; return this; }
public String getVersionId() { return VersionId; }
public ClassedItem setVersionId(String value) { this.VersionId = value; return this; }
public ArrayList<String> getAncestors() { return Ancestors; }
public ClassedItem setAncestors(ArrayList<String> value) { this.Ancestors = value; return this; }
public String getType() { return Type; }
public ClassedItem setType(String value) { this.Type = value; return this; }
}
public static class EventItem
{
public String ObjectId = null;
public String Date = null;
public Location Location = null;
public String Barcode = null;
public String Details = null;
public String Type = null;
public Boolean IsScan = null;
public String User = null;
public String SelectedBy = null;
public String Status = null;
public String StatusType = null;
public String DateCreated = null;
public Boolean Automatic = null;
public String getObjectId() { return ObjectId; }
public EventItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getDate() { return Date; }
public EventItem setDate(String value) { this.Date = value; return this; }
public Location getLocation() { return Location; }
public EventItem setLocation(Location value) { this.Location = value; return this; }
public String getBarcode() { return Barcode; }
public EventItem setBarcode(String value) { this.Barcode = value; return this; }
public String getDetails() { return Details; }
public EventItem setDetails(String value) { this.Details = value; return this; }
public String getType() { return Type; }
public EventItem setType(String value) { this.Type = value; return this; }
public Boolean getIsScan() { return IsScan; }
public EventItem setIsScan(Boolean value) { this.IsScan = value; return this; }
public String getUser() { return User; }
public EventItem setUser(String value) { this.User = value; return this; }
public String getSelectedBy() { return SelectedBy; }
public EventItem setSelectedBy(String value) { this.SelectedBy = value; return this; }
public String getStatus() { return Status; }
public EventItem setStatus(String value) { this.Status = value; return this; }
public String getStatusType() { return StatusType; }
public EventItem setStatusType(String value) { this.StatusType = value; return this; }
public String getDateCreated() { return DateCreated; }
public EventItem setDateCreated(String value) { this.DateCreated = value; return this; }
public Boolean isAutomatic() { return Automatic; }
public EventItem setAutomatic(Boolean value) { this.Automatic = value; return this; }
}
public static class Anno
{
public Double X = null;
public Double Y = null;
public Double R = null;
public Double S = null;
public String T = null;
public Double getX() { return X; }
public Anno setX(Double value) { this.X = value; return this; }
public Double getY() { return Y; }
public Anno setY(Double value) { this.Y = value; return this; }
public Double getR() { return R; }
public Anno setR(Double value) { this.R = value; return this; }
public Double getS() { return S; }
public Anno setS(Double value) { this.S = value; return this; }
public String getT() { return T; }
public Anno setT(String value) { this.T = value; return this; }
}
public static class AddressBasic
{
public String Street = null;
public String Unit = null;
public String City = null;
public String State = null;
public String Zip = null;
public String Country = null;
public Location Location = null;
public String getStreet() { return Street; }
public AddressBasic setStreet(String value) { this.Street = value; return this; }
public String getUnit() { return Unit; }
public AddressBasic setUnit(String value) { this.Unit = value; return this; }
public String getCity() { return City; }
public AddressBasic setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public AddressBasic setState(String value) { this.State = value; return this; }
public String getZip() { return Zip; }
public AddressBasic setZip(String value) { this.Zip = value; return this; }
public String getCountry() { return Country; }
public AddressBasic setCountry(String value) { this.Country = value; return this; }
public Location getLocation() { return Location; }
public AddressBasic setLocation(Location value) { this.Location = value; return this; }
}
public static class CustomDataField
{
public String Binding = null;
public String Label = null;
public Object Value = null;
public String DataType = null;
public Boolean IsReadOnly = null;
public Boolean IsHidden = null;
public String Values = null;
public String getBinding() { return Binding; }
public CustomDataField setBinding(String value) { this.Binding = value; return this; }
public String getLabel() { return Label; }
public CustomDataField setLabel(String value) { this.Label = value; return this; }
public Object getValue() { return Value; }
public CustomDataField setValue(Object value) { this.Value = value; return this; }
public String getDataType() { return DataType; }
public CustomDataField setDataType(String value) { this.DataType = value; return this; }
public Boolean getIsReadOnly() { return IsReadOnly; }
public CustomDataField setIsReadOnly(Boolean value) { this.IsReadOnly = value; return this; }
public Boolean getIsHidden() { return IsHidden; }
public CustomDataField setIsHidden(Boolean value) { this.IsHidden = value; return this; }
public String getValues() { return Values; }
public CustomDataField setValues(String value) { this.Values = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/API/Asset/{Id} HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Id: String,
Workspace: String,
AssetType: String,
Asset:
{
Name: String,
Type: String,
ExternalId: String,
Parent: String,
Lat: 0,
Lon: 0,
StreetAddress: String,
Unit: String,
City: String,
State: String,
Zip: String,
Country: String,
Data:
{
String: {}
},
LastUpdated: String,
Created: String,
Tasks:
[
String
],
Team: String
},
Assets:
[
{
Name: String,
Type: String,
ExternalId: String,
Parent: String,
Lat: 0,
Lon: 0,
StreetAddress: String,
Unit: String,
City: String,
State: String,
Zip: String,
Country: String,
Data:
{
String: {}
},
LastUpdated: String,
Created: String,
Tasks:
[
String
],
Team: String
}
]
}