| POST | /pickmeup/takemehome | Request a booking for the Take Me Home service. |
|---|
import 'package:servicestack/servicestack.dart';
class ApiServiceRequest implements IServiceRequest, IHasApiKey, IConvertible
{
/**
* The API Key required for authentication
*/
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
String? ApiKey;
ApiServiceRequest({this.ApiKey});
ApiServiceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey
};
getTypeName() => "ApiServiceRequest";
TypeContext? context = _ctx;
}
class BookingLocation implements IConvertible
{
/**
* Latitude of the pickup/drop-off location.
*/
// @ApiMember(Description="Latitude of the pickup/drop-off location.", IsRequired=true)
double? Latitude;
/**
* Longitude of the pickup/drop-off location.
*/
// @ApiMember(Description="Longitude of the pickup/drop-off location.", IsRequired=true)
double? Longitude;
/**
* Address of the pickup/drop-off location.
*/
// @ApiMember(Description="Address of the pickup/drop-off location.", IsRequired=true)
String? Address;
BookingLocation({this.Latitude,this.Longitude,this.Address});
BookingLocation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Latitude = JsonConverters.toDouble(json['Latitude']);
Longitude = JsonConverters.toDouble(json['Longitude']);
Address = json['Address'];
return this;
}
Map<String, dynamic> toJson() => {
'Latitude': Latitude,
'Longitude': Longitude,
'Address': Address
};
getTypeName() => "BookingLocation";
TypeContext? context = _ctx;
}
class PickMeUpActivationRequest extends ApiServiceRequest implements IConvertible
{
/**
* ID Number of the user making this request.
*/
// @ApiMember(Description="ID Number of the user making this request.", IsRequired=true)
String? IdNumber;
/**
* The number of people to be picked up.
*/
// @ApiMember(Description="The number of people to be picked up.", IsRequired=true)
int? PassengerCount;
/**
* Date and Time of the pickup in ISO 8601 format.
*/
// @ApiMember(Description="Date and Time of the pickup in ISO 8601 format.", IsRequired=true)
String? BookingDate;
/**
* Name of contact person at pickup.
*/
// @ApiMember(Description="Name of contact person at pickup.", IsRequired=true)
String? ContactName;
/**
* Contact number of contact person at pickup.
*/
// @ApiMember(Description="Contact number of contact person at pickup.", IsRequired=true)
String? ContactNumber;
/**
* The location details of where the clients are to be picked up.
*/
// @ApiMember(DataType="BookingLocation", Description="The location details of where the clients are to be picked up.", IsRequired=true)
BookingLocation? PickupLocation;
/**
* The location details of where the clients are to be dropped off.
*/
// @ApiMember(DataType="BookingLocation", Description="The location details of where the clients are to be dropped off.", IsRequired=true)
BookingLocation? DropoffLocation;
PickMeUpActivationRequest({this.IdNumber,this.PassengerCount,this.BookingDate,this.ContactName,this.ContactNumber,this.PickupLocation,this.DropoffLocation});
PickMeUpActivationRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
IdNumber = json['IdNumber'];
PassengerCount = json['PassengerCount'];
BookingDate = json['BookingDate'];
ContactName = json['ContactName'];
ContactNumber = json['ContactNumber'];
PickupLocation = JsonConverters.fromJson(json['PickupLocation'],'BookingLocation',context!);
DropoffLocation = JsonConverters.fromJson(json['DropoffLocation'],'BookingLocation',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'IdNumber': IdNumber,
'PassengerCount': PassengerCount,
'BookingDate': BookingDate,
'ContactName': ContactName,
'ContactNumber': ContactNumber,
'PickupLocation': JsonConverters.toJson(PickupLocation,'BookingLocation',context!),
'DropoffLocation': JsonConverters.toJson(DropoffLocation,'BookingLocation',context!)
});
getTypeName() => "PickMeUpActivationRequest";
TypeContext? context = _ctx;
}
class ApiServiceResponse implements IServiceResponse, IConvertible
{
String? Description;
String? Heading;
bool? WasSuccessful;
dynamic? ModelState;
ApiServiceResponse({this.Description,this.Heading,this.WasSuccessful,this.ModelState});
ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Description = json['Description'];
Heading = json['Heading'];
WasSuccessful = json['WasSuccessful'];
ModelState = JsonConverters.fromJson(json['ModelState'],'dynamic',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Description': Description,
'Heading': Heading,
'WasSuccessful': WasSuccessful,
'ModelState': JsonConverters.toJson(ModelState,'dynamic',context!)
};
getTypeName() => "ApiServiceResponse";
TypeContext? context = _ctx;
}
class PickMeUpResponse extends ApiServiceResponse implements IConvertible
{
/**
* Is the requested product set up and enabled on Galaxy.
*/
// @ApiMember(Description="Is the requested product set up and enabled on Galaxy.")
bool? ProductAvailable;
/**
* Does the user have access to this product, based on their Galaxy profile.
*/
// @ApiMember(Description="Does the user have access to this product, based on their Galaxy profile.")
bool? UserHasAccess;
/**
* This indicates that the pickup location is outside of the service area of the service provider.
*/
// @ApiMember(Description="This indicates that the pickup location is outside of the service area of the service provider.")
bool? PickupOutOfBounds;
/**
* This indicates that the dropoff location is outside of the service area of the service provider.
*/
// @ApiMember(Description="This indicates that the dropoff location is outside of the service area of the service provider.")
bool? DropoffOutOfBounds;
/**
* This indicates that the pickup time is not far enough in the future. The time needs to be at least 60 minutes in the future, or 90 minutes during peak times. See the documentation for more details.
*/
// @ApiMember(Description="This indicates that the pickup time is not far enough in the future. The time needs to be at least 60 minutes in the future, or 90 minutes during peak times. See the documentation for more details.")
bool? PickupTooSoon;
/**
* The booking reference number returned by the service provider. To be shown to the client.
*/
// @ApiMember(Description="The booking reference number returned by the service provider. To be shown to the client.")
String? ReferenceNumber;
/**
* Error message from service provider.
*/
// @ApiMember(Description="Error message from service provider.")
String? ErrorMessage;
/**
* Error code from service provider.
*/
// @ApiMember(Description="Error code from service provider.")
int? ErrorCode;
PickMeUpResponse({this.ProductAvailable,this.UserHasAccess,this.PickupOutOfBounds,this.DropoffOutOfBounds,this.PickupTooSoon,this.ReferenceNumber,this.ErrorMessage,this.ErrorCode});
PickMeUpResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ProductAvailable = json['ProductAvailable'];
UserHasAccess = json['UserHasAccess'];
PickupOutOfBounds = json['PickupOutOfBounds'];
DropoffOutOfBounds = json['DropoffOutOfBounds'];
PickupTooSoon = json['PickupTooSoon'];
ReferenceNumber = json['ReferenceNumber'];
ErrorMessage = json['ErrorMessage'];
ErrorCode = json['ErrorCode'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ProductAvailable': ProductAvailable,
'UserHasAccess': UserHasAccess,
'PickupOutOfBounds': PickupOutOfBounds,
'DropoffOutOfBounds': DropoffOutOfBounds,
'PickupTooSoon': PickupTooSoon,
'ReferenceNumber': ReferenceNumber,
'ErrorMessage': ErrorMessage,
'ErrorCode': ErrorCode
});
getTypeName() => "PickMeUpResponse";
TypeContext? context = _ctx;
}
class TakeMeHomeRequest extends PickMeUpActivationRequest implements IConvertible
{
TakeMeHomeRequest();
TakeMeHomeRequest.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "TakeMeHomeRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'galaxymobile.api.client.prod.86degrees.com', types: <String, TypeInfo> {
'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
'BookingLocation': TypeInfo(TypeOf.Class, create:() => BookingLocation()),
'PickMeUpActivationRequest': TypeInfo(TypeOf.Class, create:() => PickMeUpActivationRequest()),
'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
'PickMeUpResponse': TypeInfo(TypeOf.Class, create:() => PickMeUpResponse()),
'TakeMeHomeRequest': TypeInfo(TypeOf.Class, create:() => TakeMeHomeRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /pickmeup/takemehome HTTP/1.1
Host: galaxymobile.api.client.prod.86degrees.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"IdNumber":"String","PassengerCount":0,"BookingDate":"String","ContactName":"String","ContactNumber":"String","PickupLocation":{"Latitude":0,"Longitude":0,"Address":"String"},"DropoffLocation":{"Latitude":0,"Longitude":0,"Address":"String"},"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ProductAvailable":false,"UserHasAccess":false,"PickupOutOfBounds":false,"DropoffOutOfBounds":false,"PickupTooSoon":false,"ReferenceNumber":"String","ErrorMessage":"String","ErrorCode":0,"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}