Pecuario.Backend

<back to all web services

CreateFarm

Requires Authentication
The following routes are available for this service:
POST/api/v1/farms
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class CreateFarm implements IPost
    {
        public String name = null;
        public Integer regionId = null;
        public Integer measurementUnitId = null;
        public BigDecimal area = null;
        
        public String getName() { return name; }
        public CreateFarm setName(String value) { this.name = value; return this; }
        public Integer getRegionId() { return regionId; }
        public CreateFarm setRegionId(Integer value) { this.regionId = value; return this; }
        public Integer getMeasurementUnitId() { return measurementUnitId; }
        public CreateFarm setMeasurementUnitId(Integer value) { this.measurementUnitId = value; return this; }
        public BigDecimal getArea() { return area; }
        public CreateFarm setArea(BigDecimal value) { this.area = value; return this; }
    }

    public static class CreateFarmResponse extends BaseResponse
    {
        
    }

    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; }
    }

}

Java CreateFarm DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/v1/farms HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"name":"String","regionId":0,"measurementUnitId":0,"area":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}