File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
examples/flight/createorders
main/java/com/amadeus/resources Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ public static void main(String[] args) throws ResponseException {
6969 .and ("max" , 1 ));
7070
7171 FlightOrder order = amadeus .booking .flightOrders .post (flightOffersSearches , travelerArray );
72- System .out .println (order );
72+
73+ // Return CO2 Emission of a given flight
74+ String weight = order .getFlightOffers ()[0 ].getItineraries (
75+ )[0 ].getSegments ()[0 ].getCo2Emissions ()[0 ].getWeight ();
76+ String unit = order .getFlightOffers ()[0 ].getItineraries (
77+ )[0 ].getSegments ()[0 ].getCo2Emissions ()[0 ].getWeightUnit ();
78+
79+ System .out .println (weight + unit );
7380 }
7481}
Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ protected SearchSegment() {
5353 private @ Getter String id ;
5454 private @ Getter int numberOfStops ;
5555 private @ Getter boolean blacklistedInEU ;
56+ private @ Getter Co2Emissions [] co2Emissions ;
57+ }
58+
59+ @ ToString
60+ public class Co2Emissions {
61+ protected Co2Emissions () {
62+ }
63+
64+ private @ Getter String weight ;
65+ private @ Getter String weightUnit ;
66+ private @ Getter String cabin ;
5667 }
5768
5869 @ ToString
You can’t perform that action at this time.
0 commit comments