| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<InventoryItemTemplate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Inventory">
<CustomFields xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Workspaces">
<d2p1:CustomField>
<d2p1:ControlArgs xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</d2p1:ControlArgs>
<d2p1:CustomFieldDataType>Text</d2p1:CustomFieldDataType>
<d2p1:Default>String</d2p1:Default>
<d2p1:DefaultAutoUpdate>false</d2p1:DefaultAutoUpdate>
<d2p1:DisplayOnMap>false</d2p1:DisplayOnMap>
<d2p1:Hidden xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</d2p1:Hidden>
<d2p1:Index>String</d2p1:Index>
<d2p1:IndexSlot>String</d2p1:IndexSlot>
<d2p1:IsActive>false</d2p1:IsActive>
<d2p1:IsHidden>false</d2p1:IsHidden>
<d2p1:IsMandatory>false</d2p1:IsMandatory>
<d2p1:IsReadOnly>false</d2p1:IsReadOnly>
<d2p1:Key>String</d2p1:Key>
<d2p1:Label>String</d2p1:Label>
<d2p1:Prompt>String</d2p1:Prompt>
<d2p1:ReadOnly xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</d2p1:ReadOnly>
<d2p1:RequiredIf>String</d2p1:RequiredIf>
<d2p1:Values>String</d2p1:Values>
</d2p1:CustomField>
</CustomFields>
<Name>String</Name>
<ObjectId>String</ObjectId>
<Workspace>String</Workspace>
</InventoryItemTemplate>