| GET,POST,PUT,DELETE | /{Workspace}/PricingList/{ObjectId} | ||
|---|---|---|---|
| GET | /{Workspace}/PricingList |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* Represents a DTO for a pricing list in a workspace. Calls without an ObjectId will retrieve an array of all active pricing list objects for the workspace.
*/
public static class PricingList
{
public String Workspace = null;
public String ObjectId = null;
public String VersionId = null;
public String BasedOn = null;
public String Name = null;
public ArrayList<PricingListCat> Categories = null;
public ArrayList<PricingListItem> Items = null;
public String getWorkspace() { return Workspace; }
public PricingList setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public PricingList setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public PricingList setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public PricingList setBasedOn(String value) { this.BasedOn = value; return this; }
public String getName() { return Name; }
public PricingList setName(String value) { this.Name = value; return this; }
public ArrayList<PricingListCat> getCategories() { return Categories; }
public PricingList setCategories(ArrayList<PricingListCat> value) { this.Categories = value; return this; }
public ArrayList<PricingListItem> getItems() { return Items; }
public PricingList setItems(ArrayList<PricingListItem> value) { this.Items = value; return this; }
}
public static class PricingListCat
{
public String ObjectId = null;
public String Name = null;
public ArrayList<PricingListCat> Categories = null;
public ArrayList<PricingListItem> Items = null;
public String getObjectId() { return ObjectId; }
public PricingListCat setObjectId(String value) { this.ObjectId = value; return this; }
public String getName() { return Name; }
public PricingListCat setName(String value) { this.Name = value; return this; }
public ArrayList<PricingListCat> getCategories() { return Categories; }
public PricingListCat setCategories(ArrayList<PricingListCat> value) { this.Categories = value; return this; }
public ArrayList<PricingListItem> getItems() { return Items; }
public PricingListCat setItems(ArrayList<PricingListItem> value) { this.Items = value; return this; }
}
public static class PricingListItem
{
public String ObjectId = null;
public String Description = null;
public String Details = null;
public String Manufacturer = null;
public String Model = null;
public String Photo = null;
public Boolean IsTaxable = null;
public String Unit = null;
public Double UnitPrice = null;
public String Barcode = null;
public String getObjectId() { return ObjectId; }
public PricingListItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getDescription() { return Description; }
public PricingListItem setDescription(String value) { this.Description = value; return this; }
public String getDetails() { return Details; }
public PricingListItem setDetails(String value) { this.Details = value; return this; }
public String getManufacturer() { return Manufacturer; }
public PricingListItem setManufacturer(String value) { this.Manufacturer = value; return this; }
public String getModel() { return Model; }
public PricingListItem setModel(String value) { this.Model = value; return this; }
public String getPhoto() { return Photo; }
public PricingListItem setPhoto(String value) { this.Photo = value; return this; }
public Boolean getIsTaxable() { return IsTaxable; }
public PricingListItem setIsTaxable(Boolean value) { this.IsTaxable = value; return this; }
public String getUnit() { return Unit; }
public PricingListItem setUnit(String value) { this.Unit = value; return this; }
public Double getUnitPrice() { return UnitPrice; }
public PricingListItem setUnitPrice(Double value) { this.UnitPrice = value; return this; }
public String getBarcode() { return Barcode; }
public PricingListItem setBarcode(String value) { this.Barcode = 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}/PricingList/{ObjectId} HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Workspace: String,
ObjectId: String,
VersionId: String,
BasedOn: String,
Name: String,
Categories:
[
{
ObjectId: String,
Name: String,
Categories:
[
{
ObjectId: String,
Name: String,
Categories:
[
{
ObjectId: String,
Name: String,
Items:
[
{
ObjectId: String,
Description: String,
Details: String,
Manufacturer: String,
Model: String,
Photo: String,
IsTaxable: False,
Unit: String,
UnitPrice: 0,
Barcode: String
}
]
}
],
Items:
[
{
ObjectId: String,
Description: String,
Details: String,
Manufacturer: String,
Model: String,
Photo: String,
IsTaxable: False,
Unit: String,
UnitPrice: 0,
Barcode: String
}
]
}
],
Items:
[
{
ObjectId: String,
Description: String,
Details: String,
Manufacturer: String,
Model: String,
Photo: String,
IsTaxable: False,
Unit: String,
UnitPrice: 0,
Barcode: String
}
]
}
],
Items:
[
{
ObjectId: String,
Description: String,
Details: String,
Manufacturer: String,
Model: String,
Photo: String,
IsTaxable: False,
Unit: String,
UnitPrice: 0,
Barcode: String
}
]
}