-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from amadeus4dev/flight_booking_APIs
Updated according to the appropriate project structure
- Loading branch information
Showing
23 changed files
with
362 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using amadeus; | ||
using amadeus.resources; | ||
using amadeus.travel.flightOffers; | ||
using amadeus.booking; | ||
using System; | ||
using System.Collections.Generic; | ||
using Xunit; | ||
|
@@ -14,35 +14,30 @@ public class FlightOrderManagementTest | |
public void Get_FlightOrderManagement() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
var flightOrderManagement = new FlightOrderManagement(amadeus); | ||
FlightOrderCreateQuery response = flightOrderManagement.getFlightOrderManagement(Params.with("flight-orderId", "eJzTd9cPsbR083cDAArgAkc%3D")); | ||
FlightOrderCreateQuery response = amadeus.booking.flightOrder.getFlightOrderManagement(Params.with("flight-orderId", "eJzTd9cPsbR083cDAArgAkc%3D")); | ||
Assert.True(response != null); | ||
Assert.True(response.type == "flight-order"); | ||
}*/ | ||
|
||
[Fact] | ||
/*[Fact] | ||
public void Post_FlightOrderManagement() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
|
||
var flightOrderManagement = new FlightOrderManagement(amadeus); | ||
|
||
string body = "{\"data\":{\"type\":\"flight-order\",\"flightOffers\":[{\"type\":\"flight-offer\",\"id\":\"1\",\"source\":\"GDS\",\"instantTicketingRequired\":false,\"nonHomogeneous\":false,\"oneWay\":false,\"lastTicketingDate\":\"2022-01-21\",\"numberOfBookableSeats\":7,\"itineraries\":[{\"duration\":\"PT5H49M\",\"segments\":[{\"departure\":{\"iataCode\":\"JFK\",\"terminal\":\"4\",\"at\":\"2022-02-01T10:31:00\"},\"arrival\":{\"iataCode\":\"LAX\",\"terminal\":\"2\",\"at\":\"2022-02-01T13:20:00\"},\"carrierCode\":\"DL\",\"number\":\"351\",\"aircraft\":{\"code\":\"764\"},\"operating\":{\"carrierCode\":\"DL\"},\"duration\":\"PT5H49M\",\"id\":\"30\",\"numberOfStops\":0,\"blacklistedInEU\":false}]}],\"price\":{\"currency\":\"EUR\",\"total\":\"121.33\",\"base\":\"101.00\",\"fees\":[{\"amount\":\"0.00\",\"type\":\"SUPPLIER\"},{\"amount\":\"0.00\",\"type\":\"TICKETING\"}],\"grandTotal\":\"121.33\"},\"pricingOptions\":{\"fareType\":[\"PUBLISHED\"],\"includedCheckedBagsOnly\":false},\"validatingAirlineCodes\":[\"DL\"],\"travelerPricings\":[{\"travelerId\":\"1\",\"fareOption\":\"STANDARD\",\"travelerType\":\"ADULT\",\"price\":{\"currency\":\"EUR\",\"total\":\"121.33\",\"base\":\"101.00\"},\"fareDetailsBySegment\":[{\"segmentId\":\"30\",\"cabin\":\"ECONOMY\",\"fareBasis\":\"TA7NA0BQ\",\"brandedFare\":\"BASICECON\",\"class\":\"E\",\"includedCheckedBags\":{\"quantity\":0}}]}]}],\"travelers\":[{\"id\":\"1\",\"dateOfBirth\":\"1987-07-22\",\"name\":{\"firstName\":\"amir\",\"lastName\":\"taheri\"},\"gender\":\"MALE\",\"documents\":[{\"documentType\":\"PASSPORT\",\"number\":\"J12345678\",\"expiryDate\":\"2024-02-22\",\"issuanceCountry\":\"TR\",\"nationality\":\"TR\",\"holder\":true}]}],\"contacts\":[{\"companyName\":\"INCREIBLEVIAJES\",\"purpose\":\"STANDARD\",\"phones\":[{\"deviceType\":\"LANDLINE\",\"countryCallingCode\":\"34\",\"number\":\"480080071\"},{\"deviceType\":\"MOBILE\",\"countryCallingCode\":\"33\",\"number\":\"480080072\"}],\"emailAddress\":\"[email protected]\"}]}}"; | ||
string body = "{\"data\":{\"type\":\"flight-order\",\"flightOffers\":[{\"type\":\"flight-offer\",\"id\":\"1\",\"source\":\"GDS\",\"instantTicketingRequired\":false,\"nonHomogeneous\":false,\"oneWay\":false,\"lastTicketingDate\":\"2022-01-21\",\"numberOfBookableSeats\":7,\"itineraries\":[{\"duration\":\"PT5H49M\",\"segments\":[{\"departure\":{\"iataCode\":\"JFK\",\"terminal\":\"4\",\"at\":\"2022-02-01T10:31:00\"},\"arrival\":{\"iataCode\":\"LAX\",\"terminal\":\"2\",\"at\":\"2022-02-01T13:20:00\"},\"carrierCode\":\"DL\",\"number\":\"351\",\"aircraft\":{\"code\":\"764\"},\"operating\":{\"carrierCode\":\"DL\"},\"duration\":\"PT5H49M\",\"id\":\"30\",\"numberOfStops\":0,\"blacklistedInEU\":false}]}],\"price\":{\"currency\":\"EUR\",\"total\":\"122.53\",\"base\":\"101.00\",\"fees\":[{\"amount\":\"0.00\",\"type\":\"SUPPLIER\"},{\"amount\":\"0.00\",\"type\":\"TICKETING\"}],\"grandTotal\":\"122.53\"},\"pricingOptions\":{\"fareType\":[\"PUBLISHED\"],\"includedCheckedBagsOnly\":false},\"validatingAirlineCodes\":[\"DL\"],\"travelerPricings\":[{\"travelerId\":\"1\",\"fareOption\":\"STANDARD\",\"travelerType\":\"ADULT\",\"price\":{\"currency\":\"EUR\",\"total\":\"122.53\",\"base\":\"101.00\"},\"fareDetailsBySegment\":[{\"segmentId\":\"30\",\"cabin\":\"ECONOMY\",\"fareBasis\":\"TA7NA0BQ\",\"brandedFare\":\"BASICECON\",\"class\":\"E\",\"includedCheckedBags\":{\"quantity\":0}}]}]}],\"travelers\":[{\"id\":\"1\",\"dateOfBirth\":\"1987-07-22\",\"name\":{\"firstName\":\"amir\",\"lastName\":\"taheri\"},\"gender\":\"MALE\",\"documents\":[{\"documentType\":\"PASSPORT\",\"number\":\"J12345678\",\"expiryDate\":\"2024-02-22\",\"issuanceCountry\":\"TR\",\"nationality\":\"TR\",\"holder\":true}]}],\"contacts\":[{\"companyName\":\"INCREIBLEVIAJES\",\"purpose\":\"STANDARD\",\"phones\":[{\"deviceType\":\"LANDLINE\",\"countryCallingCode\":\"34\",\"number\":\"480080071\"},{\"deviceType\":\"MOBILE\",\"countryCallingCode\":\"33\",\"number\":\"480080072\"}],\"emailAddress\":\"[email protected]\"}]}}"; | ||
FlightOrderCreateQuery response = flightOrderManagement.postFlightOrderManagement(body); | ||
FlightOrderCreateQuery response = amadeus.booking.flightOrder.postFlightOrderManagement(body); | ||
Assert.True(response != null); | ||
//Assert.True(restriction[0].type == "flight-order"); | ||
//Assert.True(response[0].type == "flight-order"); | ||
} | ||
}*/ | ||
|
||
/*[Fact] | ||
public void Delete_FlightOrderManagement() | ||
{ | ||
var amadeus = GetAmadeusBuild(); | ||
var flightOrderManagement = new FlightOrderManagement(amadeus); | ||
FlightOrderCreateQuery[] response = flightOrderManagement.deleteFlightOrderManagement(Params.with("flight-orderId", "eJzTd9cPsbR083cDAArgAkc%3D")); | ||
FlightOrderCreateQuery[] response = amadeus.booking.flightOrder.deleteFlightOrderManagement(Params.with("flight-orderId", "eJzTd9cPsbR083cDAArgAkc%3D")); | ||
Assert.True(response != null); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using amadeus.booking; | ||
|
||
namespace amadeus | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// Booking | ||
/// | ||
/// <para> | ||
/// A namespaced client for the | ||
/// <code>/v2/booking</code> endpoints. | ||
/// </para> | ||
/// | ||
/// <para>Access via the Amadeus client object.</para> | ||
/// | ||
/// <code> | ||
/// Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); | ||
/// amadeus.booking; | ||
/// </code> | ||
/// | ||
/// </summary> | ||
public class Booking | ||
{ | ||
internal Amadeus client; | ||
|
||
/// <summary> | ||
/// A namespaced client for the | ||
/// <code>/v1/booking/flight-orders</code> endpoints. | ||
/// </summary> | ||
public FlightOrderManagement flightOrder; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the Booking class. | ||
/// </summary> | ||
/// <param name="client">Client.</param> | ||
public Booking(Amadeus client) | ||
{ | ||
this.client = client; | ||
this.flightOrder = new FlightOrderManagement(client); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using amadeus.dutyOfcare; | ||
|
||
namespace amadeus | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// DutyOfCare | ||
/// | ||
/// <para> | ||
/// A namespaced client for the | ||
/// <code>/v1/duty-of-care</code> endpoints. | ||
/// </para> | ||
/// | ||
/// <para>Access via the Amadeus client object.</para> | ||
/// | ||
/// <code> | ||
/// Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); | ||
/// amadeus.dutyOfCare; | ||
/// </code> | ||
/// | ||
/// </summary> | ||
public class DutyOfCare | ||
{ | ||
internal Amadeus client; | ||
|
||
/// <summary> | ||
/// A namespaced client for the | ||
/// <code>/v1/duty-of-care/diseases</code> endpoints. | ||
/// </summary> | ||
public Diseases diseases; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the DutyOfCare class. | ||
/// </summary> | ||
/// <param name="client">Client.</param> | ||
public DutyOfCare(Amadeus client) | ||
{ | ||
this.client = client; | ||
this.diseases = new Diseases(client); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using amadeus.safety.safetyRatedLocations; | ||
|
||
namespace amadeus | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// Safety | ||
/// | ||
/// <para> | ||
/// A namespaced client for the | ||
/// <code>/v1/safety</code> endpoints. | ||
/// </para> | ||
/// | ||
/// <para>Access via the Amadeus client object.</para> | ||
/// | ||
/// <code> | ||
/// Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); | ||
/// amadeus.safety; | ||
/// </code> | ||
/// | ||
/// </summary> | ||
public class Safety | ||
{ | ||
internal Amadeus client; | ||
|
||
/// <summary> | ||
/// A namespaced client for the | ||
/// <code>/v1/safety/safety-rated-locations</code> endpoints. | ||
/// </summary> | ||
public SafePlace safetyRatedLocations; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the Safety class. | ||
/// </summary> | ||
/// <param name="client">Client.</param> | ||
public Safety(Amadeus client) | ||
{ | ||
this.client = client; | ||
this.safetyRatedLocations = new SafePlace(client); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.