| PUT | /v1/VehicleSwap | Updates vehicle swap, order and back order records | This endpoint validates a swap vehicle and then calls an endpoint in the Agency API to update vehicle swap, order and back order and sends a message to OneAgent with the updated order vehicle and offers |
|---|
import 'package:servicestack/servicestack.dart';
class VehicleError implements IConvertible
{
String? Field;
String? Message;
VehicleError({this.Field,this.Message});
VehicleError.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Field = json['Field'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'Field': Field,
'Message': Message
};
getTypeName() => "VehicleError";
TypeContext? context = _ctx;
}
class UpdateVehicleSwapResponse implements IConvertible
{
List<VehicleError>? Errors;
UpdateVehicleSwapResponse({this.Errors});
UpdateVehicleSwapResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Errors = JsonConverters.fromJson(json['Errors'],'List<VehicleError>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Errors': JsonConverters.toJson(Errors,'List<VehicleError>',context!)
};
getTypeName() => "UpdateVehicleSwapResponse";
TypeContext? context = _ctx;
}
class UpdateVehicleSwapRequest implements IPost, IConvertible
{
String? VehicleSwapGuid;
String? OrderGuid;
String? BackOrderGuid;
String? GssnId;
String? Agent;
String? ExistingVin;
String? SwapVin;
List<int>? PersonalisedItemOfferIds;
UpdateVehicleSwapRequest({this.VehicleSwapGuid,this.OrderGuid,this.BackOrderGuid,this.GssnId,this.Agent,this.ExistingVin,this.SwapVin,this.PersonalisedItemOfferIds});
UpdateVehicleSwapRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
VehicleSwapGuid = json['VehicleSwapGuid'];
OrderGuid = json['OrderGuid'];
BackOrderGuid = json['BackOrderGuid'];
GssnId = json['GssnId'];
Agent = json['Agent'];
ExistingVin = json['ExistingVin'];
SwapVin = json['SwapVin'];
PersonalisedItemOfferIds = JsonConverters.fromJson(json['PersonalisedItemOfferIds'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'VehicleSwapGuid': VehicleSwapGuid,
'OrderGuid': OrderGuid,
'BackOrderGuid': BackOrderGuid,
'GssnId': GssnId,
'Agent': Agent,
'ExistingVin': ExistingVin,
'SwapVin': SwapVin,
'PersonalisedItemOfferIds': JsonConverters.toJson(PersonalisedItemOfferIds,'List<int>',context!)
};
getTypeName() => "UpdateVehicleSwapRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'prod_api_agency_orch_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'VehicleError': TypeInfo(TypeOf.Class, create:() => VehicleError()),
'UpdateVehicleSwapResponse': TypeInfo(TypeOf.Class, create:() => UpdateVehicleSwapResponse()),
'List<VehicleError>': TypeInfo(TypeOf.Class, create:() => <VehicleError>[]),
'UpdateVehicleSwapRequest': TypeInfo(TypeOf.Class, create:() => UpdateVehicleSwapRequest()),
});
Dart UpdateVehicleSwapRequest DTOs
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.
PUT /v1/VehicleSwap HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: application/json
Content-Type: application/json
Content-Length: length
{"VehicleSwapGuid":"00000000000000000000000000000000","OrderGuid":"00000000000000000000000000000000","BackOrderGuid":"00000000000000000000000000000000","GssnId":"String","Agent":"String","ExistingVin":"String","SwapVin":"String","PersonalisedItemOfferIds":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Errors":[{"Field":"String","Message":"String"}]}