| All Verbs | /api/suburbs |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Get all suburbs for the specified country, state and/or postcode
*/
@Api(Description="Get all suburbs for the specified country, state and/or postcode")
public static class GetSuburbs
{
/**
* Get suburbs matching the specified search text criteria.
*/
@ApiMember(Description="Get suburbs matching the specified search text criteria.", Name="SearchText")
public String SearchText = null;
/**
* State to get suburbs for
*/
@ApiMember(Description="State to get suburbs for", Name="StateName")
public String StateName = null;
/**
* Postcode to get suburbs for
*/
@ApiMember(Description="Postcode to get suburbs for", Name="Postcode")
public String PostCode = null;
/**
* Country to get suburbs for
*/
@ApiMember(Description="Country to get suburbs for", Name="CountryId")
public UUID CountryId = null;
/**
* Country to get suburbs for
*/
@ApiMember(Description="Country to get suburbs for", Name="CountryName")
public String CountryName = null;
public String getSearchText() { return SearchText; }
public GetSuburbs setSearchText(String value) { this.SearchText = value; return this; }
public String getStateName() { return StateName; }
public GetSuburbs setStateName(String value) { this.StateName = value; return this; }
public String getPostCode() { return PostCode; }
public GetSuburbs setPostCode(String value) { this.PostCode = value; return this; }
public UUID getCountryId() { return CountryId; }
public GetSuburbs setCountryId(UUID value) { this.CountryId = value; return this; }
public String getCountryName() { return CountryName; }
public GetSuburbs setCountryName(String value) { this.CountryName = value; return this; }
}
@ApiResponse(Description="List of suburbs matching the criteria")
public static class GetSuburbsResponse
{
public ArrayList<SuburbModel> Suburbs = null;
public ResponseStatus ResponseStatus = null;
public ArrayList<SuburbModel> getSuburbs() { return Suburbs; }
public GetSuburbsResponse setSuburbs(ArrayList<SuburbModel> value) { this.Suburbs = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public GetSuburbsResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class SuburbModel
{
public UUID SuburbId = null;
public String Name = null;
public UUID StateId = null;
public String StateName = null;
public String PostCode = null;
public UUID CountryId = null;
public String CountryName = null;
public UUID getSuburbId() { return SuburbId; }
public SuburbModel setSuburbId(UUID value) { this.SuburbId = value; return this; }
public String getName() { return Name; }
public SuburbModel setName(String value) { this.Name = value; return this; }
public UUID getStateId() { return StateId; }
public SuburbModel setStateId(UUID value) { this.StateId = value; return this; }
public String getStateName() { return StateName; }
public SuburbModel setStateName(String value) { this.StateName = value; return this; }
public String getPostCode() { return PostCode; }
public SuburbModel setPostCode(String value) { this.PostCode = value; return this; }
public UUID getCountryId() { return CountryId; }
public SuburbModel setCountryId(UUID value) { this.CountryId = value; return this; }
public String getCountryName() { return CountryName; }
public SuburbModel setCountryName(String value) { this.CountryName = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/suburbs HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"SearchText":"String","StateName":"String","PostCode":"String","CountryId":"00000000-0000-0000-0000-000000000000","CountryName":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Suburbs":[{"SuburbId":"00000000-0000-0000-0000-000000000000","Name":"String","StateId":"00000000-0000-0000-0000-000000000000","StateName":"String","PostCode":"String","CountryId":"00000000-0000-0000-0000-000000000000","CountryName":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}