Skip to content

Commit 6e80a1f

Browse files
committed
initial commit
1 parent 3d3ae83 commit 6e80a1f

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed

src/main/java/com/amadeus/Amadeus.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,21 @@ public class Amadeus extends HTTPClient {
6262
*/
6363
public Airport airport;
6464

65+
/**
66+
* <p>
67+
* A namespaced client for the <code>/v1/booking</code> endpoints.
68+
* </p>
69+
*/
70+
public Booking booking;
71+
6572
protected Amadeus(Configuration configuration) {
6673
super(configuration);
6774
this.referenceData = new ReferenceData(this);
6875
this.travel = new Travel(this);
6976
this.shopping = new Shopping(this);
7077
this.ereputation = new EReputation(this);
7178
this.airport = new Airport(this);
79+
this.booking = new Booking(this);
7280
}
7381

7482
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.amadeus;
2+
3+
import com.amadeus.booking.FlightOrder;
4+
5+
public class Booking {
6+
private Amadeus client;
7+
8+
/**
9+
* <p>
10+
* A namespaced client for the
11+
* <code>/v1/booking/flightOrder</code> endpoints.
12+
* </p>
13+
*/
14+
public FlightOrder flightOrder;
15+
16+
public Booking(Amadeus client) {
17+
this.client = client;
18+
this.flightOrder = new FlightOrder(client);
19+
}
20+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.amadeus.booking;
2+
3+
import com.amadeus.Amadeus;
4+
import com.amadeus.Params;
5+
import com.amadeus.Response;
6+
import com.amadeus.exceptions.ResponseException;
7+
import com.amadeus.resources.Resource;
8+
9+
/**
10+
* <p>
11+
* A namespaced client for the
12+
* <code>/v1/booking/flight-orders</code> endpoints.
13+
* </p>
14+
*
15+
* <p>
16+
* Access via the Amadeus client object.
17+
* </p>
18+
*
19+
* <pre>
20+
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
21+
* amadeus.booking.flightOrder;</pre>
22+
*/
23+
public class FlightOrder {
24+
private Amadeus client;
25+
26+
/**
27+
* Constructor.
28+
* @hide
29+
*/
30+
public FlightOrder(Amadeus client) {
31+
this.client = client;
32+
}
33+
34+
/**
35+
* <p>
36+
* Allows you to manipulate a flight order.
37+
* </p>
38+
*
39+
* <pre>
40+
* com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder.(
41+
* "4BA070CE929E135B3268A9F2D0C51E9D4A6CF318BA10485322FA2C7E78C7852E").get();
42+
* </pre>
43+
* @param params the parameters to send to the API
44+
* @return an API response object
45+
* @throws ResponseException when an exception occurs
46+
*/
47+
public com.amadeus.resources.FlightOrder[] get(Params params) throws ResponseException {
48+
Response response = client.get(
49+
"/v1/booking/flight-orders/", params);
50+
return (com.amadeus.resources.FlightOrder[]) Resource.fromArray(
51+
response, com.amadeus.resources.FlightOrder[].class);
52+
}
53+
54+
/**
55+
* Convenience method for calling <code>get</code> without any parameters.
56+
* @see FlightDelay#get()
57+
*/
58+
public com.amadeus.resources.FlightOrder[] get() throws ResponseException {
59+
return get(null);
60+
}
61+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package com.amadeus.resources;
2+
3+
import java.util.Date;
4+
import lombok.Getter;
5+
import lombok.ToString;
6+
7+
/**
8+
* An Airline object as returned by the Airline Code LookUp API.
9+
* @see com.amadeus.booking.flightOrder#get()
10+
*/
11+
@ToString
12+
public class FlightOrder extends Resource {
13+
protected FlightOrder() {}
14+
15+
private @Getter String type;
16+
private @Getter String id;
17+
private @Getter String queuingOfficeId;
18+
private @Getter AssociatedRecord[] associatedRecords;
19+
private @Getter Traveler[] travelers;
20+
private @Getter FlightOfferSearch[] flightOffers;
21+
22+
@ToString
23+
public class AssociatedRecord {
24+
protected AssociatedRecord() {
25+
}
26+
27+
private @Getter String reference;
28+
private @Getter String creationDateTime;
29+
private @Getter String originSystemCode;
30+
private @Getter String flightOfferId;
31+
}
32+
33+
@ToString
34+
public class Traveler {
35+
protected Traveler() {
36+
}
37+
38+
private @Getter String id;
39+
private @Getter Date dateOfBirth;
40+
private @Getter Name name;
41+
private @Getter Contact contact;
42+
private @Getter Document documents;
43+
}
44+
45+
@ToString
46+
public class Name {
47+
protected Name() {
48+
}
49+
50+
private @Getter String firstName;
51+
private @Getter String lastName;
52+
}
53+
54+
@ToString
55+
public class Contact {
56+
protected Contact() {
57+
}
58+
59+
private @Getter Phone phones;
60+
}
61+
62+
@ToString
63+
public class Document {
64+
protected Document() {
65+
}
66+
67+
private @Getter String documentType;
68+
private @Getter String number;
69+
private @Getter Date expiryDate;
70+
private @Getter String issuanceCountry;
71+
private @Getter String nationality;
72+
private @Getter boolean holder;
73+
}
74+
75+
@ToString
76+
public class Phone {
77+
78+
protected Phone() {
79+
}
80+
81+
private @Getter String countryCallingCode;
82+
private @Getter String number;
83+
}
84+
85+
}

0 commit comments

Comments
 (0)