| POST | /quote/validatewaypoints | Validate the waypoints for a client. |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class ValidateWaypoints extends ApiServiceRequest implements ILogRequest
{
/**
* Array of waypoints
*/
@ApiMember(Description="Array of waypoints", IsRequired=true)
public ArrayList<RequestQuoteWaypoint> Waypoints = null;
/**
* Set this to true to prevent while testing the API.
*/
@ApiMember(Description="Set this to true to prevent while testing the API.", IsRequired=true)
public Boolean Test = null;
public ArrayList<RequestQuoteWaypoint> getWaypoints() { return Waypoints; }
public ValidateWaypoints setWaypoints(ArrayList<RequestQuoteWaypoint> value) { this.Waypoints = value; return this; }
public Boolean isTest() { return Test; }
public ValidateWaypoints setTest(Boolean value) { this.Test = value; return this; }
}
public static class ApiServiceRequest implements IServiceRequest, IHasApiKey
{
/**
* The API Key required for authentication
*/
@ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
public String ApiKey = null;
public String getApiKey() { return ApiKey; }
public ApiServiceRequest setApiKey(String value) { this.ApiKey = value; return this; }
}
public static class RequestQuoteWaypoint implements IRequestWaypoint
{
/**
* Number of waypoint for ordering
*/
@ApiMember(Description="Number of waypoint for ordering", IsRequired=true)
public Integer WaypointNumber = null;
/**
* Waypoint Latitude
*/
@ApiMember(Description="Waypoint Latitude", IsRequired=true)
public Double Latitude = null;
/**
* Waypoint Longitude
*/
@ApiMember(Description="Waypoint Longitude", IsRequired=true)
public Double Longitude = null;
/**
* Name of contact person at waypoint
*/
@ApiMember(Description="Name of contact person at waypoint", IsRequired=true)
public String ContactName = null;
/**
* Telephone number of contact person at waypoint
*/
@ApiMember(Description="Telephone number of contact person at waypoint", IsRequired=true)
public String ContactNumber = null;
/**
* Instructions for driver to follow at waypoint
*/
@ApiMember(Description="Instructions for driver to follow at waypoint", IsRequired=true)
public String DeliveryInstructions = null;
/**
* Waypoint address
*/
@ApiMember(Description="Waypoint address", IsRequired=true)
public String Address = null;
public Integer getWaypointNumber() { return WaypointNumber; }
public RequestQuoteWaypoint setWaypointNumber(Integer value) { this.WaypointNumber = value; return this; }
public Double getLatitude() { return Latitude; }
public RequestQuoteWaypoint setLatitude(Double value) { this.Latitude = value; return this; }
public Double getLongitude() { return Longitude; }
public RequestQuoteWaypoint setLongitude(Double value) { this.Longitude = value; return this; }
public String getContactName() { return ContactName; }
public RequestQuoteWaypoint setContactName(String value) { this.ContactName = value; return this; }
public String getContactNumber() { return ContactNumber; }
public RequestQuoteWaypoint setContactNumber(String value) { this.ContactNumber = value; return this; }
public String getDeliveryInstructions() { return DeliveryInstructions; }
public RequestQuoteWaypoint setDeliveryInstructions(String value) { this.DeliveryInstructions = value; return this; }
public String getAddress() { return Address; }
public RequestQuoteWaypoint setAddress(String value) { this.Address = value; return this; }
}
public static class ValidateWaypointsResponse extends ApiServiceResponse
{
/**
* List with validation information for each waypoint
*/
@ApiMember(Description="List with validation information for each waypoint")
public ArrayList<WaypointValidationInformation> WaypointValidations = null;
/**
* The total distance for the order
*/
@ApiMember(Description="The total distance for the order")
public Double TotalDistance = null;
/**
* The total distance for the order, formatted as a string
*/
@ApiMember(Description="The total distance for the order, formatted as a string")
public String TotalDistanceValue = null;
/**
* List of information for pricing etc between each waypoint
*/
@ApiMember(Description="List of information for pricing etc between each waypoint")
public ArrayList<WaypointQuoteInformation> Waypoints = null;
/**
* Is there an issue for the waypoints details specified?
*/
@ApiMember(Description="Is there an issue for the waypoints details specified?")
public Boolean WaypointIssue = null;
public ArrayList<WaypointValidationInformation> getWaypointValidations() { return WaypointValidations; }
public ValidateWaypointsResponse setWaypointValidations(ArrayList<WaypointValidationInformation> value) { this.WaypointValidations = value; return this; }
public Double getTotalDistance() { return TotalDistance; }
public ValidateWaypointsResponse setTotalDistance(Double value) { this.TotalDistance = value; return this; }
public String getTotalDistanceValue() { return TotalDistanceValue; }
public ValidateWaypointsResponse setTotalDistanceValue(String value) { this.TotalDistanceValue = value; return this; }
public ArrayList<WaypointQuoteInformation> getWaypoints() { return Waypoints; }
public ValidateWaypointsResponse setWaypoints(ArrayList<WaypointQuoteInformation> value) { this.Waypoints = value; return this; }
public Boolean isWaypointIssue() { return WaypointIssue; }
public ValidateWaypointsResponse setWaypointIssue(Boolean value) { this.WaypointIssue = 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 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 static class WaypointValidationInformation
{
public Integer WaypointNumber = null;
public Boolean IsValid = null;
public ArrayList<String> ErrorMessages = null;
public Integer getWaypointNumber() { return WaypointNumber; }
public WaypointValidationInformation setWaypointNumber(Integer value) { this.WaypointNumber = value; return this; }
public Boolean getIsValid() { return IsValid; }
public WaypointValidationInformation setIsValid(Boolean value) { this.IsValid = value; return this; }
public ArrayList<String> getErrorMessages() { return ErrorMessages; }
public WaypointValidationInformation setErrorMessages(ArrayList<String> value) { this.ErrorMessages = value; return this; }
}
public static class WaypointQuoteInformation extends LinkedWaypoint
{
/**
* Distance between waypoints as a number
*/
@ApiMember(Description="Distance between waypoints as a number")
public Double Distance = null;
/**
* String formatted distance
*/
@ApiMember(Description="String formatted distance")
public String DistanceValue = null;
public Boolean WaypointValid = null;
public String Message = null;
public ArrayList<String> ErrorDetails = null;
/**
* Caculated price between waypoints excluding vat
*/
@ApiMember(Description="Caculated price between waypoints excluding vat")
public BigDecimal Price = null;
/**
* Price excluding vat formatted as a string rand value
*/
@ApiMember(Description="Price excluding vat formatted as a string rand value")
public String PriceValue = null;
/**
* The price between waypoints including vat
*/
@ApiMember(Description="The price between waypoints including vat")
public BigDecimal PriceWithVAT = null;
/**
* The price including vat formatted as a rand value string
*/
@ApiMember(Description="The price including vat formatted as a rand value string")
public String PriceValueWithVAT = null;
public Double getDistance() { return Distance; }
public WaypointQuoteInformation setDistance(Double value) { this.Distance = value; return this; }
public String getDistanceValue() { return DistanceValue; }
public WaypointQuoteInformation setDistanceValue(String value) { this.DistanceValue = value; return this; }
public Boolean isWaypointValid() { return WaypointValid; }
public WaypointQuoteInformation setWaypointValid(Boolean value) { this.WaypointValid = value; return this; }
public String getMessage() { return Message; }
public WaypointQuoteInformation setMessage(String value) { this.Message = value; return this; }
public ArrayList<String> getErrorDetails() { return ErrorDetails; }
public WaypointQuoteInformation setErrorDetails(ArrayList<String> value) { this.ErrorDetails = value; return this; }
public BigDecimal getPrice() { return Price; }
public WaypointQuoteInformation setPrice(BigDecimal value) { this.Price = value; return this; }
public String getPriceValue() { return PriceValue; }
public WaypointQuoteInformation setPriceValue(String value) { this.PriceValue = value; return this; }
public BigDecimal getPriceWithVAT() { return PriceWithVAT; }
public WaypointQuoteInformation setPriceWithVAT(BigDecimal value) { this.PriceWithVAT = value; return this; }
public String getPriceValueWithVAT() { return PriceValueWithVAT; }
public WaypointQuoteInformation setPriceValueWithVAT(String value) { this.PriceValueWithVAT = value; return this; }
}
public static class LinkedWaypoint
{
public Integer FromWaypointNumber = null;
public Integer ToWaypointNumber = null;
public Double FromLatitude = null;
public Double FromLongitude = null;
public Double ToLatitude = null;
public Double ToLongitude = null;
public Integer getFromWaypointNumber() { return FromWaypointNumber; }
public LinkedWaypoint setFromWaypointNumber(Integer value) { this.FromWaypointNumber = value; return this; }
public Integer getToWaypointNumber() { return ToWaypointNumber; }
public LinkedWaypoint setToWaypointNumber(Integer value) { this.ToWaypointNumber = value; return this; }
public Double getFromLatitude() { return FromLatitude; }
public LinkedWaypoint setFromLatitude(Double value) { this.FromLatitude = value; return this; }
public Double getFromLongitude() { return FromLongitude; }
public LinkedWaypoint setFromLongitude(Double value) { this.FromLongitude = value; return this; }
public Double getToLatitude() { return ToLatitude; }
public LinkedWaypoint setToLatitude(Double value) { this.ToLatitude = value; return this; }
public Double getToLongitude() { return ToLongitude; }
public LinkedWaypoint setToLongitude(Double value) { this.ToLongitude = 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.
POST /quote/validatewaypoints HTTP/1.1
Host: 1fetch.api.client.prod.86degrees.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Waypoints":[{"WaypointNumber":0,"Latitude":0,"Longitude":0,"ContactName":"String","ContactNumber":"String","DeliveryInstructions":"String","Address":"String"}],"Test":false,"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{Unable to show example output for type 'ValidateWaypointsResponse' using the custom 'csv' filter}One or more errors occurred. (Object reference not set to an instance of an object.)