| GET,PUT,POST,DELETE | /{Workspace}/InventoryItemTemplate |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class InventoryItemTemplate
{
public String ObjectId = null;
public String Workspace = null;
public String Name = null;
public ArrayList<CustomField> CustomFields = null;
public String getObjectId() { return ObjectId; }
public InventoryItemTemplate setObjectId(String value) { this.ObjectId = value; return this; }
public String getWorkspace() { return Workspace; }
public InventoryItemTemplate setWorkspace(String value) { this.Workspace = value; return this; }
public String getName() { return Name; }
public InventoryItemTemplate setName(String value) { this.Name = value; return this; }
public ArrayList<CustomField> getCustomFields() { return CustomFields; }
public InventoryItemTemplate setCustomFields(ArrayList<CustomField> value) { this.CustomFields = value; return this; }
}
public static class CustomField
{
public String Key = null;
public String Label = null;
public Boolean IsActive = null;
public Boolean IsReadOnly = null;
public Boolean IsHidden = null;
public Boolean IsMandatory = null;
public Boolean DisplayOnMap = null;
public CustomFieldDataType CustomFieldDataType = null;
public String Values = null;
public String Prompt = null;
public String Default = null;
public Boolean DefaultAutoUpdate = null;
public String RequiredIf = null;
public ArrayList<String> Hidden = null;
public ArrayList<String> ReadOnly = null;
public HashMap<String,Object> ControlArgs = null;
public String IndexSlot = null;
public String Index = null;
public String getKey() { return Key; }
public CustomField setKey(String value) { this.Key = value; return this; }
public String getLabel() { return Label; }
public CustomField setLabel(String value) { this.Label = value; return this; }
public Boolean getIsActive() { return IsActive; }
public CustomField setIsActive(Boolean value) { this.IsActive = value; return this; }
public Boolean getIsReadOnly() { return IsReadOnly; }
public CustomField setIsReadOnly(Boolean value) { this.IsReadOnly = value; return this; }
public Boolean getIsHidden() { return IsHidden; }
public CustomField setIsHidden(Boolean value) { this.IsHidden = value; return this; }
public Boolean getIsMandatory() { return IsMandatory; }
public CustomField setIsMandatory(Boolean value) { this.IsMandatory = value; return this; }
public Boolean isDisplayOnMap() { return DisplayOnMap; }
public CustomField setDisplayOnMap(Boolean value) { this.DisplayOnMap = value; return this; }
public CustomFieldDataType getCustomFieldDataType() { return CustomFieldDataType; }
public CustomField setCustomFieldDataType(CustomFieldDataType value) { this.CustomFieldDataType = value; return this; }
public String getValues() { return Values; }
public CustomField setValues(String value) { this.Values = value; return this; }
public String getPrompt() { return Prompt; }
public CustomField setPrompt(String value) { this.Prompt = value; return this; }
public String getDefault() { return Default; }
public CustomField setDefault(String value) { this.Default = value; return this; }
public Boolean isDefaultAutoUpdate() { return DefaultAutoUpdate; }
public CustomField setDefaultAutoUpdate(Boolean value) { this.DefaultAutoUpdate = value; return this; }
public String getRequiredIf() { return RequiredIf; }
public CustomField setRequiredIf(String value) { this.RequiredIf = value; return this; }
public ArrayList<String> getHidden() { return Hidden; }
public CustomField setHidden(ArrayList<String> value) { this.Hidden = value; return this; }
public ArrayList<String> getReadOnly() { return ReadOnly; }
public CustomField setReadOnly(ArrayList<String> value) { this.ReadOnly = value; return this; }
public HashMap<String,Object> getControlArgs() { return ControlArgs; }
public CustomField setControlArgs(HashMap<String,Object> value) { this.ControlArgs = value; return this; }
public String getIndexSlot() { return IndexSlot; }
public CustomField setIndexSlot(String value) { this.IndexSlot = value; return this; }
public String getIndex() { return Index; }
public CustomField setIndex(String value) { this.Index = value; return this; }
}
public static 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;
}
}
Java InventoryItemTemplate DTOs
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}/InventoryItemTemplate HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ObjectId: String,
Workspace: String,
Name: String,
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: {}
},
IndexSlot: String,
Index: String
}
]
}