| GET | /principal/get |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class GetPrincipal extends ApiServiceRequest
{
public Integer PrincipalId = null;
public Integer getPrincipalId() { return PrincipalId; }
public GetPrincipal setPrincipalId(Integer value) { this.PrincipalId = value; return this; }
}
public static class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo
{
/**
* The API Key required for authentication
*/
@ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
public String ApiKey = null;
/**
* Latitude of the user making this request
*/
@ApiMember(DataType="double", Description="Latitude of the user making this request")
public Double Latitude = null;
/**
* Longitude of the user making this request
*/
@ApiMember(DataType="double", Description="Longitude of the user making this request")
public Double Longitude = null;
public String getApiKey() { return ApiKey; }
public ApiServiceRequest setApiKey(String value) { this.ApiKey = value; return this; }
public Double getLatitude() { return Latitude; }
public ApiServiceRequest setLatitude(Double value) { this.Latitude = value; return this; }
public Double getLongitude() { return Longitude; }
public ApiServiceRequest setLongitude(Double value) { this.Longitude = value; return this; }
}
public static class GetPrincipalResponse extends ApiServiceResponse
{
public PrincipalData Data = null;
public PrincipalData getData() { return Data; }
public GetPrincipalResponse setData(PrincipalData value) { this.Data = value; return this; }
}
public static class ApiServiceResponse implements IServiceResponse
{
/**
* Information about the response.
*/
@ApiMember(Description="Information about the response.", IsRequired=true)
public String Description = null;
/**
* Heading or summary of the response.
*/
@ApiMember(Description="Heading or summary of the response.", IsRequired=true)
public String Heading = null;
/**
* Did the intended operation for this response complete successfully?
*/
@ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
public Boolean WasSuccessful = null;
public ResponseStatus ResponseStatus = null;
public String getDescription() { return Description; }
public ApiServiceResponse setDescription(String value) { this.Description = value; return this; }
public String getHeading() { return Heading; }
public ApiServiceResponse setHeading(String value) { this.Heading = value; return this; }
public Boolean isWasSuccessful() { return WasSuccessful; }
public ApiServiceResponse setWasSuccessful(Boolean value) { this.WasSuccessful = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public ApiServiceResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class PrincipalData
{
public Integer PrincipalId = null;
public String Name = null;
public String LogoImageUrl = null;
public ArrayList<ProductDataCategory> Products = null;
public String UpliftPrefix = null;
public String ContactName = null;
public String ContactNumber = null;
public String ContactEmail = null;
public Boolean HasLogo = null;
public Boolean AllowProductLookup = null;
public Boolean CaptureSerialNumber = null;
public Boolean ShowProductionDate = null;
public Boolean ShowExpiryDate = null;
public Boolean ShowBatchCode = null;
public Boolean SealNumberPerProduct = null;
public ArrayList<StockStatusData> AllowedProductStockStatuses = null;
public Boolean Enabled = null;
public Boolean ShowSealNumber = null;
public Boolean ShowSealWeight = null;
public Boolean ConsolidationEnabled = null;
public Integer getPrincipalId() { return PrincipalId; }
public PrincipalData setPrincipalId(Integer value) { this.PrincipalId = value; return this; }
public String getName() { return Name; }
public PrincipalData setName(String value) { this.Name = value; return this; }
public String getLogoImageUrl() { return LogoImageUrl; }
public PrincipalData setLogoImageUrl(String value) { this.LogoImageUrl = value; return this; }
public ArrayList<ProductDataCategory> getProducts() { return Products; }
public PrincipalData setProducts(ArrayList<ProductDataCategory> value) { this.Products = value; return this; }
public String getUpliftPrefix() { return UpliftPrefix; }
public PrincipalData setUpliftPrefix(String value) { this.UpliftPrefix = value; return this; }
public String getContactName() { return ContactName; }
public PrincipalData setContactName(String value) { this.ContactName = value; return this; }
public String getContactNumber() { return ContactNumber; }
public PrincipalData setContactNumber(String value) { this.ContactNumber = value; return this; }
public String getContactEmail() { return ContactEmail; }
public PrincipalData setContactEmail(String value) { this.ContactEmail = value; return this; }
public Boolean isHasLogo() { return HasLogo; }
public PrincipalData setHasLogo(Boolean value) { this.HasLogo = value; return this; }
public Boolean isAllowProductLookup() { return AllowProductLookup; }
public PrincipalData setAllowProductLookup(Boolean value) { this.AllowProductLookup = value; return this; }
public Boolean isCaptureSerialNumber() { return CaptureSerialNumber; }
public PrincipalData setCaptureSerialNumber(Boolean value) { this.CaptureSerialNumber = value; return this; }
public Boolean isShowProductionDate() { return ShowProductionDate; }
public PrincipalData setShowProductionDate(Boolean value) { this.ShowProductionDate = value; return this; }
public Boolean isShowExpiryDate() { return ShowExpiryDate; }
public PrincipalData setShowExpiryDate(Boolean value) { this.ShowExpiryDate = value; return this; }
public Boolean isShowBatchCode() { return ShowBatchCode; }
public PrincipalData setShowBatchCode(Boolean value) { this.ShowBatchCode = value; return this; }
public Boolean isSealNumberPerProduct() { return SealNumberPerProduct; }
public PrincipalData setSealNumberPerProduct(Boolean value) { this.SealNumberPerProduct = value; return this; }
public ArrayList<StockStatusData> getAllowedProductStockStatuses() { return AllowedProductStockStatuses; }
public PrincipalData setAllowedProductStockStatuses(ArrayList<StockStatusData> value) { this.AllowedProductStockStatuses = value; return this; }
public Boolean isEnabled() { return Enabled; }
public PrincipalData setEnabled(Boolean value) { this.Enabled = value; return this; }
public Boolean isShowSealNumber() { return ShowSealNumber; }
public PrincipalData setShowSealNumber(Boolean value) { this.ShowSealNumber = value; return this; }
public Boolean isShowSealWeight() { return ShowSealWeight; }
public PrincipalData setShowSealWeight(Boolean value) { this.ShowSealWeight = value; return this; }
public Boolean isConsolidationEnabled() { return ConsolidationEnabled; }
public PrincipalData setConsolidationEnabled(Boolean value) { this.ConsolidationEnabled = value; return this; }
}
public static class ProductDataCategory
{
public String UnitBarcode = null;
public ArrayList<ProductData> Products = null;
public String getUnitBarcode() { return UnitBarcode; }
public ProductDataCategory setUnitBarcode(String value) { this.UnitBarcode = value; return this; }
public ArrayList<ProductData> getProducts() { return Products; }
public ProductDataCategory setProducts(ArrayList<ProductData> value) { this.Products = value; return this; }
}
public static class ProductData
{
public Integer ProductId = null;
public Integer PrincipalId = null;
public String PrincipalPrefix = null;
public String Name = null;
public String Category = null;
public String ProductCode = null;
public String UnitBarcode = null;
public Integer CartonQuantity = null;
public Integer ShrinkQuantity = null;
public Integer UnitQuantity = null;
public String CartonMeasurement = null;
public String ShrinkMeasurement = null;
public String UnitMeasurement = null;
public Double CartonWeight = null;
public Double ShrinkWeight = null;
public BigDecimal UnitWeight = null;
public BigDecimal CartonPrice = null;
public BigDecimal ShrinkPrice = null;
public BigDecimal UnitPrice = null;
public Integer UnitOfMeasureId = null;
public Integer getProductId() { return ProductId; }
public ProductData setProductId(Integer value) { this.ProductId = value; return this; }
public Integer getPrincipalId() { return PrincipalId; }
public ProductData setPrincipalId(Integer value) { this.PrincipalId = value; return this; }
public String getPrincipalPrefix() { return PrincipalPrefix; }
public ProductData setPrincipalPrefix(String value) { this.PrincipalPrefix = value; return this; }
public String getName() { return Name; }
public ProductData setName(String value) { this.Name = value; return this; }
public String getCategory() { return Category; }
public ProductData setCategory(String value) { this.Category = value; return this; }
public String getProductCode() { return ProductCode; }
public ProductData setProductCode(String value) { this.ProductCode = value; return this; }
public String getUnitBarcode() { return UnitBarcode; }
public ProductData setUnitBarcode(String value) { this.UnitBarcode = value; return this; }
public Integer getCartonQuantity() { return CartonQuantity; }
public ProductData setCartonQuantity(Integer value) { this.CartonQuantity = value; return this; }
public Integer getShrinkQuantity() { return ShrinkQuantity; }
public ProductData setShrinkQuantity(Integer value) { this.ShrinkQuantity = value; return this; }
public Integer getUnitQuantity() { return UnitQuantity; }
public ProductData setUnitQuantity(Integer value) { this.UnitQuantity = value; return this; }
public String getCartonMeasurement() { return CartonMeasurement; }
public ProductData setCartonMeasurement(String value) { this.CartonMeasurement = value; return this; }
public String getShrinkMeasurement() { return ShrinkMeasurement; }
public ProductData setShrinkMeasurement(String value) { this.ShrinkMeasurement = value; return this; }
public String getUnitMeasurement() { return UnitMeasurement; }
public ProductData setUnitMeasurement(String value) { this.UnitMeasurement = value; return this; }
public Double getCartonWeight() { return CartonWeight; }
public ProductData setCartonWeight(Double value) { this.CartonWeight = value; return this; }
public Double getShrinkWeight() { return ShrinkWeight; }
public ProductData setShrinkWeight(Double value) { this.ShrinkWeight = value; return this; }
public BigDecimal getUnitWeight() { return UnitWeight; }
public ProductData setUnitWeight(BigDecimal value) { this.UnitWeight = value; return this; }
public BigDecimal getCartonPrice() { return CartonPrice; }
public ProductData setCartonPrice(BigDecimal value) { this.CartonPrice = value; return this; }
public BigDecimal getShrinkPrice() { return ShrinkPrice; }
public ProductData setShrinkPrice(BigDecimal value) { this.ShrinkPrice = value; return this; }
public BigDecimal getUnitPrice() { return UnitPrice; }
public ProductData setUnitPrice(BigDecimal value) { this.UnitPrice = value; return this; }
public Integer getUnitOfMeasureId() { return UnitOfMeasureId; }
public ProductData setUnitOfMeasureId(Integer value) { this.UnitOfMeasureId = value; return this; }
}
public static class StockStatusData
{
public Integer Id = null;
public String Name = null;
public Boolean PhotoRequired = null;
public Boolean BatchCodeMandatory = null;
public String Color = null;
public Integer getId() { return Id; }
public StockStatusData setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public StockStatusData setName(String value) { this.Name = value; return this; }
public Boolean isPhotoRequired() { return PhotoRequired; }
public StockStatusData setPhotoRequired(Boolean value) { this.PhotoRequired = value; return this; }
public Boolean isBatchCodeMandatory() { return BatchCodeMandatory; }
public StockStatusData setBatchCodeMandatory(Boolean value) { this.BatchCodeMandatory = value; return this; }
public String getColor() { return Color; }
public StockStatusData setColor(String value) { this.Color = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /principal/get HTTP/1.1 Host: returnit-api-dev.happen.zone Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"Data":{"PrincipalId":0,"Name":"String","LogoImageUrl":"String","Products":[{"UnitBarcode":"String","Products":[{"ProductId":0,"PrincipalId":0,"PrincipalPrefix":"String","Name":"String","Category":"String","ProductCode":"String","UnitBarcode":"String","CartonQuantity":0,"ShrinkQuantity":0,"UnitQuantity":0,"CartonMeasurement":"String","ShrinkMeasurement":"String","UnitMeasurement":"String","CartonWeight":0,"ShrinkWeight":0,"UnitWeight":0,"CartonPrice":0,"ShrinkPrice":0,"UnitPrice":0,"UnitOfMeasureId":0}]}],"UpliftPrefix":"String","ContactName":"String","ContactNumber":"String","ContactEmail":"String","HasLogo":false,"AllowProductLookup":false,"CaptureSerialNumber":false,"ShowProductionDate":false,"ShowExpiryDate":false,"ShowBatchCode":false,"SealNumberPerProduct":false,"AllowedProductStockStatuses":[{"Id":0,"Name":"String","PhotoRequired":false,"BatchCodeMandatory":false,"Color":"String"}],"Enabled":false,"ShowSealNumber":false,"ShowSealWeight":false,"ConsolidationEnabled":false},"Description":"String","Heading":"String","WasSuccessful":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}