Pecuario.Backend

<back to all web services

GetRegionsByCountry

The following routes are available for this service:
GET/api/v1/utils/regions
GET/api/v1/utils/regions/{CountryId}
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class GetRegionsByCountry implements IGet
    {
        public Integer countryId = null;
        
        public Integer getCountryId() { return countryId; }
        public GetRegionsByCountry setCountryId(Integer value) { this.countryId = value; return this; }
    }

    public static class GetRegionsByCountryResponse extends BaseResponse
    {
        public ArrayList<Region> regions = null;
        
        public ArrayList<Region> getRegions() { return regions; }
        public GetRegionsByCountryResponse setRegions(ArrayList<Region> value) { this.regions = 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 Region
    {
        public Integer id = null;
        @References(Country.class)
        public Integer countryId = null;

        @Required()
        @StringLength(200)
        public String name = null;
        
        public Integer getId() { return id; }
        public Region setId(Integer value) { this.id = value; return this; }
        public Integer getCountryId() { return countryId; }
        public Region setCountryId(Integer value) { this.countryId = value; return this; }
        public String getName() { return name; }
        public Region setName(String value) { this.name = value; return this; }
    }

}

Java GetRegionsByCountry DTOs

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

HTTP + JSV

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

GET /api/v1/utils/regions HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	regions: 
	[
		{
			id: 0,
			countryId: 0,
			name: String
		}
	]
}