| GET, POST | /pickmeup/history | Get the user's recent history of bookings. |
|---|
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 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 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 PickMeUpBookingItem implements IConvertible
{
/**
* Date and Time of the pickup in ISO 8601 format.
*/
// @ApiMember(Description="Date and Time of the pickup in ISO 8601 format.")
String? BookingTime;
/**
* 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;
/**
* Date and Time the booking request was made in ISO 8601 format.
*/
// @ApiMember(Description="Date and Time the booking request was made in ISO 8601 format.")
String? DateCreated;
/**
* Status of the booking as returned by the service provider.
*/
// @ApiMember(Description="Status of the booking as returned by the service provider.")
String? Status;
/**
* 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 number of people to be picked up.
*/
// @ApiMember(Description="The number of people to be picked up.", IsRequired=true)
String? PassengerCount;
/**
* The location details of where the clients are to be picked up.
*/
// @ApiMember(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(Description="The location details of where the clients are to be dropped off.", IsRequired=true)
BookingLocation? DropoffLocation;
PickMeUpBookingItem({this.BookingTime,this.ReferenceNumber,this.DateCreated,this.Status,this.ContactName,this.ContactNumber,this.PassengerCount,this.PickupLocation,this.DropoffLocation});
PickMeUpBookingItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BookingTime = json['BookingTime'];
ReferenceNumber = json['ReferenceNumber'];
DateCreated = json['DateCreated'];
Status = json['Status'];
ContactName = json['ContactName'];
ContactNumber = json['ContactNumber'];
PassengerCount = json['PassengerCount'];
PickupLocation = JsonConverters.fromJson(json['PickupLocation'],'BookingLocation',context!);
DropoffLocation = JsonConverters.fromJson(json['DropoffLocation'],'BookingLocation',context!);
return this;
}
Map<String, dynamic> toJson() => {
'BookingTime': BookingTime,
'ReferenceNumber': ReferenceNumber,
'DateCreated': DateCreated,
'Status': Status,
'ContactName': ContactName,
'ContactNumber': ContactNumber,
'PassengerCount': PassengerCount,
'PickupLocation': JsonConverters.toJson(PickupLocation,'BookingLocation',context!),
'DropoffLocation': JsonConverters.toJson(DropoffLocation,'BookingLocation',context!)
};
getTypeName() => "PickMeUpBookingItem";
TypeContext? context = _ctx;
}
class PickMeUpHistoryResponse 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;
/**
* List of booking history items for the Pick Me Up service.
*/
// @ApiMember(Description="List of booking history items for the Pick Me Up service.")
List<PickMeUpBookingItem>? PickMeUpHistory;
/**
* List of booking history items for the Take Me Home service.
*/
// @ApiMember(Description="List of booking history items for the Take Me Home service.")
List<PickMeUpBookingItem>? TakeMeHomeHistory;
PickMeUpHistoryResponse({this.ProductAvailable,this.UserHasAccess,this.PickMeUpHistory,this.TakeMeHomeHistory});
PickMeUpHistoryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ProductAvailable = json['ProductAvailable'];
UserHasAccess = json['UserHasAccess'];
PickMeUpHistory = JsonConverters.fromJson(json['PickMeUpHistory'],'List<PickMeUpBookingItem>',context!);
TakeMeHomeHistory = JsonConverters.fromJson(json['TakeMeHomeHistory'],'List<PickMeUpBookingItem>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ProductAvailable': ProductAvailable,
'UserHasAccess': UserHasAccess,
'PickMeUpHistory': JsonConverters.toJson(PickMeUpHistory,'List<PickMeUpBookingItem>',context!),
'TakeMeHomeHistory': JsonConverters.toJson(TakeMeHomeHistory,'List<PickMeUpBookingItem>',context!)
});
getTypeName() => "PickMeUpHistoryResponse";
TypeContext? context = _ctx;
}
class PickMeUpHistoryRequest extends ApiServiceRequest implements IConvertible
{
/**
* ID Number of the user's history to retrieve.
*/
// @ApiMember(Description="ID Number of the user's history to retrieve.", IsRequired=true)
String? IdNumber;
PickMeUpHistoryRequest({this.IdNumber});
PickMeUpHistoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
IdNumber = json['IdNumber'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'IdNumber': IdNumber
});
getTypeName() => "PickMeUpHistoryRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'galaxymobile.api.client.prod.86degrees.com', types: <String, TypeInfo> {
'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
'BookingLocation': TypeInfo(TypeOf.Class, create:() => BookingLocation()),
'PickMeUpBookingItem': TypeInfo(TypeOf.Class, create:() => PickMeUpBookingItem()),
'PickMeUpHistoryResponse': TypeInfo(TypeOf.Class, create:() => PickMeUpHistoryResponse()),
'List<PickMeUpBookingItem>': TypeInfo(TypeOf.Class, create:() => <PickMeUpBookingItem>[]),
'PickMeUpHistoryRequest': TypeInfo(TypeOf.Class, create:() => PickMeUpHistoryRequest()),
});
Dart PickMeUpHistoryRequest DTOs
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/history HTTP/1.1
Host: galaxymobile.api.client.prod.86degrees.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"IdNumber":"String","ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ProductAvailable":false,"UserHasAccess":false,"PickMeUpHistory":[{}],"TakeMeHomeHistory":[{}],"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}