31
31
public class Pricing {
32
32
33
33
private Amadeus client ;
34
+ private final String pricingUrl = "/v1/shopping/flight-offers/pricing" ;
34
35
35
36
/**
36
37
* Constructor.
@@ -89,7 +90,7 @@ private JsonArray buildPaymentJSON(FlightPayment flightPayment) {
89
90
* @throws ResponseException when an exception occurs
90
91
*/
91
92
public FlightPrice post (JsonObject body , Params params ) throws ResponseException {
92
- Response response = client .post ("/v1/shopping/flight-offers/pricing" , params , body );
93
+ Response response = client .post (pricingUrl , params , body );
93
94
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
94
95
}
95
96
@@ -110,7 +111,7 @@ public FlightPrice post(JsonObject body, Params params) throws ResponseException
110
111
* @throws ResponseException when an exception occurs
111
112
*/
112
113
public FlightPrice post (String body , Params params ) throws ResponseException {
113
- Response response = client .post ("/v1/shopping/flight-offers/pricing" , params , body );
114
+ Response response = client .post (pricingUrl , params , body );
114
115
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
115
116
}
116
117
@@ -130,7 +131,7 @@ public FlightPrice post(String body, Params params) throws ResponseException {
130
131
* @throws ResponseException when an exception occurs
131
132
*/
132
133
public FlightPrice post (JsonObject body ) throws ResponseException {
133
- Response response = client .post ("/v1/shopping/flight-offers/pricing" , body );
134
+ Response response = client .post (pricingUrl , body );
134
135
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
135
136
}
136
137
@@ -150,7 +151,7 @@ public FlightPrice post(JsonObject body) throws ResponseException {
150
151
* @throws ResponseException when an exception occurs
151
152
*/
152
153
public FlightPrice post (String body ) throws ResponseException {
153
- Response response = client .post ("/v1/shopping/flight-offers/pricing" , body );
154
+ Response response = client .post (pricingUrl , body );
154
155
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
155
156
}
156
157
@@ -227,9 +228,9 @@ public FlightPrice post(FlightOfferSearch[] flightOffersSearches,
227
228
// Is it a call with param or without param?
228
229
if (params != null ) {
229
230
response = client .post (
230
- "/v1/shopping/flight-offers/pricing " , params , jsonObject );
231
+ "pricingUrl " , params , jsonObject );
231
232
} else {
232
- response = client .post ("/v1/shopping/flight-offers/pricing " , jsonObject );
233
+ response = client .post ("pricingUrl " , jsonObject );
233
234
}
234
235
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
235
236
}
@@ -287,7 +288,7 @@ public FlightPrice post(FlightOfferSearch[] flightOffersSearches,
287
288
JsonObject jsonObject = new JsonObject ();
288
289
jsonObject .add ("data" , typeObject );
289
290
290
- Response response = client .post ("/v1/shopping/flight-offers/pricing " , jsonObject );
291
+ Response response = client .post ("pricingUrl " , jsonObject );
291
292
return (FlightPrice ) Resource .fromObject (response , FlightPrice .class );
292
293
}
293
294
0 commit comments