├── .editorconfig ├── .github ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── SUPPORT.md ├── VersionLibraryVerifier.java ├── images │ ├── dependencies.svg │ └── support.svg └── workflows │ ├── build_gradle.yml │ └── publish-release.yml ├── .gitignore ├── .sdkmanrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── build.gradle ├── config └── checkstyle │ └── checkstyle.xml ├── docs ├── allclasses-frame.html ├── allclasses-noframe.html ├── com │ └── amadeus │ │ ├── Airport.html │ │ ├── Amadeus.html │ │ ├── Analytics.html │ │ ├── Booking.html │ │ ├── Configuration.html │ │ ├── Constants.html │ │ ├── DutyOfCare.html │ │ ├── EReputation.html │ │ ├── HTTPClient.html │ │ ├── Location.html │ │ ├── Media.html │ │ ├── Params.html │ │ ├── ReferenceData.html │ │ ├── Request.html │ │ ├── Response.html │ │ ├── Safety.html │ │ ├── Schedule.html │ │ ├── Shopping.html │ │ ├── Travel.html │ │ ├── airport │ │ ├── DirectDestinations.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── predictions │ │ │ ├── AirportOnTime.html │ │ │ ├── Predictions.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── analytics │ │ ├── ItineraryPriceMetrics.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── booking │ │ ├── FlightOrder.html │ │ ├── FlightOrders.html │ │ ├── HotelBookings.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── client │ │ ├── AccessToken.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── dutyOfCare │ │ ├── Diseases.html │ │ ├── diseases │ │ │ ├── Covid19AreaReport.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── ereputation │ │ ├── HotelSentiments.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── exceptions │ │ ├── AuthenticationException.html │ │ ├── ClientException.html │ │ ├── NetworkException.html │ │ ├── NotFoundException.html │ │ ├── ParserException.html │ │ ├── ResponseException.html │ │ ├── ServerException.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── location │ │ ├── Analytics.html │ │ ├── analytics │ │ │ ├── CategoryRatedAreas.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── media │ │ ├── Files.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── referenceData │ │ ├── Airlines.html │ │ ├── Location.html │ │ ├── Locations.html │ │ ├── RecommendedLocations.html │ │ ├── Urls.html │ │ ├── locations │ │ │ ├── Airports.html │ │ │ ├── Hotels.html │ │ │ ├── PointOfInterest.html │ │ │ ├── PointsOfInterest.html │ │ │ ├── hotels │ │ │ │ ├── ByCity.html │ │ │ │ ├── ByGeocode.html │ │ │ │ ├── ByHotels.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── pointsOfInterest │ │ │ │ ├── BySquare.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── urls │ │ │ ├── CheckinLinks.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── resources │ │ ├── Activity.ElementaryPrice.html │ │ ├── Activity.GeoCode.html │ │ ├── Activity.html │ │ ├── AirTraffic.Analytics.Flights.html │ │ ├── AirTraffic.Analytics.Travelers.html │ │ ├── AirTraffic.Analytics.html │ │ ├── AirTraffic.html │ │ ├── Airline.html │ │ ├── CheckinLink.html │ │ ├── DatedFlight.AircraftEquipment.html │ │ ├── DatedFlight.Arrival.html │ │ ├── DatedFlight.Delay.html │ │ ├── DatedFlight.Departure.html │ │ ├── DatedFlight.FlightDesignator.html │ │ ├── DatedFlight.FlightPoint.html │ │ ├── DatedFlight.Gate.html │ │ ├── DatedFlight.Leg.html │ │ ├── DatedFlight.Partnership.html │ │ ├── DatedFlight.Segment.html │ │ ├── DatedFlight.Terminal.html │ │ ├── DatedFlight.Timing.html │ │ ├── DatedFlight.html │ │ ├── Destination.html │ │ ├── DiseaseAreaReport.Area.html │ │ ├── DiseaseAreaReport.AreaAccessRestriction.html │ │ ├── DiseaseAreaReport.AreaPolicy.html │ │ ├── DiseaseAreaReport.AreaRestriction.html │ │ ├── DiseaseAreaReport.AreaVaccinated.html │ │ ├── DiseaseAreaReport.Border.html │ │ ├── DiseaseAreaReport.DatedInformation.html │ │ ├── DiseaseAreaReport.DatedQuarantineRestriction.html │ │ ├── DiseaseAreaReport.DatedTracingApplicationRestriction.html │ │ ├── DiseaseAreaReport.DeclarationDocuments.html │ │ ├── DiseaseAreaReport.DiseaseCase.html │ │ ├── DiseaseAreaReport.DiseaseInfection.html │ │ ├── DiseaseAreaReport.DiseaseTestingRestriction.html │ │ ├── DiseaseAreaReport.DiseaseVaccination.html │ │ ├── DiseaseAreaReport.EntryRestriction.html │ │ ├── DiseaseAreaReport.ExitRestriction.html │ │ ├── DiseaseAreaReport.GeoCode.html │ │ ├── DiseaseAreaReport.Link.html │ │ ├── DiseaseAreaReport.MaskRestriction.html │ │ ├── DiseaseAreaReport.Sources.html │ │ ├── DiseaseAreaReport.Transportation.html │ │ ├── DiseaseAreaReport.ValidityPeriod.html │ │ ├── DiseaseAreaReport.html │ │ ├── FlightAvailability.AircraftEquipment.html │ │ ├── FlightAvailability.AvailabilityClass.html │ │ ├── FlightAvailability.Co2Emission.html │ │ ├── FlightAvailability.ExtendedSegment.html │ │ ├── FlightAvailability.FlightEndpoint.html │ │ ├── FlightAvailability.FlightStop.html │ │ ├── FlightAvailability.OperatingFlight.html │ │ ├── FlightAvailability.TourAllotment.html │ │ ├── FlightAvailability.html │ │ ├── FlightDate.Price.html │ │ ├── FlightDate.html │ │ ├── FlightDestination.Price.html │ │ ├── FlightDestination.html │ │ ├── FlightOfferSearch.AdditionalService.html │ │ ├── FlightOfferSearch.AdditionalServiceRequest.html │ │ ├── FlightOfferSearch.Aircraft.html │ │ ├── FlightOfferSearch.AirportInfo.html │ │ ├── FlightOfferSearch.AllotmentDetails.html │ │ ├── FlightOfferSearch.Amenity.html │ │ ├── FlightOfferSearch.BaggageAllowance.html │ │ ├── FlightOfferSearch.Co2Emissions.html │ │ ├── FlightOfferSearch.Description.html │ │ ├── FlightOfferSearch.FareDetailsBySegment.html │ │ ├── FlightOfferSearch.FareRules.html │ │ ├── FlightOfferSearch.Fee.html │ │ ├── FlightOfferSearch.FlightStop.html │ │ ├── FlightOfferSearch.Itinerary.html │ │ ├── FlightOfferSearch.OperatingFlight.html │ │ ├── FlightOfferSearch.PricingOptions.html │ │ ├── FlightOfferSearch.SearchPrice.html │ │ ├── FlightOfferSearch.SearchSegment.html │ │ ├── FlightOfferSearch.Tax.html │ │ ├── FlightOfferSearch.TermAndCondition.html │ │ ├── FlightOfferSearch.TravelerPricing.html │ │ ├── FlightOfferSearch.html │ │ ├── FlightOrder.AssociatedRecord.html │ │ ├── FlightOrder.Contact.html │ │ ├── FlightOrder.Document.html │ │ ├── FlightOrder.Name.html │ │ ├── FlightOrder.Phone.html │ │ ├── FlightOrder.Traveler.html │ │ ├── FlightOrder.html │ │ ├── FlightPayment.html │ │ ├── FlightPrice.BookingRequirements.html │ │ ├── FlightPrice.PassengerConditions.html │ │ ├── FlightPrice.html │ │ ├── Hotel.Address.html │ │ ├── Hotel.Distance.html │ │ ├── Hotel.GeoCode.html │ │ ├── Hotel.html │ │ ├── HotelBooking.AssociatedRecord.html │ │ ├── HotelBooking.html │ │ ├── HotelOffer.AddressType.html │ │ ├── HotelOffer.BaseTotalAmount.html │ │ ├── HotelOffer.CancellationPolicy.html │ │ ├── HotelOffer.CheckInOutPolicy.html │ │ ├── HotelOffer.Commission.html │ │ ├── HotelOffer.EstimatedRoomType.html │ │ ├── HotelOffer.GuaranteePolicy.html │ │ ├── HotelOffer.Guests.html │ │ ├── HotelOffer.Hotel.html │ │ ├── HotelOffer.HotelContact.html │ │ ├── HotelOffer.HotelDistance.html │ │ ├── HotelOffer.HotelPrice.html │ │ ├── HotelOffer.HotelTax.html │ │ ├── HotelOffer.MediaURI.html │ │ ├── HotelOffer.Offer.html │ │ ├── HotelOffer.PaymentPolicy.html │ │ ├── HotelOffer.PolicyDetails.html │ │ ├── HotelOffer.PriceVariation.html │ │ ├── HotelOffer.PriceVariations.html │ │ ├── HotelOffer.RateFamily.html │ │ ├── HotelOffer.RoomDetails.html │ │ ├── HotelOffer.TextWithLanguageType.html │ │ ├── HotelOffer.html │ │ ├── HotelOfferSearch.CancellationPolicy.html │ │ ├── HotelOfferSearch.CheckInOutPolicy.html │ │ ├── HotelOfferSearch.Commission.html │ │ ├── HotelOfferSearch.DepositPolicy.html │ │ ├── HotelOfferSearch.EstimatedRoomType.html │ │ ├── HotelOfferSearch.GuaranteePolicy.html │ │ ├── HotelOfferSearch.Guests.html │ │ ├── HotelOfferSearch.HoldPolicy.html │ │ ├── HotelOfferSearch.Hotel.html │ │ ├── HotelOfferSearch.HotelPrice.html │ │ ├── HotelOfferSearch.HotelTax.html │ │ ├── HotelOfferSearch.Markup.html │ │ ├── HotelOfferSearch.Offer.html │ │ ├── HotelOfferSearch.PaymentPolicy.html │ │ ├── HotelOfferSearch.PolicyDetails.html │ │ ├── HotelOfferSearch.Price.html │ │ ├── HotelOfferSearch.PriceVariation.html │ │ ├── HotelOfferSearch.PriceVariations.html │ │ ├── HotelOfferSearch.QualifiedFreeText.html │ │ ├── HotelOfferSearch.RateFamily.html │ │ ├── HotelOfferSearch.RoomDetails.html │ │ ├── HotelOfferSearch.html │ │ ├── HotelSentiment.Sentiment.html │ │ ├── HotelSentiment.html │ │ ├── ItineraryPriceMetric.Location.html │ │ ├── ItineraryPriceMetric.PriceMetrics.html │ │ ├── ItineraryPriceMetric.html │ │ ├── Location.Address.html │ │ ├── Location.Analytics.Flights.html │ │ ├── Location.Analytics.Travelers.html │ │ ├── Location.Analytics.html │ │ ├── Location.Distance.html │ │ ├── Location.GeoCode.html │ │ ├── Location.html │ │ ├── Period.Analytics.Travelers.html │ │ ├── Period.Analytics.html │ │ ├── Period.html │ │ ├── PointOfInterest.GeoCode.html │ │ ├── PointOfInterest.html │ │ ├── Prediction.html │ │ ├── Resource.html │ │ ├── SafePlace.GeoCode.html │ │ ├── SafePlace.SafetyScores.html │ │ ├── SafePlace.html │ │ ├── ScoredLocation.CategoryScores.NightLife.html │ │ ├── ScoredLocation.CategoryScores.Restaurant.html │ │ ├── ScoredLocation.CategoryScores.Shopping.html │ │ ├── ScoredLocation.CategoryScores.Sight.html │ │ ├── ScoredLocation.CategoryScores.html │ │ ├── ScoredLocation.GeoCode.html │ │ ├── ScoredLocation.html │ │ ├── SeatMap.Aircraft.html │ │ ├── SeatMap.AircraftCabinAmenities.html │ │ ├── SeatMap.AmenityBeverage.html │ │ ├── SeatMap.AmenityEntertainment.html │ │ ├── SeatMap.AmenityFood.html │ │ ├── SeatMap.AmenityPower.html │ │ ├── SeatMap.AmenitySeat.html │ │ ├── SeatMap.AmenityWifi.html │ │ ├── SeatMap.Arrival.html │ │ ├── SeatMap.AvailableSeatsCounter.html │ │ ├── SeatMap.Deck.html │ │ ├── SeatMap.DeckConfiguration.html │ │ ├── SeatMap.Departure.html │ │ ├── SeatMap.Media.html │ │ ├── SeatMap.QualifiedFreeText.html │ │ ├── SeatMap.html │ │ ├── Traveler.Contact.html │ │ ├── Traveler.Document.html │ │ ├── Traveler.Name.html │ │ ├── Traveler.Phone.html │ │ ├── Traveler.html │ │ ├── TripDetail.Address.html │ │ ├── TripDetail.Air.html │ │ ├── TripDetail.Aircraft.html │ │ ├── TripDetail.Arrival.html │ │ ├── TripDetail.ArrivalAir.html │ │ ├── TripDetail.ArrivalAirportLocation.html │ │ ├── TripDetail.AssociatedEquipment.html │ │ ├── TripDetail.AssociationRef.html │ │ ├── TripDetail.Baggage.html │ │ ├── TripDetail.Cancellation.html │ │ ├── TripDetail.Car.html │ │ ├── TripDetail.CarVehicle.html │ │ ├── TripDetail.Carrier.html │ │ ├── TripDetail.Contact.html │ │ ├── TripDetail.ContactHotel.html │ │ ├── TripDetail.Departure.html │ │ ├── TripDetail.DepartureAir.html │ │ ├── TripDetail.DepartureAirportLocation.html │ │ ├── TripDetail.Description.html │ │ ├── TripDetail.Driver.html │ │ ├── TripDetail.Dropoff.html │ │ ├── TripDetail.Email.html │ │ ├── TripDetail.End.html │ │ ├── TripDetail.FlightDesignator.html │ │ ├── TripDetail.Guests.html │ │ ├── TripDetail.Hotel.html │ │ ├── TripDetail.Location.html │ │ ├── TripDetail.Marketing.html │ │ ├── TripDetail.Meal.html │ │ ├── TripDetail.Name.html │ │ ├── TripDetail.Operating.html │ │ ├── TripDetail.Phone.html │ │ ├── TripDetail.Pickup.html │ │ ├── TripDetail.Policies.html │ │ ├── TripDetail.Price.html │ │ ├── TripDetail.Product.html │ │ ├── TripDetail.Room.html │ │ ├── TripDetail.Seat.html │ │ ├── TripDetail.Stakeholder.html │ │ ├── TripDetail.Start.html │ │ ├── TripDetail.Train.html │ │ ├── TripDetail.TravelAgency.html │ │ ├── TripDetail.Trip.html │ │ ├── TripDetail.TypeEstimated.html │ │ ├── TripDetail.Vehicle.html │ │ ├── TripDetail.Weight.html │ │ ├── TripDetail.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── safety │ │ ├── SafetyRatedLocation.html │ │ ├── SafetyRatedLocations.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── safetyRatedLocations │ │ │ ├── BySquare.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── schedule │ │ ├── Flights.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── shopping │ │ ├── Activities.html │ │ ├── Activity.html │ │ ├── Availability.html │ │ ├── FlightDates.html │ │ ├── FlightDestinations.html │ │ ├── FlightOffers.html │ │ ├── FlightOffersSearch.html │ │ ├── HotelOffer.html │ │ ├── HotelOfferSearch.html │ │ ├── HotelOffers.html │ │ ├── HotelOffersByHotel.html │ │ ├── HotelOffersSearch.html │ │ ├── SeatMaps.html │ │ ├── activities │ │ │ ├── BySquare.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── availability │ │ │ ├── FlightAvailabilities.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── flightOffers │ │ │ ├── Prediction.html │ │ │ ├── Pricing.html │ │ │ ├── Upselling.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ └── travel │ │ ├── Predictions.html │ │ ├── TripParser.html │ │ ├── analytics │ │ ├── AirTraffic.html │ │ ├── Analytics.html │ │ ├── airTraffic │ │ │ ├── Booked.html │ │ │ ├── BusiestPeriod.html │ │ │ ├── Traveled.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── predictions │ │ ├── FlightDelay.html │ │ ├── TripPurpose.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-all.html ├── index.html ├── overview-frame.html ├── overview-summary.html ├── overview-tree.html ├── package-list ├── script.js ├── serialized-form.html └── stylesheet.css ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lombok.config ├── settings.gradle └── src ├── main └── java │ └── com │ └── amadeus │ ├── Airline.java │ ├── Airport.java │ ├── Amadeus.java │ ├── Analytics.java │ ├── Booking.java │ ├── Configuration.java │ ├── Constants.java │ ├── EReputation.java │ ├── HTTPClient.java │ ├── HttpVerbs.java │ ├── Location.java │ ├── Ordering.java │ ├── Params.java │ ├── ReferenceData.java │ ├── Request.java │ ├── Response.java │ ├── Schedule.java │ ├── Shopping.java │ ├── Travel.java │ ├── airline │ └── Destinations.java │ ├── airport │ ├── DirectDestinations.java │ └── predictions │ │ ├── AirportOnTime.java │ │ └── Predictions.java │ ├── analytics │ └── ItineraryPriceMetrics.java │ ├── booking │ ├── FlightOrder.java │ ├── FlightOrders.java │ ├── HotelBookings.java │ └── HotelOrders.java │ ├── client │ └── AccessToken.java │ ├── ereputation │ └── HotelSentiments.java │ ├── exceptions │ ├── AuthenticationException.java │ ├── ClientException.java │ ├── NetworkException.java │ ├── NotFoundException.java │ ├── ParserException.java │ ├── ResponseException.java │ └── ServerException.java │ ├── location │ ├── Analytics.java │ └── analytics │ │ └── CategoryRatedAreas.java │ ├── ordering │ ├── TransferOrder.java │ ├── TransferOrders.java │ └── transferOrders │ │ ├── Transfers.java │ │ └── transfers │ │ └── Cancellation.java │ ├── referencedata │ ├── Airlines.java │ ├── Location.java │ ├── Locations.java │ ├── RecommendedLocations.java │ ├── Urls.java │ ├── locations │ │ ├── Airports.java │ │ ├── Cities.java │ │ ├── Hotel.java │ │ ├── Hotels.java │ │ ├── PointOfInterest.java │ │ ├── PointsOfInterest.java │ │ ├── hotels │ │ │ ├── ByCity.java │ │ │ ├── ByGeocode.java │ │ │ └── ByHotels.java │ │ └── pointsOfInterest │ │ │ └── BySquare.java │ └── urls │ │ └── CheckinLinks.java │ ├── resources │ ├── Activity.java │ ├── AirTraffic.java │ ├── Airline.java │ ├── CheckinLink.java │ ├── City.java │ ├── DatedFlight.java │ ├── Destination.java │ ├── FlightAvailability.java │ ├── FlightDate.java │ ├── FlightDestination.java │ ├── FlightOfferSearch.java │ ├── FlightOrder.java │ ├── FlightPayment.java │ ├── FlightPrice.java │ ├── Hotel.java │ ├── HotelBooking.java │ ├── HotelOfferSearch.java │ ├── HotelOrder.java │ ├── HotelSentiment.java │ ├── ItineraryPriceMetric.java │ ├── Location.java │ ├── Period.java │ ├── PointOfInterest.java │ ├── Prediction.java │ ├── Resource.java │ ├── ScoredLocation.java │ ├── SeatMap.java │ ├── TransferCancellation.java │ ├── TransferOffersPost.java │ └── TransferOrder.java │ ├── schedule │ └── Flights.java │ ├── shopping │ ├── Activities.java │ ├── Activity.java │ ├── Availability.java │ ├── FlightDates.java │ ├── FlightDestinations.java │ ├── FlightOffers.java │ ├── FlightOffersSearch.java │ ├── HotelOfferSearch.java │ ├── HotelOffersSearch.java │ ├── SeatMaps.java │ ├── TransferOffers.java │ ├── activities │ │ └── BySquare.java │ ├── availability │ │ └── FlightAvailabilities.java │ └── flightOffers │ │ ├── Prediction.java │ │ ├── Pricing.java │ │ └── Upselling.java │ └── travel │ ├── Predictions.java │ ├── analytics │ ├── AirTraffic.java │ ├── Analytics.java │ └── airTraffic │ │ ├── Booked.java │ │ ├── BusiestPeriod.java │ │ └── Traveled.java │ └── predictions │ ├── FlightDelay.java │ └── TripPurpose.java └── test ├── java └── com │ └── amadeus │ ├── AccessTokenTest.java │ ├── AmadeusTest.java │ ├── ConfigurationTest.java │ ├── ExceptionsTest.java │ ├── HTTPClientTest.java │ ├── HTTPClientThreadSafeIT.java │ ├── NamespaceTest.java │ ├── ParamsTest.java │ ├── RequestTest.java │ ├── ResponseTest.java │ ├── airline │ └── DestinationsIT.java │ ├── booking │ ├── FlightOrdersIT.java │ └── HotelOrdersIT.java │ ├── ordering │ ├── TransferOrdersIT.java │ └── transferOrders │ │ └── transfers │ │ └── CancellationIT.java │ ├── referenceData │ └── locations │ │ ├── CitiesIT.java │ │ ├── HotelIT.java │ │ ├── PointOfInterestIT.java │ │ ├── hotels │ │ ├── ByCityIT.java │ │ ├── ByGeocodeIT.java │ │ └── ByHotelsIT.java │ │ └── pointsOfInterest │ │ └── BySquareIT.java │ ├── shopping │ ├── ActivityIT.java │ ├── FlightOfferSearchIT.java │ ├── HotelOfferSearchIT.java │ ├── HotelOffersSearchIT.java │ ├── SeatMapsIT.java │ ├── TransferOffersIT.java │ ├── activities │ │ └── BySquareIT.java │ ├── availability │ │ └── FlightAvailabilitiesIT.java │ └── flightOffers │ │ ├── PredictionIT.java │ │ ├── PricingIT.java │ │ └── UpsellingIT.java │ └── travel │ └── TripPurposeIT.java └── resources └── __files ├── activities_response_by_id_ok.json ├── activities_response_by_square_ok.json ├── airline_routes_response_ok.json ├── airline_routes_response_ok2.json ├── auth_ok.json ├── city_search_response_empty.json ├── city_search_response_ok.json ├── flightPayment_ok.json ├── flight_create_order_request.json ├── flight_create_order_response.json ├── flight_search_availability_request_ok.json ├── flight_search_availability_response_ok.json ├── flight_search_offer_pricing_response_ok.json ├── flight_search_offer_request_ok.json ├── flight_search_offer_response_ok.json ├── flight_search_offer_upselling_request_ok.json ├── flight_search_offer_upselling_response_ok.json ├── hotel_offer_search_response_ok.json ├── hotel_offers_search_response_ok.json ├── hotel_orders_request_ok.json ├── hotel_orders_response_ok.json ├── hotels_by_city_response_ok.json ├── hotels_by_geocode_response_ok.json ├── hotels_by_hotels_response_ok.json ├── poi_by_id_response.json ├── pois_by_square_response_ok.json ├── reference_data_hotel_default_response_ok.json ├── reference_data_hotel_multiple_hotel_response_ok.json ├── reference_data_hotel_single_hotel_response_ok.json ├── seatmap_request_ok.json ├── seatmap_response_ok.json ├── seatmap_response_ok2.json ├── transfer_offers_request_ok.json ├── transfer_offers_response_ok.json ├── transfer_orders_management_request_ok.json ├── transfer_orders_management_response_ok.json ├── transfer_orders_request_ok.json ├── transfer_orders_response_ok.json └── trip_purpose_response_ok.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.java] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # The '*' pattern is global owners. 4 | 5 | # These owners will be the default owners for everything in 6 | # the repo and will be requested for 7 | # review when someone opens a pull request. 8 | 9 | # Global Rule 10 | * @tsolakoua @minjikarin @jabrena -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | [Describe the issue] 4 | 5 | ## Steps to Reproduce 6 | 7 | 1. [First step] 8 | 2. [Second step] 9 | 3. [and so on...] 10 | 11 | __Expected Behavior:__ [What you expect to happen] 12 | 13 | __Actual Behavior:__ [What actually happens] 14 | 15 | __Stable Behavior?__ [What percentage of the time does it reproduce?] 16 | 17 | ## Versions 18 | 19 | [What version of Java/JVM are you running? What Operating System are you on?] 20 | 21 | ## Checklist 22 | 23 | Please make sure you checked the following: 24 | 25 | * Did you download the latest version of this library? 26 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Fixes # 2 | 3 | ## Changes for this pull request 4 | 5 | ## Checklist 6 | 7 | Remove this if you have done all of these: 8 | 9 | * Ensure all tests pass and linting 10 | * Add any changes to the README 11 | * Add any changes or new comments to SDK methods 12 | * Ensure this PR only changes what it is intended to change 13 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Amadeus Support 2 | 3 | Our [developer support team](https://developer.amadeus.com/developers) is here to help you. You can find us on [Twitter](#), [StackOverflow](#), and [email](#). 4 | -------------------------------------------------------------------------------- /.github/images/dependencies.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/images/support.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/workflows/build_gradle.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: build 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | types: [opened, synchronize, reopened] 12 | 13 | jobs: 14 | build: 15 | 16 | runs-on: ubuntu-latest 17 | 18 | strategy: 19 | matrix: 20 | java: [ '8', '11' ] 21 | env: 22 | JDK_VERSION: ${{ matrix.java }} 23 | name: Java ${{ matrix.java }} build 24 | steps: 25 | - uses: actions/checkout@v3 26 | - name: Set up Java 27 | uses: actions/setup-java@v3 28 | with: 29 | java-version: ${{ matrix.java }} 30 | distribution: 'adopt' 31 | cache: gradle 32 | - name: Grant execute permission for gradlew 33 | run: chmod +x gradlew 34 | - name: Build with Gradle 35 | run: ./gradlew build 36 | - name: Version Library Verifier 37 | shell: bash 38 | run: | 39 | curl -Ls https://sh.jbang.dev | bash -s - app setup 40 | ~/.jbang/bin/jbang .github/VersionLibraryVerifier.java amadeus-java/ 41 | -------------------------------------------------------------------------------- /.github/workflows/publish-release.yml: -------------------------------------------------------------------------------- 1 | name: Publish Release 2 | on: 3 | push: 4 | # Sequence of patterns matched against refs/tags 5 | tags: 6 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v2 13 | - name: Set up Java 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 1.8 17 | - name: Grant execute permission for gradlew 18 | run: chmod +x gradlew 19 | - name: Upload release 20 | run: ./gradlew publish --no-daemon --no-parallel 21 | env: 22 | ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} 23 | ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} 24 | ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }} 25 | ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} 26 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} 27 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} 28 | - name: Publish release 29 | run: ./gradlew closeAndReleaseRepository 30 | env: 31 | ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} 32 | ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} 33 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} 34 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Grade files 2 | .gradle 3 | build 4 | .project 5 | .settings 6 | .classpath 7 | .idea 8 | out 9 | .DS_Store 10 | amadeus-java.iml 11 | Bin/ 12 | .vscode/ 13 | .env 14 | -------------------------------------------------------------------------------- /.sdkmanrc: -------------------------------------------------------------------------------- 1 | java=8.0.322-tem -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2017 Amadeus IT Group SA 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 7 | persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 10 | Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 13 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 15 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'io.franzbecker.gradle-lombok' version '5.0.0' 4 | id 'checkstyle' 5 | id 'com.vanniktech.maven.publish' version '0.18.0' 6 | id 'jacoco' 7 | id "org.sonarqube" version "3.4.0.2513" 8 | } 9 | 10 | compileJava { 11 | sourceCompatibility = "1.8" 12 | targetCompatibility = "1.8" 13 | } 14 | 15 | compileTestJava { 16 | sourceCompatibility = "1.8" 17 | targetCompatibility = "1.8" 18 | } 19 | 20 | tasks.withType(JavaCompile) { 21 | options.encoding = 'UTF-8' 22 | } 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | dependencies { 29 | implementation 'com.google.code.gson:gson:2.9.0' 30 | compileOnly "org.projectlombok:lombok:1.18.24" 31 | annotationProcessor 'org.projectlombok:lombok:1.18.24' 32 | testCompileOnly 'org.projectlombok:lombok:1.18.24' 33 | testAnnotationProcessor 'org.projectlombok:lombok:1.18.24' 34 | testImplementation 'org.mockito:mockito-core:4.6.1' 35 | testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' 36 | testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' 37 | testImplementation 'org.assertj:assertj-core:3.22.0' 38 | testImplementation 'com.github.tomakehurst:wiremock:2.27.2' 39 | testImplementation 'org.slf4j:slf4j-api:1.7.36' 40 | testImplementation 'org.slf4j:slf4j-simple:1.7.36' 41 | } 42 | 43 | checkstyle { 44 | toolVersion = '8.8' 45 | } 46 | 47 | import io.franzbecker.gradle.lombok.task.DelombokTask 48 | 49 | task delombok(type: DelombokTask, dependsOn: compileJava) { 50 | ext.outputDir = file("$buildDir/delombok") 51 | outputs.dir(outputDir) 52 | sourceSets.main.java.srcDirs.each { 53 | inputs.dir(it) 54 | args(it, "-d", outputDir) 55 | } 56 | } 57 | 58 | javadoc { 59 | dependsOn delombok 60 | source = delombok.outputDir 61 | failOnError = false 62 | options.memberLevel = JavadocMemberLevel.PUBLIC 63 | } 64 | 65 | jacoco { 66 | toolVersion = "0.8.7" 67 | } 68 | 69 | test.finalizedBy jacocoTestReport 70 | 71 | test { 72 | useJUnitPlatform() 73 | reports { 74 | junitXml.enabled = false 75 | html.enabled = true 76 | } 77 | } 78 | 79 | signing { 80 | if (project.hasProperty('SIGNING_PRIVATE_KEY') && project.hasProperty('SIGNING_PASSWORD')) { 81 | useInMemoryPgpKeys(project.getProperty('SIGNING_PRIVATE_KEY'), project.getProperty('SIGNING_PASSWORD')) 82 | } 83 | } 84 | 85 | sonarqube { 86 | properties { 87 | property "sonar.projectKey", "amadeus4dev_amadeus-java" 88 | property "sonar.organization", "amadeus4dev" 89 | property "sonar.host.url", "https://sonarcloud.io" 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /docs/com/amadeus/airport/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |
7 | * A namespaced client for the
8 | * /v1/airline
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.airline18 | * 19 | * @hide 20 | */ 21 | public class Airline { 22 | /** 23 | * Constructor. 24 | * @hide 25 | */ 26 | public Airline(Amadeus client) { 27 | this.destinations = new Destinations(client); 28 | } 29 | 30 | /** 31 | *
32 | * A namespaced client for the
33 | * /v1/airline/destinations
endpoints.
34 | *
8 | * A namespaced client for the
9 | * /v1/airport
endpoints.
10 | *
13 | * Access via the Amadeus client object. 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 18 | * amadeus.airport19 | * 20 | * @hide 21 | */ 22 | public class Airport { 23 | /** 24 | *
25 | * A namespaced client for the
26 | * /v1/airport/predictions
endpoints.
27 | *
33 | * A namespaced client for the
34 | * /v1/airport/direct-destinations
endpoints.
35 | *
7 | * A namespaced client for the
8 | * /v1/analytics
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.analytics;18 | * 19 | * @hide 20 | */ 21 | public class Analytics { 22 | /** 23 | *
24 | * A namespaced client for the
25 | * /v1/analytics/itineraryPriceMetrics
endpoints.
26 | *
13 | * A namespaced client for the
14 | * /v1/booking/flightOrder
endpoints.
15 | *
21 | * A namespaced client for the
22 | * /v1/booking/flightOrders
endpoints.
23 | *
29 | * A namespaced client for the
30 | * /v1/booking/hotelBookings
endpoints.
31 | *
37 | * A namespaced client for the
38 | * /v2/booking/hotelOrders
endpoints.
39 | *
11 | * To use: Constants.VARIABLE 12 | *13 | */ 14 | public final class Constants { 15 | 16 | 17 | public static final String HTTPS = "https"; 18 | public static final String HTTP = "http"; 19 | 20 | public static final String USER_AGENT = "User-Agent"; 21 | public static final String ACCEPT = "Accept"; 22 | public static final String AUTHORIZATION = "Authorization"; 23 | public static final String CONTENT_TYPE = "Content-Type"; 24 | public static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; 25 | 26 | // Pagination 27 | public static final String FIRST = "first"; 28 | public static final String LAST = "last"; 29 | public static final String NEXT = "next"; 30 | public static final String PREVIOUS = "previous"; 31 | 32 | // Authorization 33 | public static final String GRANT_TYPE = "grant_type"; 34 | public static final String CLIENT_CREDENTIALS = "client_credentials"; 35 | public static final String CLIENT_ID = "client_id"; 36 | public static final String CLIENT_SECRET = "client_secret"; 37 | public static final String AUTH_URL = "/v1/security/oauth2/token"; 38 | public static final String ACCESS_TOKEN = "access_token"; 39 | public static final String EXPIRES_IN = "expires_in"; 40 | 41 | // APIs which need an X-HTTP-Method-Override GET HEADER 42 | protected static final List
8 | * A namespaced client for the
9 | * /v2/e-reputation/hotel-sentiments
endpoints.
10 | *
7 | * A namespaced client for the
8 | * /v1/location
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.location;18 | * 19 | * @hide 20 | */ 21 | public class Location { 22 | /** 23 | *
24 | * A namespaced client for the
25 | * /v1/location/analytics
endpoints.
26 | *
8 | * A namespaced client for the
9 | * /v1/ordering
endpoints.
10 | *
13 | * Access via the Amadeus client object. 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 18 | * amadeus.ordering;19 | * 20 | * @hide 21 | */ 22 | public class Ordering { 23 | private Amadeus client; 24 | 25 | /** 26 | *
27 | * A namespaced client for the
28 | * /v1/ordering/transfer-orders
endpoints.
29 | *
35 | * A namespaced client for the
36 | * /v1/ordering/transafer-orders/:orderId
endpoints.
37 | *
11 | * A namespaced client for the
12 | * /v2/reference-data
endpoints.
13 | *
16 | * Access via the Amadeus client object. 17 | *
18 | * 19 | *20 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 21 | * amadeus.referenceData;22 | * 23 | * @hide 24 | */ 25 | public class ReferenceData { 26 | private Amadeus client; 27 | 28 | /** 29 | *
30 | * A namespaced client for the
31 | * /v2/reference-data/urls
endpoints.
32 | *
38 | * A namespaced client for the
39 | * /v2/reference-data/locations
endpoints.
40 | *
46 | * A namespaced client for the
47 | * /v2/reference-data/airlines
endpoints.
48 | *
54 | * A namespaced client for the
55 | * /v1/reference-data/recommended-locations
endpoints.
56 | *
75 | * A namespaced client for the
76 | * /v2/reference-data/location/:hotel_id
endpoints.
77 | *
7 | * A namespaced client for the
8 | * /v2/schedule
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.schedule;18 | * 19 | * @hide 20 | */ 21 | public class Schedule { 22 | /** 23 | *
24 | * A namespaced client for the
25 | * /v2/schedule/flights
endpoints.
26 | *
8 | * A namespaced client for the
9 | * /v2/travel
endpoints.
10 | *
13 | * Access via the Amadeus client object. 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 18 | * amadeus.travel;19 | * 20 | * @hide 21 | */ 22 | public class Travel { 23 | /** 24 | *
25 | * A namespaced client for the
26 | * /v2/travel/analytics
endpoints.
27 | *
32 | * A namespaced client for the
33 | * /v1/travel/predictions
endpoints.
34 | *
12 | * A namespaced client for the
13 | * /v1/airline/destinations
endpoint.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.airline.destinations;23 | */ 24 | public class Destinations { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public Destinations(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Get airline destinations. 38 | *
39 | * 40 | *41 | * amadeus.airline.destinations.get(Params 42 | * .with("airlineCode", "BA") 43 | * .and("max", 2)); 44 | *45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public Destination[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/airline/destinations", params); 52 | return (Destination[]) Resource.fromArray(response, Destination[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see Destinations#get()
58 | */
59 | public Destination[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/airport/DirectDestinations.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.airport;
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.Destination;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/airport/direct-destinations
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.airport.directDestinations;23 | */ 24 | public class DirectDestinations { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public DirectDestinations(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Find all destinations served by a given airport. 38 | *
39 | * 40 | *41 | * amadeus.airport.directDestinations.get(Params 42 | * .with("departureAirportCode", "MAD") 43 | * .and("max","2")); 44 | *45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public Destination[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/airport/direct-destinations", params); 52 | return (Destination[]) Resource.fromArray(response, Destination[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see DirectDestinations#get()
58 | */
59 | public Destination[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/airport/predictions/AirportOnTime.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.airport.predictions;
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.Prediction;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/airport/predictions/on-time
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.airport.predictions.onTime;23 | */ 24 | public class AirportOnTime { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public AirportOnTime(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a percentage of on-time flight from a given airport. 38 | *
39 | * 40 | *41 | * OnTime airportOnTime = amadeus.airport.predictions.onTime.get(Params 42 | * .with("airportCode", "NCE") 43 | * .and("date", "2020-09-01")); 44 | *45 | * @param params the parameters to send to the API 46 | * @return an API response object 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public Prediction get(Params params) throws ResponseException { 50 | Response response = client.get("/v1/airport/predictions/on-time", params); 51 | return (Prediction) Resource.fromObject(response, Prediction.class); 52 | } 53 | 54 | /** 55 | * Convenience method for calling
get
without any parameters.
56 | * @see AirportOnTime#get()
57 | */
58 | public Prediction get() throws ResponseException {
59 | return get(null);
60 | }
61 | }
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/airport/predictions/Predictions.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.airport.predictions;
2 |
3 | import com.amadeus.Amadeus;
4 |
5 | /**
6 | *
7 | * A namespaced client for the
8 | * /v1/airport/predictions
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.airport.predictions;18 | * 19 | * @hide 20 | */ 21 | public class Predictions { 22 | /** 23 | *
24 | * A namespaced client for the
25 | * /v1/airport/predictions/on-time
endpoints.
26 | *
12 | * A namespaced client for the
13 | * /v1/analytics/itinerary-price-metrics
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.analytics.itineraryPriceMetrics;23 | */ 24 | public class ItineraryPriceMetrics { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public ItineraryPriceMetrics(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Retrieves itinerary price metrics. 38 | *
39 | * 40 | *41 | * amadeus.analytics.itineraryPriceMetrics.get(Params 42 | * .with("originIataCode", "MAD") 43 | * .and("destinationIataCode", "CDG") 44 | * .and("departureDate", "2021-03-21"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public ItineraryPriceMetric[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/analytics/itinerary-price-metrics", params); 52 | return (ItineraryPriceMetric[]) Resource.fromArray(response, ItineraryPriceMetric[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see ItineraryPriceMetric#get()
58 | */
59 | public ItineraryPriceMetric[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/booking/HotelBookings.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.booking;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.Response;
5 | import com.amadeus.exceptions.ResponseException;
6 | import com.amadeus.resources.HotelBooking;
7 | import com.amadeus.resources.Resource;
8 | import com.google.gson.JsonObject;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/booking/hotel-bookings
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 22 | * amadeus.booking.hotelBookings;23 | */ 24 | public class HotelBookings { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @hide 31 | */ 32 | public HotelBookings(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * The Hotel Booking API allows you to perform hotel booking. 39 | *
40 | * 41 | *42 | * amadeus.booking.hotelBookings.post(body);43 | * 44 | * @param body the parameters to send to the API as a JSonObject 45 | * @return an API resource 46 | * @throws ResponseException when an exception occurs 47 | */ 48 | public HotelBooking[] post(JsonObject body) throws ResponseException { 49 | Response response = client.post("/v1/booking/hotel-bookings", body); 50 | return (HotelBooking[]) Resource.fromArray(response, HotelBooking[].class); 51 | } 52 | 53 | /** 54 | *
55 | * The Hotel Booking API allows you to perform hotel booking. 56 | *
57 | * 58 | *59 | * amadeus.booking.hotelBookings.post(body);60 | * 61 | * @param body the parameters to send to the API as a String 62 | * @return an API resource 63 | * @throws ResponseException when an exception occurs 64 | */ 65 | public HotelBooking[] post(String body) throws ResponseException { 66 | Response response = client.post("/v1/booking/hotel-bookings", body); 67 | return (HotelBooking[]) Resource.fromArray(response, HotelBooking[].class); 68 | } 69 | 70 | /** 71 | * Convenience method for calling
post
without any parameters.
72 | *
73 | * @see HotelBookings#post()
74 | */
75 | public HotelBooking[] post() throws ResponseException {
76 | return post((String) null);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/booking/HotelOrders.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.booking;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.Response;
5 | import com.amadeus.exceptions.ResponseException;
6 | import com.amadeus.resources.HotelOrder;
7 | import com.amadeus.resources.Resource;
8 | import com.google.gson.JsonObject;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v2/booking/hotel-orders
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 22 | * amadeus.booking.HotelOrders;23 | */ 24 | public class HotelOrders { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @hide 31 | */ 32 | public HotelOrders(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * The Hotel Booking API allows you to perform hotel booking. 39 | *
40 | * 41 | *42 | * amadeus.booking.hotelOrders.post(body);43 | * 44 | * @param body the parameters to send to the API as a JSonObject 45 | * @return an API resource 46 | * @throws ResponseException when an exception occurs 47 | */ 48 | public HotelOrder post(JsonObject body) throws ResponseException { 49 | Response response = client.post("/v2/booking/hotel-orders", body); 50 | return (HotelOrder) Resource.fromObject(response, HotelOrder.class); 51 | } 52 | 53 | /** 54 | *
55 | * The Hotel Booking API allows you to perform hotel booking. 56 | *
57 | * 58 | *59 | * amadeus.booking.hotelOrders.post(body);60 | * 61 | * @param body the parameters to send to the API as a String 62 | * @return an API resource 63 | * @throws ResponseException when an exception occurs 64 | */ 65 | public HotelOrder post(String body) throws ResponseException { 66 | Response response = client.post("/v2/booking/hotel-orders", body); 67 | return (HotelOrder) Resource.fromObject(response, HotelOrder.class); 68 | } 69 | 70 | /** 71 | * Convenience method for calling
post
without any parameters.
72 | *
73 | * @see HotelBookings#post()
74 | */
75 | public HotelOrder post() throws ResponseException {
76 | return post((String) null);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/ereputation/HotelSentiments.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.ereputation;
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.HotelSentiment;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v2/e-reputation/hotel-sentiments
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.ereputation.hotelSentiments;23 | */ 24 | 25 | public class HotelSentiments { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public HotelSentiments(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Hotel ratings based on automated sentiment analysis algorithm 39 | * applied on the online reviews. 40 | *
41 | * 42 | *43 | * amadeus.ereputation.hotelSentiments.get(Params 44 | * .with("hotelIds", "ELONMFS,ADNYCCTB"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public HotelSentiment[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v2/e-reputation/hotel-sentiments", params); 52 | return (HotelSentiment[]) Resource.fromArray(response, HotelSentiment[].class); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when the client did not provide the right credentials. 7 | */ 8 | public class AuthenticationException extends ResponseException { 9 | /** 10 | * Constructor. 11 | * @hides as only used internally 12 | */ 13 | public AuthenticationException(Response response) { 14 | super(response); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/ClientException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when the client did not provide the right parameters. 7 | */ 8 | public class ClientException extends ResponseException { 9 | /** 10 | * Constructor. 11 | * @hides as only used internally 12 | */ 13 | public ClientException(Response response) { 14 | super(response); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/NetworkException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when there is some kind of error in the network. 7 | */ 8 | public class NetworkException extends ResponseException { 9 | /** 10 | * Constructor. 11 | * @hides as only used internally 12 | */ 13 | public NetworkException(Response response) { 14 | super(response); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/NotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when the path could not be found. 7 | */ 8 | public class NotFoundException extends ResponseException { 9 | public NotFoundException(Response response) { 10 | super(response); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/ParserException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when the response type was JSON but could not be parsed. 7 | */ 8 | public class ParserException extends ResponseException { 9 | /** 10 | * Constructor. 11 | * @hides as only used internally 12 | */ 13 | public ParserException(Response response) { 14 | super(response); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/exceptions/ServerException.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.exceptions; 2 | 3 | import com.amadeus.Response; 4 | 5 | /** 6 | * This error occurs when there is an error on the server. 7 | */ 8 | public class ServerException extends ResponseException { 9 | /** 10 | * Constructor. 11 | * @hides as only used internally 12 | */ 13 | public ServerException(Response response) { 14 | super(response); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/location/Analytics.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.location; 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.location.analytics.CategoryRatedAreas; 5 | 6 | /** 7 | *
8 | * A namespaced client for the
9 | * /v1/location/analytics
endpoints.
10 | *
15 | * A namespaced client for the
16 | * /v1/location/analytics/category-rated-areas
endpoints.
17 | *
12 | * A namespaced client for the
13 | * /v1/location/analytics/category-rated-areas
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.location.analytics.categoryRatedAreas;23 | */ 24 | public class CategoryRatedAreas { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public CategoryRatedAreas(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Provides a popularity scores 38 | * for a given latitude and longitude. 39 | *
40 | * 41 | *42 | * amadeus.location.analytics.categoryRatedAreas.get(Params 43 | * .with("latitude", "41.397158") 44 | * .and("longitude", "2.160873"); 45 | *46 | * 47 | * @param params the parameters to send to the API 48 | * @return an API response object 49 | * @throws ResponseException when an exception occurs 50 | */ 51 | public ScoredLocation[] get(Params params) throws ResponseException { 52 | Response response = client.get("/v1/location/analytics/category-rated-areas", params); 53 | return (ScoredLocation[]) Resource.fromArray(response, ScoredLocation[].class); 54 | } 55 | 56 | /** 57 | * Convenience method for calling
get
without any parameters.
58 | * @see CategoryRatedAreas#get()
59 | */
60 | public ScoredLocation[] get() throws ResponseException {
61 | return get(null);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/ordering/TransferOrder.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.ordering;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.ordering.transferOrders.Transfers;
5 |
6 | /**
7 | *
8 | * A namespaced client for the
9 | * /v1/ordering/transfer-orders/:orderId
endpoints.
10 | *
13 | * Access via the Amadeus client object 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 18 | * amadeus.ordering.transferOrder(orderId);19 | * 20 | * @hide 21 | */ 22 | public class TransferOrder { 23 | public Amadeus client; 24 | public String orderId; 25 | public Transfers transfers; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public TransferOrder(Amadeus client, String orderId) { 32 | this.orderId = orderId; 33 | this.client = client; 34 | this.transfers = new Transfers(client, orderId); 35 | } 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/ordering/TransferOrders.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.ordering; 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 | import com.amadeus.resources.TransferOrder; 9 | import com.google.gson.JsonObject; 10 | 11 | /** 12 | *
13 | * A namespaced client for the
14 | * /v1/ordering/transfer-orders
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 23 | * amadeus.ordering.transferOrders;24 | */ 25 | public class TransferOrders { 26 | private Amadeus client; 27 | 28 | private static final String TRANSFER_ORDERS_URL = "/v1/ordering/transfer-orders"; 29 | 30 | /** 31 | * Constructor. 32 | * 33 | * @hide 34 | */ 35 | public TransferOrders(Amadeus client) { 36 | this.client = client; 37 | } 38 | 39 | /** 40 | *
41 | * The Amadeus Transfer Offers API allows travelers to book private transfers. 42 | *
43 | * 44 | *45 | * amadeus.ordering.transferOrders.post(body);46 | * 47 | * @param body the parameters to send to the API as a JsonObject 48 | * @param params URL parameters 49 | * @return an API resource 50 | * @throws ResponseException when an exception occurs 51 | */ 52 | public TransferOrder post(JsonObject body, Params params) throws ResponseException { 53 | Response response = client.post(TRANSFER_ORDERS_URL, params, body); 54 | return (TransferOrder) Resource.fromObject(response, TransferOrder.class); 55 | } 56 | 57 | /** 58 | *
59 | * The Amadeus Transfer Offers API allows travelers to book private transfers. 60 | *
61 | * 62 | *63 | * amadeus.ordering.transferOrders.post(body);64 | * 65 | * @param body the parameters to send to the API as a String 66 | * @param params URL parameters 67 | * @return an API resource 68 | * @throws ResponseException when an exception occurs 69 | */ 70 | public TransferOrder post(String body, Params params) throws ResponseException { 71 | Response response = client.post(TRANSFER_ORDERS_URL, params, body); 72 | return (TransferOrder) Resource.fromObject(response, TransferOrder.class); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/ordering/transferOrders/Transfers.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.ordering.transferOrders; 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.ordering.transferOrders.transfers.Cancellation; 5 | 6 | /** 7 | *
8 | * A namespaced client for the
9 | * /v1/ordering/transfer-orders/{orderId}/transfers/cancellation
endpoints.
10 | *
13 | * Access via the Amadeus client object 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 18 | * amadeus.ordering.transferOrders(orderId).urls;19 | * 20 | * @hide 21 | */ 22 | public class Transfers { 23 | /** 24 | *
25 | * A namespaced client for the
26 | * /v1/ordering/transfer-orders/{orderId}/transfers/cancellation
endpoints.
27 | *
13 | * A namespaced client for the
14 | * /v1/ordering/transfer-orders/{orderId}/transfers/cancellation
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 23 | * amadeus.ordering.transferOrder(orderId).transfers.cancellation;24 | */ 25 | public class Cancellation { 26 | private Amadeus client; 27 | private String orderId; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @hide 33 | */ 34 | public Cancellation(Amadeus client, String orderId) { 35 | this.client = client; 36 | this.orderId = orderId; 37 | } 38 | 39 | /** 40 | *
41 | * The Amadeus Transfer Management API allows cancel private transfers. 42 | *
43 | * 44 | *45 | * amadeus.ordering.transferOrder(orderId).transfers.cancellation.post(params);46 | * 47 | * @param params URL parameters 48 | * @return an API resource 49 | * @throws ResponseException when an exception occurs 50 | */ 51 | public TransferCancellation post(Params params) throws ResponseException { 52 | String path = String.format("/v1/ordering/transfer-orders/%s/transfers/cancellation", orderId); 53 | Response response = client.post(path, params); 54 | return (TransferCancellation) Resource.fromObject(response, TransferCancellation.class); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/referencedata/Airlines.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.referencedata; 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.Airline; 8 | import com.amadeus.resources.Resource; 9 | import com.google.gson.Gson; 10 | 11 | /** 12 | *
13 | * A namespaced client for the
14 | * /v1/reference-data/airlines
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.referenceData.airlines;24 | */ 25 | public class Airlines { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public Airlines(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns the airline name and code. 39 | *
40 | * 41 | *42 | * amadeus.referenceData.airlines.get(Params 43 | * .with("airlineCodes", "BA"));44 | * 45 | * @param params the parameters to send to the API 46 | * @return an API response object 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public Airline[] get(Params params) throws ResponseException { 50 | Response response = client.get("/v1/reference-data/airlines", params); 51 | return (Airline[]) Resource.fromArray(response, Airline[].class); 52 | } 53 | 54 | /** 55 | * Convenience method for calling
get
without any parameters.
56 | * @see Airlines#get()
57 | */
58 | public Airline[] get() throws ResponseException {
59 | return get(null);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/Location.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata;
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.referencedata.locations.Airports;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v2/reference-data/locations/:location_id
endpoints.
14 | *
17 | * Access via the Amadeus client object 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 22 | * amadeus.referenceData.location(locationId);23 | * 24 | * @hide 25 | */ 26 | public class Location { 27 | private Amadeus client; 28 | private String locationId; 29 | 30 | /** 31 | * Constructor. 32 | * @hide 33 | */ 34 | public Location(Amadeus client, String locationId) { 35 | this.locationId = locationId; 36 | this.client = client; 37 | } 38 | 39 | /** 40 | *
41 | * Returns details for a specific airport. 42 | *
43 | * 44 | *45 | * amadeus.referenceData.locations("ALHR').get();46 | * 47 | * @param params the parameters to send to the API 48 | * @return an API response object 49 | * @throws ResponseException when an exception occurs 50 | */ 51 | public com.amadeus.resources.Location get(Params params) throws ResponseException { 52 | String path = String.format("/v1/reference-data/locations/%s", locationId); 53 | Response response = client.get(path, params); 54 | return (com.amadeus.resources.Location) 55 | Resource.fromObject(response, com.amadeus.resources.Location.class); 56 | } 57 | 58 | /** 59 | * Convenience method for calling
get
without any parameters.
60 | * @see Airports#get()
61 | */
62 | public com.amadeus.resources.Location get() throws ResponseException {
63 | return get(null);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/RecommendedLocations.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata;
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.Location;
8 | import com.amadeus.resources.Resource;
9 | import com.google.gson.Gson;
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v1/reference-data/recommended-locations
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.referenceData.recommendedLocations;24 | */ 25 | public class RecommendedLocations { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public RecommendedLocations(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns a list of destination recommendations. 39 | *
40 | * 41 | *42 | * amadeus.referenceData.recommendedLocations.get(Params 43 | * .with("cityCodes", "PAR") 44 | * .and("travelerCountryCode", "FR"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public Location[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/reference-data/recommended-locations", params); 52 | return (Location[]) Resource.fromArray(response, Location[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see Location#get()
58 | */
59 | public Location[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/Urls.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.referencedata.urls.CheckinLinks;
5 |
6 | /**
7 | *
8 | * A namespaced client for the
9 | * /v2/reference-data/urls
endpoints.
10 | *
13 | * Access via the Amadeus client object 14 | *
15 | * 16 | *17 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 18 | * amadeus.referenceData.urls;19 | * 20 | * @hide 21 | */ 22 | public class Urls { 23 | /** 24 | *
25 | * A namespaced client for the
26 | * /v2/reference-data/urls/checkin-links
endpoints.
27 | *
13 | * A namespaced client for the
14 | * /v1/reference-data/locations/airports
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.referenceData.locations.airports;24 | */ 25 | public class Airports { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public Airports(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns a list of relevant airports near to a given point. 39 | *
40 | * 41 | *42 | * amadeus.referenceData.locations.airports.get(Params 43 | * .with("longitude", 49.0000) 44 | * .and("latitude", 2.55));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public Location[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/reference-data/locations/airports", params); 52 | return (Location[]) Resource.fromArray(response, Location[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see Airports#get()
58 | */
59 | public Location[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/Cities.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations;
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.City;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/reference-data/locations/cities
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.referenceData.locations.cities;23 | */ 24 | public class Cities { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public Cities(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of relevant cities that match a specific word or string of letters. 38 | *
39 | * 40 | *41 | * amadeus.referenceData.locations.cities.get(Params 42 | * .with("keyword", "PARIS");43 | * 44 | * @param params the parameters to send to the API 45 | * @return an API response object 46 | * @throws ResponseException when an exception occurs 47 | */ 48 | public City[] get(Params params) throws ResponseException { 49 | Response response = client.get("/v1/reference-data/locations/cities", params); 50 | return (City[]) Resource.fromArray(response, City[].class); 51 | } 52 | 53 | /** 54 | * Convenience method for calling
get
without any parameters.
55 | * @see Cities#get()
56 | */
57 | public City[] get() throws ResponseException {
58 | return get(null);
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/Hotel.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations;
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 | *
11 | * A namespaced client for the
12 | * /v1/reference-data/locations/hotel
endpoints.
13 | *
16 | * Access via the Amadeus client object. 17 | *
18 | * 19 | *20 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 21 | * amadeus.referenceData.locations.hotel;22 | */ 23 | public class Hotel { 24 | private Amadeus client; 25 | 26 | /** 27 | * Constructor. 28 | * @hide 29 | */ 30 | public Hotel(Amadeus client) { 31 | this.client = client; 32 | } 33 | 34 | /** 35 | *
36 | * Returns a list of relevant hotels inside a city. 37 | *
38 | * 39 | *40 | * amadeus.referenceData.locations.hotel.get(Params 41 | * .with("cityCode", "PAR"));42 | * 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.Hotel[] get(Params params) throws ResponseException { 48 | Response response = client.get("/v1/reference-data/locations/hotel", params); 49 | return (com.amadeus.resources.Hotel[]) 50 | Resource.fromArray(response, com.amadeus.resources.Hotel[].class); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/referencedata/locations/Hotels.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.referencedata.locations; 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.referencedata.locations.hotels.ByCity; 5 | import com.amadeus.referencedata.locations.hotels.ByGeocode; 6 | import com.amadeus.referencedata.locations.hotels.ByHotels; 7 | 8 | /** 9 | *
10 | * A namespaced client for the
11 | * /v1/reference-data/locations/hotels
endpoints.
12 | *
15 | * Access via the Amadeus client object. 16 | *
17 | * 18 | *19 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 20 | * amadeus.referenceData.locations.hotels;21 | */ 22 | public class Hotels { 23 | /** 24 | *
25 | * A namespaced client for the
26 | * /v1/reference-data/locations/hotels/by-city
endpoints.
27 | *
33 | * A namespaced client for the
34 | * /v1/reference-data/locations/hotels/by-hotels
endpoints.
35 | *
41 | * A namespaced client for the
42 | * /v1/reference-data/locations/hotels/by-geocode
endpoints.
43 | *
11 | * A namespaced client for the
12 | * /v1/reference-data/locations/pois
endpoints.
13 | *
16 | * Access via the Amadeus client object. 17 | *
18 | * 19 | *20 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 21 | * amadeus.referenceData.locations.pointOfInterest;22 | */ 23 | public class PointOfInterest { 24 | private Amadeus client; 25 | private String id; 26 | 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public PointOfInterest(Amadeus client, String id) { 33 | this.client = client; 34 | this.id = id; 35 | } 36 | 37 | /** 38 | *
39 | * Returns a single Point of Interest from a given id. 40 | *
41 | * 42 | *43 | * amadeus.referenceData.locations.pointOfInterest("9CB40CB5D0").get();44 | * 45 | * @param params the parameters to send to the API 46 | * @return an API response object 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public com.amadeus.resources.PointOfInterest get(Params params) throws ResponseException { 50 | String path = String.format("/v1/reference-data/locations/pois/%s", id); 51 | Response response = client.get(path, params); 52 | return (com.amadeus.resources.PointOfInterest) Resource.fromObject( 53 | response, com.amadeus.resources.PointOfInterest.class); 54 | } 55 | 56 | /** 57 | * Convenience method for calling
get
without any parameters.
58 | * @see PointOfInterest#get()
59 | */
60 | public com.amadeus.resources.PointOfInterest get() throws ResponseException {
61 | return get(null);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/PointsOfInterest.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations;
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.referencedata.locations.pointsofinterest.BySquare;
8 | import com.amadeus.resources.PointOfInterest;
9 | import com.amadeus.resources.Resource;
10 | import com.google.gson.Gson;
11 |
12 | /**
13 | *
14 | * A namespaced client for the
15 | * /v1/reference-data/locations/pois
endpoints.
16 | *
19 | * Access via the Amadeus client object. 20 | *
21 | * 22 | *23 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 24 | * amadeus.referenceData.locations.pointsOfInterest;25 | */ 26 | public class PointsOfInterest { 27 | private Amadeus client; 28 | 29 | 30 | /** 31 | *
32 | * A namespaced client for the
33 | * /v1/reference-data/locations/pois/by-square
endpoints.
34 | *
50 | * Returns a list of relevant point of interests near to a given point. 51 | *
52 | * 53 | *54 | * amadeus.referenceData.locations.pointsOfInterest.get(Params 55 | * .with("longitude", 2.160873) 56 | * .and("latitude", 41.397158));57 | * 58 | * @param params the parameters to send to the API 59 | * @return an API response object 60 | * @throws ResponseException when an exception occurs 61 | */ 62 | public PointOfInterest[] get(Params params) throws ResponseException { 63 | Response response = client.get("/v1/reference-data/locations/pois", params); 64 | return (PointOfInterest[]) Resource.fromArray(response, PointOfInterest[].class); 65 | } 66 | 67 | /** 68 | * Convenience method for calling
get
without any parameters.
69 | * @see PointsOfInterest#get()
70 | */
71 | public PointOfInterest[] get() throws ResponseException {
72 | return get(null);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/hotels/ByCity.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations.hotels;
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.Hotel;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/reference-data/locations/hotels/by-city
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.referenceData.locations.hotels.byCity;23 | */ 24 | public class ByCity { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public ByCity(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of relevant hotels inside a city. 38 | *
39 | * 40 | *41 | * amadeus.referenceData.locations.hotels.byCity.get(Params 42 | * .with("cityCode", "PAR"));43 | * 44 | * @param params the parameters to send to the API 45 | * @return an API response object 46 | * @throws ResponseException when an exception occurs 47 | */ 48 | public Hotel[] get(Params params) throws ResponseException { 49 | Response response = client.get("/v1/reference-data/locations/hotels/by-city", params); 50 | return (Hotel[]) Resource.fromArray(response, Hotel[].class); 51 | } 52 | 53 | /** 54 | * Convenience method for calling
get
without any parameters.
55 | * @see ByCity#get()
56 | */
57 | public Hotel[] get() throws ResponseException {
58 | return get(null);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/hotels/ByGeocode.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations.hotels;
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.Hotel;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/reference-data/locations/hotels/by-geocode
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.referenceData.locations.hotels.byGeocode;23 | */ 24 | public class ByGeocode { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public ByGeocode(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of hotels result of the search using geocode. 38 | *
39 | * 40 | *41 | * amadeus.referenceData.locations.hotels.byGeocode.get(Params 42 | * .with("latitude", "41.397158") 43 | * .and("longitude", "2.160873"));44 | * 45 | * @param params the parameters to send to the API 46 | * @return an API response object 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public Hotel[] get(Params params) throws ResponseException { 50 | Response response = client.get("/v1/reference-data/locations/hotels/by-geocode", params); 51 | return (Hotel[]) Resource.fromArray(response, Hotel[].class); 52 | } 53 | 54 | /** 55 | * Convenience method for calling
get
without any parameters.
56 | * @see ByGeocode#get()
57 | */
58 | public Hotel[] get() throws ResponseException {
59 | return get(null);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/hotels/ByHotels.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations.hotels;
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.Hotel;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/reference-data/locations/hotels/by-hotels
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.referenceData.locations.hotels.byHotels;23 | */ 24 | public class ByHotels { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public ByHotels(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of hotels result of the search using unique Id. 38 | *
39 | * 40 | *41 | * amadeus.referenceData.locations.hotels.byHotels.get(Params 42 | * .with("hotelIds", "ACPAR733"));43 | * 44 | * @param params the parameters to send to the API 45 | * @return an API response object 46 | * @throws ResponseException when an exception occurs 47 | */ 48 | public Hotel[] get(Params params) throws ResponseException { 49 | Response response = client.get("/v1/reference-data/locations/hotels/by-hotels", params); 50 | return (Hotel[]) Resource.fromArray(response, Hotel[].class); 51 | } 52 | 53 | /** 54 | * Convenience method for calling
get
without any parameters.
55 | * @see ByHotels#get()
56 | */
57 | public Hotel[] get() throws ResponseException {
58 | return get(null);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/locations/pointsOfInterest/BySquare.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.locations.pointsofinterest;
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.PointOfInterest;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/reference-data/locations/pois/by-square
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.referenceData.locations.pointsOfInterest.bySquare;23 | */ 24 | public class BySquare { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public BySquare(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of relevant point of interests within a square defined by 38 | * cardinal points. 39 | *
40 | * 41 | *42 | * amadeus.referenceData.locations.pointsOfInterest.bySquare.get(Params 43 | * .with("north", 41.397158) 44 | * .and("west", 2.160873) 45 | * .and("south", 41.394582) 46 | * .and("east", 2.177181));47 | * 48 | * @param params the parameters to send to the API 49 | * @return an API response object 50 | * @throws ResponseException when an exception occurs 51 | */ 52 | public PointOfInterest[] get(Params params) throws ResponseException { 53 | Response response = client.get("/v1/reference-data/locations/pois/by-square", params); 54 | return (PointOfInterest[]) Resource.fromArray(response, PointOfInterest[].class); 55 | } 56 | 57 | /** 58 | * Convenience method for calling
get
without any parameters.
59 | * @see PointsOfInterest#get()
60 | */
61 | public PointOfInterest[] get() throws ResponseException {
62 | return get(null);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/referencedata/urls/CheckinLinks.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.referencedata.urls;
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.CheckinLink;
8 | import com.amadeus.resources.Resource;
9 | import com.google.gson.Gson;
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v2/reference-data/urls/checkin-links
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 23 | * amadeus.referenceData.urls.checkinLinks;24 | */ 25 | public class CheckinLinks { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public CheckinLinks(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns the checkin links for an airline, for the 39 | * language of your choice. 40 | *
41 | * 42 | *43 | * amadeus.referenceData.urls.checkinLinks.get(Params.with("airlineCode", "BA"));44 | * 45 | * @param params the parameters to send to the API 46 | * @return an API resource 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public CheckinLink[] get(Params params) throws ResponseException { 50 | Response response = client.get("/v2/reference-data/urls/checkin-links", params); 51 | return (CheckinLink[]) Resource.fromArray(response, CheckinLink[].class); 52 | } 53 | 54 | /** 55 | * Convenience method for calling
get
without any parameters.
56 | * @see CheckinLinks#get()
57 | */
58 | public CheckinLink[] get() throws ResponseException {
59 | return get(null);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Activity.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An Activity object as returned by the Tours and Activities API.
8 | * @see com.amadeus.shopping.Activity#get()
9 | */
10 | @ToString
11 | public class Activity extends Resource {
12 | private @Getter String type;
13 | private @Getter String id;
14 | private @Getter String name;
15 | private @Getter String shortDescription;
16 | private @Getter String description;
17 | private @Getter GeoCode geoCode;
18 | private @Getter String rating;
19 | private @Getter String bookingLink;
20 | private @Getter String minimumDuration;
21 | private @Getter ElementaryPrice price;
22 | private @Getter String[] pictures;
23 |
24 | protected Activity() {}
25 |
26 | /**
27 | * An Activity-related object as returned by the Tours and Activities API.
28 | * @see com.amadeus.shopping.Activity#get()
29 | */
30 | @ToString
31 | public class GeoCode {
32 | private @Getter double latitude;
33 | private @Getter double longitude;
34 |
35 | protected GeoCode() {}
36 | }
37 |
38 | @ToString
39 | public class ElementaryPrice {
40 | private @Getter String amount;
41 | private @Getter String currencyCode;
42 |
43 | protected ElementaryPrice() {}
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/AirTraffic.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 |
7 |
8 | /**
9 | * An AirTraffic object as returned by the AirTraffic API.
10 | * @see Traveled#get()
11 | */
12 | @ToString
13 | public class AirTraffic extends Resource {
14 | private @Getter String type;
15 | private @Getter String subType;
16 | private @Getter String destination;
17 | private @Getter Analytics analytics;
18 |
19 | protected AirTraffic() {}
20 |
21 | /**
22 | * An AirTraffic-related object as returned by the AirTraffic API.
23 | * @see Traveled#get()
24 | */
25 | @ToString
26 | public class Analytics {
27 | private @Getter Flights flights;
28 | private @Getter Travelers travelers;
29 |
30 | protected Analytics() {}
31 |
32 | /**
33 | * An AirTraffic-related object as returned by the AirTraffic API.
34 | * @see Traveled#get()
35 | */
36 | @ToString
37 | public class Flights {
38 | private @Getter Double score;
39 |
40 | protected Flights() {}
41 | }
42 |
43 | /**
44 | * An AirTraffic-related object as returned by the AirTraffic API.
45 | * @see Traveled#get()
46 | */
47 | @ToString
48 | public class Travelers {
49 | private @Getter Double score;
50 |
51 | protected Travelers() {}
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Airline.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An Airline object as returned by the Airline Code LookUp API.
8 | * @see com.amadeus.referenceData.airlines#get()
9 | */
10 | @ToString
11 | public class Airline extends Resource {
12 | private @Getter String type;
13 | private @Getter String iataCode;
14 | private @Getter String icaoCode;
15 | private @Getter String businessName;
16 | private @Getter String commonName;
17 |
18 | protected Airline() {}
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/CheckinLink.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An CheckinLink object as returned by the CheckinLink API.
8 | * @see com.amadeus.referencedata.urls.CheckinLinks#get()
9 | */
10 | @ToString
11 | public class CheckinLink extends Resource {
12 | private @Getter String type;
13 | private @Getter String id;
14 | private @Getter String href;
15 | private @Getter String channel;
16 |
17 | protected CheckinLink() {}
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/City.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A City object as returned by the City Search API.
8 | * @see com.amadeus.referencedata.locations.Cities#get()
9 | */
10 | @ToString
11 | public class City extends Resource {
12 | private @Getter String type;
13 | private @Getter Relationship[] relationships;
14 | private @Getter String subType;
15 | private @Getter String name;
16 | private @Getter String iataCode;
17 | private @Getter Address address;
18 | private @Getter Location.GeoCode geoCode;
19 |
20 | protected City() {}
21 |
22 | @ToString
23 | public class Relationship {
24 | private @Getter String id;
25 | private @Getter String type;
26 | private @Getter String href;
27 |
28 | protected Relationship() {}
29 | }
30 |
31 | @ToString
32 | public class Address {
33 | private @Getter String postalCode;
34 | private @Getter String countryCode;
35 | private @Getter String stateCode;
36 |
37 | protected Address() {}
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Destination.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A Destination object as returned by the Airport Routes API.
8 | * @see com.amadeus.airport.DirectDestinations#get()
9 | * @see com.amadeus.airline.Destinations#get()
10 | */
11 |
12 | @ToString
13 | public class Destination extends Resource {
14 | private @Getter String type;
15 | private @Getter String subtype;
16 | private @Getter String name;
17 | private @Getter String iataCode;
18 |
19 | protected Destination() {}
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/FlightDate.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import java.util.Date;
4 | import lombok.Getter;
5 | import lombok.ToString;
6 |
7 | /**
8 | * An FlightDate object as returned by the FlightDates API.
9 | * @see com.amadeus.shopping.FlightDates#get()
10 | */
11 | @ToString
12 | public class FlightDate extends Resource {
13 | private @Getter String type;
14 | private @Getter String origin;
15 | private @Getter String destination;
16 | private @Getter Date departureDate;
17 | private @Getter Date returnDate;
18 | private @Getter Price price;
19 |
20 | protected FlightDate() {}
21 |
22 | /**
23 | * An FlightDate-related object as returned by the FlightDates API.
24 | * @see com.amadeus.shopping.FlightDates#get()
25 | */
26 | @ToString
27 | public class Price {
28 | private @Getter double total;
29 |
30 | protected Price() {}
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/FlightDestination.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import java.util.Date;
4 | import lombok.Getter;
5 | import lombok.ToString;
6 |
7 | /**
8 | * An FlightDestination object as returned by the FlightDestinations API.
9 | * @see com.amadeus.shopping.FlightDestinations#get()
10 | */
11 | @ToString
12 | public class FlightDestination extends Resource {
13 | private @Getter String type;
14 | private @Getter String origin;
15 | private @Getter String destination;
16 | private @Getter Date departureDate;
17 | private @Getter Date returnDate;
18 | private @Getter Price price;
19 |
20 | protected FlightDestination() {}
21 |
22 | /**
23 | * An FlightDestination-related object as returned by the FlightDestinations API.
24 | * @see com.amadeus.shopping.FlightDestinations#get()
25 | */
26 | @ToString
27 | public class Price {
28 | private @Getter double total;
29 |
30 | protected Price() {}
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/FlightPayment.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An FlightPayment object as returned by the Flight Offers Price API.
8 | * @see amadeus.shopping.flightOffersSearch.pricing#post()
9 | */
10 | @ToString
11 | public class FlightPayment extends Resource {
12 | private @Getter String brand;
13 | private @Getter Integer binNumber;
14 | private @Getter String[] flightOfferIds;
15 |
16 | protected FlightPayment() {}
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/FlightPrice.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | @ToString
7 | public class FlightPrice extends Resource {
8 | private @Getter String type;
9 | private @Getter FlightOfferSearch[] flightOffers;
10 | private @Getter BookingRequirements bookingRequirements;
11 |
12 | protected FlightPrice() {}
13 |
14 | @ToString
15 | public class BookingRequirements {
16 |
17 | private @Getter Boolean invoiceAddressRequired;
18 | private @Getter Boolean mailingAddressRequired;
19 | private @Getter Boolean emailAddressRequired;
20 | private @Getter Boolean phoneCountryCodeRequired;
21 | private @Getter Boolean mobilePhoneNumberRequired;
22 | private @Getter Boolean phoneNumberRequired;
23 | private @Getter Boolean postalCodeRequired;
24 | private @Getter PassengerConditions[] travelerRequirements;
25 |
26 | protected BookingRequirements() {}
27 | }
28 |
29 | @ToString
30 | public class PassengerConditions {
31 | private @Getter String travelerId;
32 | private @Getter Boolean genderRequired;
33 | private @Getter Boolean documentRequired;
34 | private @Getter Boolean documentIssuanceCityRequired;
35 | private @Getter Boolean dateOfBirthRequired;
36 | private @Getter Boolean redressRequiredIfAny;
37 | private @Getter Boolean airFranceDiscountRequired;
38 | private @Getter Boolean spanishResidentDiscountRequired;
39 | private @Getter Boolean residenceRequired;
40 |
41 | protected PassengerConditions(){}
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Hotel.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A Hotel object as returned by the Hotel List API.
8 | * @see com.amadeus.referencedata.locations.hotels.ByHotels#get()
9 | * @see com.amadeus.referencedata.locations.hotels.ByCity#get()
10 | * @see com.amadeus.referencedata.locations.hotels.ByGeocode#get()
11 | */
12 | @ToString
13 | public class Hotel extends Resource {
14 | private @Getter String subtype;
15 | private @Getter String name;
16 | private @Getter String timeZoneName;
17 | private @Getter String iataCode;
18 | private @Getter Address address;
19 | private @Getter GeoCode geoCode;
20 | private @Getter String googlePlaceId;
21 | private @Getter String openjetAirportId;
22 | private @Getter String uicCode;
23 | private @Getter String hotelId;
24 | private @Getter String chainCode;
25 | private @Getter Distance distance;
26 | private @Getter String lastUpdate;
27 |
28 | protected Hotel() {}
29 |
30 | @ToString
31 | public class Address {
32 | private @Getter String category;
33 | private @Getter String[] lines;
34 | private @Getter String postalCode;
35 | private @Getter String countryCode;
36 | private @Getter String cityName;
37 | private @Getter String stateCode;
38 | private @Getter String postalBox;
39 | private @Getter String text;
40 | private @Getter String state;
41 |
42 | protected Address() {}
43 | }
44 |
45 | @ToString
46 | public class GeoCode {
47 | private @Getter float latitude;
48 | private @Getter float longitude;
49 |
50 | protected GeoCode() {}
51 | }
52 |
53 | @ToString
54 | public class Distance {
55 | private @Getter String unit;
56 | private @Getter double value;
57 | private @Getter String displayValue;
58 | private @Getter String isUnlimited;
59 |
60 | protected Distance() {}
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/HotelBooking.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An HotelBooking object as returned by the Hotel Booking API.
8 | * @see com.amadeus.booking.HotelBookings#get()
9 | */
10 | @ToString
11 | public class HotelBooking extends Resource {
12 | private @Getter String type;
13 | private @Getter String id;
14 | private @Getter String providerConfirmationId;
15 | private @Getter AssociatedRecord[] associatedRecords;
16 |
17 | protected HotelBooking() {}
18 |
19 | @ToString
20 | public class AssociatedRecord {
21 | private @Getter String reference;
22 | private @Getter String originSystemCode;
23 |
24 | protected AssociatedRecord() {}
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/HotelOrder.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import com.amadeus.resources.HotelOfferSearch.Offer;
4 | import lombok.Getter;
5 | import lombok.ToString;
6 |
7 | /**
8 | * An HotelOrder object as returned by the Hotel Booking v2 API.
9 | * @see com.amadeus.booking.HotelOrders#get()
10 | */
11 | @ToString
12 | public class HotelOrder extends Resource {
13 | private @Getter String self;
14 | private @Getter String type;
15 | private @Getter String id;
16 | private @Getter HotelBooking[] hotelBookings;
17 | private @Getter AssociatedRecord[] associatedRecords;
18 | private @Getter Guest[] guests;
19 |
20 | protected HotelOrder() {}
21 |
22 | @ToString
23 | public static class HotelBooking {
24 | private @Getter String type;
25 | private @Getter String id;
26 | private @Getter String bookingStatus;
27 | private @Getter RoomAssociation[] roomAssociations;
28 | private @Getter Offer hotelOffer;
29 | private @Getter Hotel hotel;
30 |
31 | protected HotelBooking() {}
32 | }
33 |
34 | @ToString
35 | public static class RoomAssociation {
36 | private @Getter String hotelOfferId;
37 | private GuestReference[] guestReferences;
38 | private @Getter String specialRequest;
39 |
40 | protected RoomAssociation() {}
41 | }
42 |
43 | @ToString
44 | public static class GuestReference {
45 | private @Getter String guestReference;
46 | private @Getter String hotelLoyaltyId;
47 |
48 | protected GuestReference() {}
49 | }
50 |
51 | @ToString
52 | public static class Guest {
53 | private @Getter int tid;
54 | private @Getter int id;
55 | private @Getter FrequentTraveler[] frequentTraveler;
56 | private @Getter String phone;
57 | private @Getter String email;
58 | private @Getter String title;
59 | private @Getter String firstName;
60 | private @Getter String lastName;
61 | private @Getter Integer childAge;
62 |
63 | protected Guest() {}
64 | }
65 |
66 | @ToString
67 | public static class FrequentTraveler {
68 | private @Getter String airlineCode;
69 | private @Getter String frequentTravelerId;
70 |
71 | protected FrequentTraveler() {}
72 | }
73 |
74 | @ToString
75 | public static class AssociatedRecord {
76 | private @Getter String reference;
77 | private @Getter String originSystemCode;
78 |
79 | protected AssociatedRecord() {}
80 | }
81 |
82 | @ToString
83 | public static class Hotel {
84 | private @Getter String hotelId;
85 | private @Getter String chainCode;
86 | private @Getter String name;
87 | private @Getter String self;
88 |
89 | protected Hotel() {}
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/HotelSentiment.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An HotelSentiment object as returned by the Hotel Ratings API.
8 | * @see HotelSentiments#get()
9 | */
10 |
11 | @ToString
12 | public class HotelSentiment extends Resource {
13 | private @Getter String hotelId;
14 | private @Getter String type;
15 | private @Getter int overallRating;
16 | private @Getter int numberOfReviews;
17 | private @Getter Sentiment sentiments;
18 |
19 | protected HotelSentiment() {}
20 |
21 | @ToString
22 | public class Sentiment {
23 | private @Getter int staff;
24 | private @Getter int location;
25 | private @Getter int service;
26 | private @Getter int roomComforts;
27 | private @Getter int sleepQuality;
28 | private @Getter int swimmingPool;
29 | private @Getter int valueForMoney;
30 | private @Getter int facilities;
31 | private @Getter int catering;
32 | private @Getter int pointsOfInterest;
33 |
34 | protected Sentiment() {}
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/ItineraryPriceMetric.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A ItineraryPriceMetric object as returned by the Flight Price Analysis API.
8 | * @see com.amadeus.analytics.ItineraryPriceMetrics#get()
9 | */
10 | @ToString
11 | public class ItineraryPriceMetric extends Resource {
12 | private @Getter String type;
13 | private @Getter Location origin;
14 | private @Getter Location destination;
15 | private @Getter String departureDate;
16 | private @Getter String transportType;
17 | private @Getter String currencyCode;
18 | private @Getter Boolean oneWay;
19 | private @Getter PriceMetrics[] priceMetrics;
20 |
21 | protected ItineraryPriceMetric() {}
22 |
23 | @ToString
24 | public class Location {
25 | private @Getter String iataCode;
26 |
27 | protected Location() {}
28 | }
29 |
30 | @ToString
31 | public class PriceMetrics {
32 | private @Getter String amount;
33 | private @Getter String quartileRanking;
34 |
35 | protected PriceMetrics() {}
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Period.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An Period object as returned by the BusiestPeriod API.
8 | * @see Traveled#get()
9 | */
10 | @ToString
11 | public class Period extends Resource {
12 | private @Getter String type;
13 | private @Getter String period;
14 | private @Getter Analytics analytics;
15 |
16 | protected Period() {}
17 |
18 | /**
19 | * An Period-related object as returned by the Busiest Period API.
20 | * @see Traveled#get()
21 | */
22 | @ToString
23 | public class Analytics {
24 | private @Getter Travelers travelers;
25 |
26 | protected Analytics() {}
27 |
28 | /**
29 | * An Period-related object as returned by the BusiestPeriod API.
30 | * @see Traveled#get()
31 | */
32 | @ToString
33 | public class Travelers {
34 | private @Getter Double score;
35 |
36 | protected Travelers() {}
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/PointOfInterest.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A PointOfInterest object as returned by the Location API.
8 | * @see com.amadeus.referencedata.locations.PointOfInterest#get()
9 | */
10 | @ToString
11 | public class PointOfInterest extends Resource {
12 | private @Getter String type;
13 | private @Getter String subType;
14 | private @Getter String name;
15 | private @Getter GeoCode geoCode;
16 | private @Getter String category;
17 | private @Getter String[] tags;
18 |
19 | protected PointOfInterest() {}
20 |
21 | /**
22 | * An PointOfInterest-related object as returned by the PointOfInterest API.
23 | * @see com.amadeus.referencedata.locations.PointOfInterest#get()
24 | */
25 | @ToString
26 | public class GeoCode {
27 | private @Getter double latitude;
28 | private @Getter double longitude;
29 |
30 | protected GeoCode() {}
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Prediction.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * An Period object as returned by the Prediction APIs.
8 | *
9 | * @see com.amadeus.travel.predictions.TripPurpose#get()
10 | */
11 | @ToString
12 | public class Prediction extends Resource {
13 | private @Getter String type;
14 | private @Getter String subType;
15 | private @Getter String id;
16 | private @Getter String result;
17 | private @Getter String probability;
18 |
19 | protected Prediction() {}
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/Resource.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import com.amadeus.Response;
4 | import com.google.gson.Gson;
5 | import com.google.gson.GsonBuilder;
6 | import com.google.gson.JsonArray;
7 | import com.google.gson.JsonElement;
8 | import lombok.Getter;
9 |
10 | /**
11 | * A generic resource as returned by all namespaced APIs.
12 | */
13 | public class Resource {
14 | /**
15 | * The original response that this object is populated from.
16 | */
17 | private transient @Getter Response response;
18 | /**
19 | * The class used for deserialization.
20 | * @hide as only used internally
21 | */
22 | private transient @Getter Class deSerializationClass;
23 |
24 | protected Resource() {}
25 |
26 | /**
27 | * Turns a response into a Gson deserialized array of resources,
28 | * attaching the response to each resource.
29 | * @hide as only used internally
30 | */
31 | public static Resource[] fromArray(Response response, Class klass) {
32 | Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
33 | JsonElement responseData = response.getData();
34 | if (responseData == null) {
35 | responseData = new JsonArray(0);
36 | }
37 | Resource[] resources = (Resource[]) gson.fromJson(responseData, klass);
38 | for (Resource resource : resources) {
39 | resource.response = response;
40 | resource.deSerializationClass = klass;
41 | }
42 | return resources;
43 | }
44 |
45 | /**
46 | * Turns a response into a Gson deserialized resource,
47 | * attaching the response to the resource.
48 | * @hide as only used internally
49 | */
50 | public static Resource fromObject(Response response, Class klass) {
51 | Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
52 | Resource resource = (Resource) gson.fromJson(response.getData(), klass);
53 | resource.response = response;
54 | resource.deSerializationClass = klass;
55 | return resource;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/ScoredLocation.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 | /**
7 | * A ScoreLocation object as returned by the Location Score API.
8 | * @see com.amadeus.location.analytics.CategoryRatedAreas#get()
9 | */
10 | @ToString
11 | public class ScoredLocation extends Resource {
12 | private @Getter GeoCode geoCode;
13 | private @Getter int radius;
14 | private @Getter CategoryScores categoryScores;
15 | private @Getter String type;
16 |
17 | protected ScoredLocation() {}
18 |
19 | @ToString
20 | public class GeoCode {
21 | private @Getter float latitude;
22 | private @Getter float longitude;
23 |
24 | protected GeoCode() {}
25 | }
26 |
27 | @ToString
28 | public class CategoryScores {
29 | private @Getter Sight sight;
30 | private @Getter Restaurant restaurant;
31 | private @Getter Shopping shopping;
32 | private @Getter NightLife nightLife;
33 |
34 | protected CategoryScores() {}
35 |
36 | @ToString
37 | public class Sight {
38 | private @Getter int overall;
39 | private @Getter int historical;
40 | private @Getter int beachAndPark;
41 |
42 | protected Sight() {}
43 | }
44 |
45 | @ToString
46 | public class Restaurant {
47 | private @Getter int overall;
48 | private @Getter int vegetarian;
49 |
50 | protected Restaurant() {}
51 | }
52 |
53 | @ToString
54 | public class Shopping {
55 | private @Getter int overall;
56 | private @Getter int luxury;
57 |
58 | protected Shopping() {}
59 | }
60 |
61 | @ToString
62 | public class NightLife {
63 | private @Getter int overall;
64 |
65 | protected NightLife() {}
66 | }
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/resources/TransferCancellation.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.resources;
2 |
3 | import lombok.Getter;
4 | import lombok.ToString;
5 |
6 |
7 | /**
8 | * A TransferCancellation object as returned by the Transfer Management API.
9 | * @see com.amadeus.ordering.transferOrders.transfers.transfer.Cancellation#post()
10 | */
11 | @ToString
12 | public class TransferCancellation extends Resource {
13 | private @Getter String confirmNbr;
14 | private @Getter String reservationStatus;
15 |
16 | protected TransferCancellation() {}
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/schedule/Flights.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.schedule;
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.DatedFlight;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v2/schedule/flights
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.schedule.flights;23 | */ 24 | public class Flights { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public Flights(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Retrieves status of a given flight. 38 | *
39 | * 40 | *41 | * amadeus.schedule.flights.get(Params 42 | * .with("carrierCode", "AZ") 43 | * .and("flightNumber", "319") 44 | * .and("scheduledDepartureDate", "2021-03-13"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public DatedFlight[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v2/schedule/flights", params); 52 | return (DatedFlight[]) Resource.fromArray(response, DatedFlight[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see DatedFlight#get()
58 | */
59 | public DatedFlight[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/Activities.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
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.Activity;
8 | import com.amadeus.resources.Resource;
9 | import com.amadeus.shopping.activities.BySquare;
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v1/shopping/activities
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.shopping.activities;24 | */ 25 | public class Activities { 26 | private Amadeus client; 27 | 28 | 29 | /** 30 | *
31 | * A namespaced client for the
32 | * /v1/shopping/activities/by-square
endpoints.
33 | *
49 | * Returns a list of activities near to a given point. 50 | *
51 | * 52 | *53 | * amadeus.amadeus.shopping.activities.get(Params 54 | * .with("longitude", 2.160873) 55 | * .and("latitude", 41.397158));56 | * 57 | * @param params the parameters to send to the API 58 | * @return an API response object 59 | * @throws ResponseException when an exception occurs 60 | */ 61 | public Activity[] get(Params params) throws ResponseException { 62 | Response response = client.get("/v1/shopping/activities", params); 63 | return (Activity[]) Resource.fromArray(response, Activity[].class); 64 | } 65 | 66 | /** 67 | * Convenience method for calling
get
without any parameters.
68 | * @see Activities#get()
69 | */
70 | public Activity[] get() throws ResponseException {
71 | return get(null);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/Activity.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
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 | *
11 | * A namespaced client for the
12 | * /v1/shopping/activities
endpoints.
13 | *
16 | * Access via the Amadeus client object. 17 | *
18 | * 19 | *20 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 21 | * amadeus.shopping.activity;22 | */ 23 | public class Activity { 24 | private Amadeus client; 25 | private String id; 26 | 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public Activity(Amadeus client, String id) { 33 | this.client = client; 34 | this.id = id; 35 | } 36 | 37 | /** 38 | *
39 | * Returns a single activity from a given id. 40 | *
41 | * 42 | *43 | * amadeus.shopping.activity.("4615").get();44 | * 45 | * @param params the parameters to send to the API 46 | * @return an API response object 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public com.amadeus.resources.Activity get(Params params) throws ResponseException { 50 | String path = String.format("/v1/shopping/activities/%s", id); 51 | Response response = client.get(path, params); 52 | return (com.amadeus.resources.Activity) Resource.fromObject( 53 | response, com.amadeus.resources.Activity.class); 54 | } 55 | 56 | /** 57 | * Convenience method for calling
get
without any parameters.
58 | * @see Activity#get()
59 | */
60 | public com.amadeus.resources.Activity get() throws ResponseException {
61 | return get(null);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/Availability.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.shopping.availability.FlightAvailabilities;
5 |
6 | /**
7 | *
8 | * A namespaced client for the
9 | * /v1/shopping/availability
endpoints.
10 | *
15 | * A namespaced client for the
16 | * /v1/shopping/availability/flight-availabilities
endpoints.
17 | *
12 | * A namespaced client for the
13 | * /v1/shopping/flight-dates
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.shopping.flightDates;23 | */ 24 | public class FlightDates { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public FlightDates(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Find the cheapest flight dates from an 38 | * origin to a destination. 39 | *
40 | * 41 | *42 | * amadeus.shopping.flightDates.get(Params 43 | * .with("origin", "LHR") 44 | * .and("destination", "PAR"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public FlightDate[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/shopping/flight-dates", params); 52 | return (FlightDate[]) Resource.fromArray(response, FlightDate[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see FlightDates#get()
58 | */
59 | public FlightDate[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/FlightDestinations.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
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.FlightDestination;
8 | import com.amadeus.resources.Resource;
9 | import com.google.gson.Gson;
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v1/shopping/flight-destinations
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.shopping.flightDestinations;24 | */ 25 | public class FlightDestinations { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public FlightDestinations(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Find the cheapest destinations where 39 | * you can fly to. 40 | *
41 | * 42 | *43 | * amadeus.shopping.flightDestinations.get(Params 44 | * .with("origin", "LHR"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public FlightDestination[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/shopping/flight-destinations", params); 52 | return (FlightDestination[]) Resource.fromArray(response, FlightDestination[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see FlightDestinations#get()
58 | */
59 | public FlightDestination[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/FlightOffers.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.shopping.flightoffers.Prediction;
5 | import com.amadeus.shopping.flightoffers.Upselling;
6 |
7 | /**
8 | *
9 | * A namespaced client for the
10 | * /v1/shopping/flight-offers
endpoints.
11 | *
14 | * Access via the Amadeus client object. 15 | *
16 | * 17 | *18 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 19 | * amadeus.shopping.flightOffers;20 | */ 21 | public class FlightOffers { 22 | public Prediction prediction; 23 | public Upselling upselling; 24 | 25 | /** 26 | * Constructor. 27 | * @hide 28 | */ 29 | public FlightOffers(Amadeus client) { 30 | this.prediction = new Prediction(client); 31 | this.upselling = new Upselling(client); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/amadeus/shopping/HotelOfferSearch.java: -------------------------------------------------------------------------------- 1 | package com.amadeus.shopping; 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 | *
11 | * A namespaced client for the
12 | * /v3/shopping/hotel-offers/:offer_id
endpoints.
13 | *
16 | * Access via the Amadeus client object 17 | *
18 | * 19 | *20 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 21 | * amadeus.shopping.HotelOfferSearch(offerId);22 | * 23 | * @hide 24 | */ 25 | public class HotelOfferSearch { 26 | private Amadeus client; 27 | private String offerId; 28 | 29 | /** 30 | * Constructor. 31 | * @hide 32 | */ 33 | public HotelOfferSearch(Amadeus client, String offerId) { 34 | this.offerId = offerId; 35 | this.client = client; 36 | } 37 | 38 | /** 39 | *
40 | * Returns details for a specific offer. 41 | *
42 | * 43 | *44 | * amadeus.shopping.HotelOfferSearch("XXX").get();45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public com.amadeus.resources.HotelOfferSearch get(Params params) throws ResponseException { 51 | String path = String.format("/v3/shopping/hotel-offers/%s", offerId); 52 | Response response = client.get(path, params); 53 | return (com.amadeus.resources.HotelOfferSearch) Resource.fromObject( 54 | response, com.amadeus.resources.HotelOfferSearch.class); 55 | } 56 | 57 | /** 58 | * Convenience method for calling
get
without any parameters.
59 | * @see HotelOffer#get()
60 | */
61 | public com.amadeus.resources.HotelOfferSearch get() throws ResponseException {
62 | return get(null);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/HotelOffersSearch.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
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.HotelOfferSearch;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v3/shopping/hotel-offers
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.shopping.hotelOffersSearch;23 | */ 24 | public class HotelOffersSearch { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public HotelOffersSearch(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Search for hotels and retrieve availability and rates information. 38 | *
39 | * 40 | *41 | * amadeus.shopping.hotelOffers.get(Params 42 | * .with("hotelIds", "MCLONGHM") 43 | * .and("adults", 1) 44 | * .and("checkInDate", "2022-11-22") 45 | * .and("roomQuantity", 1) 46 | * .and("paymentPolicy", "NONE") 47 | * .and("bestRateOnly", true));48 | * 49 | * @param params the parameters to send to the API 50 | * @return an API response object 51 | * @throws ResponseException when an exception occurs 52 | */ 53 | public HotelOfferSearch[] get(Params params) throws ResponseException { 54 | Response response = client.get("/v3/shopping/hotel-offers", params); 55 | return (HotelOfferSearch[]) Resource.fromArray(response, HotelOfferSearch[].class); 56 | } 57 | 58 | /** 59 | * Convenience method for calling
get
without any parameters.
60 | * @see HotelOffersSearch#get()
61 | */
62 | public HotelOfferSearch[] get() throws ResponseException {
63 | return get(null);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/TransferOffers.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.Response;
5 | import com.amadeus.exceptions.ResponseException;
6 | import com.amadeus.resources.Resource;
7 | import com.amadeus.resources.TransferOffersPost;
8 | import com.google.gson.JsonObject;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/shopping/transfer-offers
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 22 | * amadeus.shopping.transferOffers;23 | */ 24 | public class TransferOffers { 25 | private Amadeus client; 26 | private static final String TRANSFER_OFFERS_URL = "/v1/shopping/transfer-offers"; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @hide 32 | */ 33 | public TransferOffers(Amadeus client) { 34 | this.client = client; 35 | } 36 | 37 | /** 38 | *
39 | * The Amadeus Transfer Offers API allows travelers to search and bookig private transfers. 40 | *
41 | * 42 | *43 | * amadeus.shopping.transferOffers.post(body);44 | * 45 | * @param body the parameters to send to the API as a JsonObject 46 | * @return an API resource 47 | * @throws ResponseException when an exception occurs 48 | */ 49 | public TransferOffersPost[] post(JsonObject body) throws ResponseException { 50 | Response response = client.post(TRANSFER_OFFERS_URL, body); 51 | return 52 | (TransferOffersPost[]) Resource.fromArray(response, TransferOffersPost[].class); 53 | } 54 | 55 | /** 56 | *
57 | * The Amadeus Transfer Offers API allows travelers to search and bookig private transfers. 58 | *
59 | * 60 | *61 | * amadeus.shopping.transferOffers.post(body);62 | * 63 | * @param body the parameters to send to the API as a String 64 | * @return an API resource 65 | * @throws ResponseException when an exception occurs 66 | */ 67 | public TransferOffersPost[] post(String body) throws ResponseException { 68 | Response response = client.post(TRANSFER_OFFERS_URL, body); 69 | return 70 | (TransferOffersPost[]) Resource.fromArray(response, TransferOffersPost[].class); 71 | } 72 | 73 | /** 74 | * Convenience method for calling
post
without any parameters.
75 | *
76 | * @see TransferOffersPost#post()
77 | */
78 | public TransferOffersPost[] post() throws ResponseException {
79 | return post((String) null);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/activities/BySquare.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping.activities;
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.Activity;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/shopping/activities/by-square
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.shopping.activities.bySquare;23 | */ 24 | public class BySquare { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public BySquare(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Returns a list of activities within a square defined by 38 | * cardinal points. 39 | *
40 | * 41 | *42 | * amadeus.shopping.activities.bySquare.get(Params 43 | * .with("north", 41.397158) 44 | * .and("west", 2.160873) 45 | * .and("south", 41.394582) 46 | * .and("east", 2.177181));47 | * 48 | * @param params the parameters to send to the API 49 | * @return an API response object 50 | * @throws ResponseException when an exception occurs 51 | */ 52 | public Activity[] get(Params params) throws ResponseException { 53 | Response response = client.get("/v1/shopping/activities/by-square", params); 54 | return (Activity[]) Resource.fromArray(response, Activity[].class); 55 | } 56 | 57 | /** 58 | * Convenience method for calling
get
without any parameters.
59 | * @see Activities#get()
60 | */
61 | public Activity[] get() throws ResponseException {
62 | return get(null);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/shopping/flightOffers/Upselling.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.shopping.flightoffers;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.Response;
5 | import com.amadeus.exceptions.ResponseException;
6 | import com.amadeus.resources.FlightOfferSearch;
7 | import com.amadeus.resources.Resource;
8 | import com.google.gson.JsonObject;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/shopping/flight-offers/upselling
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build(); 22 | * amadeus.shopping.availability.flightOffers.upselling;23 | */ 24 | public class Upselling { 25 | 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @hide 32 | */ 33 | public Upselling(Amadeus client) { 34 | this.client = client; 35 | } 36 | 37 | /** 38 | *
39 | * Branded Fares Upsell API is easily integrated into the Amadeus REST/JSON flight booking engine 40 | * and provides branded fare options for flights returned by the Flight Offers Search API. 41 | *
42 | * 43 | *44 | * amadeus.shopping.flightOffers.upselling.post(body);45 | * 46 | * @param body the parameters to send to the API as a JSonObject 47 | * @return an API resource 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public FlightOfferSearch[] post(JsonObject body) throws ResponseException { 51 | Response response = client.post("/v1/shopping/flight-offers/upselling", body); 52 | return (FlightOfferSearch[]) Resource.fromArray(response, FlightOfferSearch[].class); 53 | } 54 | 55 | /** 56 | *
57 | * Branded Fares Upsell API is easily integrated into the Amadeus REST/JSON flight booking engine 58 | * and provides branded fare options for flights returned by the Flight Offers Search API. 59 | *
60 | * 61 | *62 | * amadeus.shopping.flightOffers.upselling.post(body);63 | * 64 | * @param body the parameters to send to the API as a String 65 | * @return an API resource 66 | * @throws ResponseException when an exception occurs 67 | */ 68 | public FlightOfferSearch[] post(String body) throws ResponseException { 69 | Response response = client.post("/v1/shopping/flight-offers/upselling", body); 70 | return (FlightOfferSearch[]) Resource.fromArray(response, FlightOfferSearch[].class); 71 | } 72 | 73 | /** 74 | * Convenience method for calling
post
without any parameters.
75 | *
76 | * @see Upselling#post()
77 | */
78 | public FlightOfferSearch[] post() throws ResponseException {
79 | return post((String) null);
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/Predictions.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.travel.predictions.FlightDelay;
5 | import com.amadeus.travel.predictions.TripPurpose;
6 |
7 | /**
8 | *
9 | * A namespaced client for the
10 | * /v1/travel/predictions
endpoints.
11 | *
14 | * Access via the Amadeus client object. 15 | *
16 | * 17 | *18 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 19 | * amadeus.travel.predictions;20 | * 21 | * @hide 22 | */ 23 | public class Predictions { 24 | /** 25 | *
26 | * A namespaced client for the
27 | * /v1/travel/predictions/trip-purpose
endpoints.
28 | *
/v1/travel/predictions/flight-delay
endpoints.
34 | *
35 | */
36 | public FlightDelay flightDelay;
37 |
38 | /**
39 | * Constructor.
40 | *
41 | * @hide
42 | */
43 | public Predictions(Amadeus client) {
44 | this.tripPurpose = new TripPurpose(client);
45 | this.flightDelay = new FlightDelay(client);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/analytics/AirTraffic.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel.analytics;
2 |
3 | import com.amadeus.Amadeus;
4 | import com.amadeus.travel.analytics.airtraffic.Booked;
5 | import com.amadeus.travel.analytics.airtraffic.BusiestPeriod;
6 | import com.amadeus.travel.analytics.airtraffic.Traveled;
7 |
8 | /**
9 | *
10 | * A namespaced client for the
11 | * /v1/travel/analytics/air-traffic
endpoints.
12 | *
15 | * Access via the Amadeus client object. 16 | *
17 | * 18 | *19 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 20 | * amadeus.travel.analytics.airTraffic;21 | * 22 | * @hide 23 | */ 24 | public class AirTraffic { 25 | /** 26 | *
27 | * A namespaced client for the
28 | * /v1/travel/analytics/air-traffic/traveled
endpoints.
29 | *
35 | * A namespaced client for the
36 | * /v1/travel/analytics/air-traffic/booked
endpoints.
37 | *
43 | * A namespaced client for the
44 | * /v1/travel/analytics/air-traffic/busiest-period
endpoints.
45 | *
7 | * A namespaced client for the
8 | * /v1/travel/analytics
endpoints.
9 | *
12 | * Access via the Amadeus client object. 13 | *
14 | * 15 | *16 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 17 | * amadeus.travel.analytics;18 | * 19 | * @hide 20 | */ 21 | public class Analytics { 22 | /** 23 | *
24 | * A namespaced client for the
25 | * /v1/travel/analytics/air-traffics
endpoints.
26 | *
13 | * A namespaced client for the
14 | * /v1/travel/analytics/air-traffic/booked
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.travel.analytics.airTraffis.booked;24 | */ 25 | public class Booked { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public Booked(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns a list of air traffic reports. 39 | *
40 | * 41 | *42 | * amadeus.travel.analytics.airTraffic.booked.get(Params 43 | * .with("originCityCode", "LHR") 44 | * .and("period", "2017-03"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public AirTraffic[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/travel/analytics/air-traffic/booked", params); 52 | return (AirTraffic[]) Resource.fromArray(response, AirTraffic[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see Booked#get()
58 | */
59 | public AirTraffic[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/analytics/airTraffic/BusiestPeriod.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel.analytics.airtraffic;
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.Period;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/travel/analytics/air-traffic/busiest-period
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.travel.analytics.airTraffis.busiestPeriod;23 | */ 24 | public class BusiestPeriod { 25 | private Amadeus client; 26 | public static final String ARRIVING = "ARRIVING"; 27 | public static final String DEPARTING = "DEPARTING"; 28 | 29 | /** 30 | * Constructor. 31 | * @hide 32 | */ 33 | public BusiestPeriod(Amadeus client) { 34 | this.client = client; 35 | } 36 | 37 | /** 38 | *
39 | * Returns a list of busiest periods reports. 40 | *
41 | * 42 | *43 | * amadeus.travel.analytics.airTraffic.busiestPeriod.get(Params 44 | * .with("cityCode", "PAR") 45 | * .and("period", "2017"));46 | * 47 | * @param params the parameters to send to the API 48 | * @return an API response object 49 | * @throws ResponseException when an exception occurs 50 | */ 51 | public Period[] get(Params params) throws ResponseException { 52 | Response response = client.get("/v1/travel/analytics/air-traffic/busiest-period", params); 53 | return (Period[]) Resource.fromArray(response, Period[].class); 54 | } 55 | 56 | /** 57 | * Convenience method for calling
get
without any parameters.
58 | * @see Traveled#get()
59 | */
60 | public Period[] get() throws ResponseException {
61 | return get(null);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/analytics/airTraffic/Traveled.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel.analytics.airtraffic;
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.AirTraffic;
8 | import com.amadeus.resources.Resource;
9 | import com.google.gson.Gson;
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v1/travel/analytics/air-traffic/traveled
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.travel.analytics.airTraffis.traveled;24 | */ 25 | public class Traveled { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * @hide 31 | */ 32 | public Traveled(Amadeus client) { 33 | this.client = client; 34 | } 35 | 36 | /** 37 | *
38 | * Returns a list of air traffic reports. 39 | *
40 | * 41 | *42 | * amadeus.travel.analytics.airTraffic.traveled.get(Params 43 | * .with("originCityCode", "LHR") 44 | * .and("period", "2017-03"));45 | * 46 | * @param params the parameters to send to the API 47 | * @return an API response object 48 | * @throws ResponseException when an exception occurs 49 | */ 50 | public AirTraffic[] get(Params params) throws ResponseException { 51 | Response response = client.get("/v1/travel/analytics/air-traffic/traveled", params); 52 | return (AirTraffic[]) Resource.fromArray(response, AirTraffic[].class); 53 | } 54 | 55 | /** 56 | * Convenience method for calling
get
without any parameters.
57 | * @see Traveled#get()
58 | */
59 | public AirTraffic[] get() throws ResponseException {
60 | return get(null);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/predictions/FlightDelay.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel.predictions;
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.Prediction;
8 | import com.amadeus.resources.Resource;
9 |
10 | /**
11 | *
12 | * A namespaced client for the
13 | * /v1/travel/predictions/flight-delay
endpoints.
14 | *
17 | * Access via the Amadeus client object. 18 | *
19 | * 20 | *21 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 22 | * amadeus.travel.predictions.flightDelay;23 | */ 24 | public class FlightDelay { 25 | private Amadeus client; 26 | 27 | /** 28 | * Constructor. 29 | * @hide 30 | */ 31 | public FlightDelay(Amadeus client) { 32 | this.client = client; 33 | } 34 | 35 | /** 36 | *
37 | * Predicts delay of a given flight. 38 | *
39 | * 40 | *41 | * Delay[] flightDelay = amadeus.travel.predictions.flightDelay.get(Params 42 | * .with("originLocationCode", "NCE") 43 | * .and("destinationLocationCode", "IST") 44 | * .and("departureDate", "2020-08-01") 45 | * .and("departureTime", "18:20:00")) 46 | * .and("arrivalDate", "2020-08-01") 47 | * .and("arrivalTime", "22:15:00") 48 | * .and("aircraftCode", "321")) 49 | * .and("carrierCode", "TK") 50 | * .and("flightNumber", "1816") 51 | * .and("duration", "PT31H10M")); 52 | *53 | * @param params the parameters to send to the API 54 | * @return an API response object 55 | * @throws ResponseException when an exception occurs 56 | */ 57 | public Prediction[] get(Params params) throws ResponseException { 58 | Response response = client.get("/v1/travel/predictions/flight-delay", params); 59 | return (Prediction[]) Resource.fromArray(response, Prediction[].class); 60 | } 61 | 62 | /** 63 | * Convenience method for calling
get
without any parameters.
64 | * @see FlightDelay#get()
65 | */
66 | public Prediction[] get() throws ResponseException {
67 | return get(null);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/com/amadeus/travel/predictions/TripPurpose.java:
--------------------------------------------------------------------------------
1 | package com.amadeus.travel.predictions;
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.Prediction;
8 | import com.amadeus.resources.Resource;
9 |
10 |
11 | /**
12 | *
13 | * A namespaced client for the
14 | * /v1/travel/predictions/trip-purpose
endpoints.
15 | *
18 | * Access via the Amadeus client object. 19 | *
20 | * 21 | *22 | * Amadeus amadeus = Amadeus.builder("clientId", "secret").build(); 23 | * amadeus.travel.predictions.tripPurpose;24 | */ 25 | public class TripPurpose { 26 | private Amadeus client; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @hide 32 | */ 33 | public TripPurpose(Amadeus client) { 34 | this.client = client; 35 | } 36 | 37 | /** 38 | *
39 | * Returns a trip purpose prediction. 40 | *
41 | * 42 | *43 | * amadeus.travel.predictions.tripPurpose.get(Params 44 | * .with("originLocationCode", "NYC") 45 | * .and("destinationLocationCode", "MAD") 46 | * .and("departureDate", "2020-08-01") 47 | * .and("returnDate", "2020-08-12")); 48 | *49 | * 50 | * @param params the parameters to send to the API 51 | * @return an API response object 52 | * @throws ResponseException when an exception occurs 53 | */ 54 | public Prediction get(Params params) throws ResponseException { 55 | Response response = client.get("/v1/travel/predictions/trip-purpose", params); 56 | return (Prediction) Resource.fromObject(response, Prediction.class); 57 | } 58 | 59 | /** 60 | * Convenience method for calling
get
without any parameters.
61 | *
62 | * @see TripPurpose#get()
63 | */
64 | public Prediction get() throws ResponseException {
65 | return get(null);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/java/com/amadeus/AccessTokenTest.java:
--------------------------------------------------------------------------------
1 | package com.amadeus;
2 |
3 | import static org.junit.jupiter.api.Assertions.assertEquals;
4 | import static org.mockito.ArgumentMatchers.any;
5 | import static org.mockito.ArgumentMatchers.anyString;
6 | import static org.mockito.Mockito.isNull;
7 | import static org.mockito.Mockito.mock;
8 | import static org.mockito.Mockito.times;
9 | import static org.mockito.Mockito.verify;
10 | import static org.mockito.Mockito.when;
11 |
12 | import com.amadeus.client.AccessToken;
13 | import com.amadeus.exceptions.ResponseException;
14 | import com.google.gson.JsonObject;
15 | import org.junit.jupiter.api.BeforeEach;
16 | import org.junit.jupiter.api.Test;
17 |
18 | public class AccessTokenTest {
19 | Amadeus client;
20 | Configuration configuration;
21 | Response response;
22 | JsonObject json;
23 |
24 | /**
25 | * Access Token Test.
26 | */
27 | @BeforeEach public void setupClientAndResponses() throws ResponseException {
28 | client = mock(Amadeus.class);
29 | configuration = new Configuration("client_id", "client_secret");
30 | when(client.getConfiguration()).thenReturn(configuration);
31 |
32 | response = mock(Response.class);
33 | json = new JsonObject();
34 | json.addProperty("access_token", "my_token");
35 | json.addProperty("expires_in", 600);
36 | when(response.getResult()).thenReturn(json);
37 |
38 | when(client.unauthenticatedRequest(HttpVerbs.POST,
39 | "/v1/security/oauth2/token", Params
40 | .with("grant_type", "client_credentials")
41 | .and("client_id", "client_id")
42 | .and("client_secret", "client_secret"),
43 | null, null)).thenReturn(response);
44 | }
45 |
46 | @Test public void testNewToken() throws ResponseException {
47 | assertEquals(new AccessToken(client).getBearerToken(), "Bearer my_token");
48 | }
49 |
50 | @Test public void testCachedToken() throws ResponseException {
51 | AccessToken accessToken = new AccessToken(client);
52 | accessToken.getBearerToken();
53 | accessToken.getBearerToken();
54 |
55 | verify(client, times(1))
56 | .unauthenticatedRequest(any(HttpVerbs.class), anyString(),
57 | any(Params.class), isNull(), isNull());
58 | }
59 |
60 | @Test public void testExpiredToken() throws ResponseException {
61 | AccessToken accessToken = new AccessToken(client);
62 | json.addProperty("expires_in", 0);
63 |
64 | accessToken.getBearerToken();
65 | accessToken.getBearerToken();
66 |
67 | verify(client, times(2))
68 | .unauthenticatedRequest(any(HttpVerbs.class), anyString(),
69 | any(Params.class), isNull(), isNull());
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/test/java/com/amadeus/AmadeusTest.java:
--------------------------------------------------------------------------------
1 | package com.amadeus;
2 |
3 | import static org.junit.jupiter.api.Assertions.assertEquals;
4 | import static org.junit.jupiter.api.Assertions.assertNotNull;
5 | import static org.junit.jupiter.api.Assertions.assertThrows;
6 | import static org.junit.jupiter.api.Assertions.assertTrue;
7 |
8 | import java.util.HashMap;
9 | import java.util.Map;
10 | import org.junit.jupiter.api.Test;
11 |
12 | public class AmadeusTest {
13 | /**
14 | * Amadeus Test.
15 | */
16 | @Test public void testBuilder() {
17 | Configuration config = Amadeus.builder("id", "secret");
18 | assertNotNull(config,
19 | "should return a Configuration");
20 | }
21 |
22 | @Test public void testBuilderWithNullClientId() {
23 | assertThrows(IllegalArgumentException.class, () -> Amadeus.builder(null, "secret").build());
24 | }
25 |
26 | @Test public void testBuilderWithNullClientSecret() {
27 | assertThrows(IllegalArgumentException.class, () -> Amadeus.builder("client", null).build());
28 | }
29 |
30 | @Test public void testBuilderWithEnvironment() {
31 | Map