| GET | /api/v1/farms/{Id} |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class GetFarm implements IGet
{
public Integer id = null;
public Integer getId() { return id; }
public GetFarm setId(Integer value) { this.id = value; return this; }
}
public static class GetFarmResponse extends BaseResponse
{
public Farm farm = null;
public Farm getFarm() { return farm; }
public GetFarmResponse setFarm(Farm value) { this.farm = value; return this; }
}
public static class BaseResponse
{
public Status status = null;
public Status getStatus() { return status; }
public BaseResponse setStatus(Status value) { this.status = value; return this; }
}
public static class Status
{
public String message = null;
public Integer statusCode = null;
public String getMessage() { return message; }
public Status setMessage(String value) { this.message = value; return this; }
public Integer getStatusCode() { return statusCode; }
public Status setStatusCode(Integer value) { this.statusCode = value; return this; }
}
public static class Farm
{
public Integer id = null;
@References(AppUser.class)
public Integer userId = null;
@Required()
@StringLength(100)
public String name = null;
@References(Region.class)
public Integer regionId = null;
@References(MeasurementUnit.class)
public Integer measurementUnitId = null;
public BigDecimal area = null;
public Integer getId() { return id; }
public Farm setId(Integer value) { this.id = value; return this; }
public Integer getUserId() { return userId; }
public Farm setUserId(Integer value) { this.userId = value; return this; }
public String getName() { return name; }
public Farm setName(String value) { this.name = value; return this; }
public Integer getRegionId() { return regionId; }
public Farm setRegionId(Integer value) { this.regionId = value; return this; }
public Integer getMeasurementUnitId() { return measurementUnitId; }
public Farm setMeasurementUnitId(Integer value) { this.measurementUnitId = value; return this; }
public BigDecimal getArea() { return area; }
public Farm setArea(BigDecimal value) { this.area = 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.
GET /api/v1/farms/{Id} HTTP/1.1
Host: pecuario-backend.develsystems.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
farm:
{
id: 0,
userId: 0,
name: String,
regionId: 0,
measurementUnitId: 0,
area: 0
}
}