Exemplo n.º 1
0
        /// <summary>
        /// <para>
        ///   Returns details for a specific offer.
        /// </para>
        ///
        /// <pre>
        /// amadeus.shopping.HotelOffer("XXX").get();</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.HotelOffer get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual Afonsoft.Amadeus.Resources.HotelOffer Get(Params @params)
        {
            string   path     = string.Format("/v2/shopping/hotel-offers/{0}", offerId);
            Response response = client.Get(path, @params);

            return((Afonsoft.Amadeus.Resources.HotelOffer)Resource.FromObject(response, typeof(Afonsoft.Amadeus.Resources.HotelOffer)));
        }
Exemplo n.º 2
0
        /// <summary>
        /// <para>
        ///   Returns details for a specific airport.
        /// </para>
        ///
        /// <pre>
        /// amadeus.referenceData.locations("ALHR').get();</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual Afonsoft.Amadeus.Resources.Location Get(Params @params)
        {
            string   path     = string.Format("/v1/reference-data/locations/{0}", locationId);
            Response response = client.Get(path, @params);

            return((Afonsoft.Amadeus.Resources.Location)Resource.FromObject(response, typeof(Afonsoft.Amadeus.Resources.Location)));
        }
Exemplo n.º 3
0
        public Response GetFlightsFromAmadeus(Search search)
        {
            Amadeus amadeus = Amadeus.Builder(Settings.Default.clientId, Settings.Default.clientSecret).Build();

            Response response = amadeus.Get("/v1/shopping/flight-offers", Params
                                            .With("origin", search.AirportFrom.Iata)
                                            .And("destination", search.AirportTo.Iata)
                                            .And("departureDate", search.DepartureDate.ToString("yyyy-MM-dd"))
                                            .And("returnDate", search.ReturnDate.ToString("yyyy-MM-dd"))
                                            .And("currency", search.Currency.Code)
                                            .And("adults", search.NumOfPassengers));

            return(response);
        }
        /// <summary>
        /// <para>
        ///   Find the cheapest destinations where
        ///   you can fly to.
        /// </para>
        ///
        /// <pre>
        /// amadeus.shopping.flightDestinations.get(Params
        ///   .with("origin", "LHR"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.FlightDestination[] get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual FlightDestination[] Get(Params @params)
        {
            Response response = client.Get("/v1/shopping/flight-destinations", @params);

            return((FlightDestination[])Resource.FromArray(response, typeof(FlightDestination[])));
        }
Exemplo n.º 5
0
        /// <summary>
        /// <para>
        ///   Returns a list of relevant point of interests within a square defined by
        ///   cardinal points.
        /// </para>
        ///
        /// <pre>
        /// amadeus.referenceData.locations.pointsOfInterest.bySquare.get(Params
        ///   .with("north", 41.397158)
        ///   .and("west", 2.160873)
        ///   .and("south", 41.394582)
        ///   .and("east", 2.177181));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.PointOfInterest[] get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual PointOfInterest[] Get(Params @params)
        {
            Response response = client.Get("/v1/reference-data/locations/pois/by-square", @params);

            return((PointOfInterest[])Resource.FromArray(response, typeof(PointOfInterest[])));
        }
Exemplo n.º 6
0
        /// <summary>
        /// <para>
        ///   Returns a list of airports and cities matching a given keyword.
        /// </para>
        ///
        /// <pre>
        /// amadeus.referenceData.locations.Get(Params
        ///   .with("keyword", "lon)
        ///   .and("subType", Locations.ANY));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual Afonsoft.Amadeus.Resources.Location[] Get(Params @params)
        {
            Response response = client.Get("/v1/reference-data/locations", @params);

            return((Afonsoft.Amadeus.Resources.Location[])Resource.FromArray(response, typeof(Afonsoft.Amadeus.Resources.Location[])));
        }
Exemplo n.º 7
0
        /// <summary>
        /// <para>
        ///   Returns the checkin links for an airline, for the
        ///   language of your choice.
        /// </para>
        ///
        /// <pre>
        /// amadeus.referenceData.urls.checkinLinks.get(Params.with("airlineCode", "BA"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API resource </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual CheckinLink[] Get(Params @params)
        {
            Response response = client.Get("/v2/reference-data/urls/checkin-links", @params);

            return((CheckinLink[])Resource.FromArray(response, typeof(PointOfInterest[])));
        }
Exemplo n.º 8
0
        /// <summary>
        /// <para>
        ///   Returns a list of busiest periods reports.
        /// </para>
        ///
        /// <pre>
        /// amadeus.travel.analytics.airTraffic.busiestPeriod.get(Params
        ///   .with("cityCode", "PAR")
        ///   .and("period", "2017"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual Period[] Get(Params @params)
        {
            Response response = client.Get("/v1/travel/analytics/air-traffic/busiest-period", @params);

            return((Period[])Resource.FromArray(response, typeof(Period[])));
        }
Exemplo n.º 9
0
        /// <summary>
        /// <para>
        ///   Search for hotels and retrieve availability and rates information.
        /// </para>
        ///
        /// <pre>
        /// amadeus.shopping.hotelOffers.get(Params
        ///   .with("cityCode", "PAR"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.HotelOffer[] get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual Afonsoft.Amadeus.Resources.HotelOffer[] Get(Params @params)
        {
            Response response = client.Get("/v2/shopping/hotel-offers", @params);

            return((Afonsoft.Amadeus.Resources.HotelOffer[])Resource.FromArray(response, typeof(Afonsoft.Amadeus.Resources.HotelOffer[])));
        }
Exemplo n.º 10
0
        /// <summary>
        /// <para>
        ///   Returns a list of air traffic reports.
        /// </para>
        ///
        /// <pre>
        /// amadeus.travel.analytics.airTraffic.traveled.get(Params
        ///   .with("originCityCode", "LHR")
        ///   .and("period", "2017-03"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.AirTraffic[] get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual Afonsoft.Amadeus.Resources.AirTraffic[] Get(Params @params)
        {
            Response response = client.Get("/v1/travel/analytics/air-traffic/traveled", @params);

            return((Afonsoft.Amadeus.Resources.AirTraffic[])Resource.FromArray(response, typeof(Afonsoft.Amadeus.Resources.AirTraffic[])));
        }
Exemplo n.º 11
0
        /// <summary>
        /// <para>
        ///  Returns the airline name and code.
        /// </para>
        ///
        /// <pre>
        /// amadeus.referenceData.airlines.Get(Params
        ///   .with("airlineCodes", "BA"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual Airline[] Get(Params @params)
        {
            Response response = client.Get("/v1/reference-data/airlines", @params);

            return((Airline[])Resource.FromArray(response, typeof(Airline[])));
        }
Exemplo n.º 12
0
        /// <summary>
        /// <para>
        ///   Get all offers for a dedicated hotel.
        /// </para>
        ///
        /// <pre>
        /// amadeus.shopping.HotelOffersByHotel.get(Params
        ///   .with("hotelId", "XKPARC12"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>

        //public com.amadeus.resources.HotelOffer get(com.amadeus.Params params) throws com.amadeus.exceptions.ResponseException
        public virtual Afonsoft.Amadeus.Resources.HotelOffer Get(Params @params)
        {
            Response response = client.Get("/v2/shopping/hotel-offers/by-hotel", @params);

            return((Afonsoft.Amadeus.Resources.HotelOffer)Resource.FromObject(response, typeof(Afonsoft.Amadeus.Resources.HotelOffer)));
        }
        /// <summary>
        /// <para>
        /// Returns a air traffic report based on the number of searches.
        /// </para>
        ///
        /// <pre>
        /// amadeus.travel.analytics.airTraffic.searchedByDestination.get(Params
        ///   .with("originCityCode", "MAD")
        ///   .and("destinationCityCode", "NYC")
        ///   .and("searchPeriod", "2017-08")
        ///   .and("marketCountryCode", "ES"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual SearchedDestination Get(Params @params)
        {
            Response response = client.Get("/v1/travel/analytics/air-traffic/searched/by-destination", @params);

            return((SearchedDestination)Resource.FromObject(response, typeof(SearchedDestination)));
        }
Exemplo n.º 14
0
        /// <summary>
        /// <para>
        /// Returns a list of air traffic reports based on the number of searches.
        /// </para>
        ///
        /// <pre>
        /// amadeus.travel.analytics.airTraffic.searched.get(Params
        ///   .with("originCityCode", "MAD")
        ///   .and("searchPeriod", "2017-08")
        ///   .and("marketCountryCode", "ES"));</pre>
        /// </summary>
        /// <param name="params"> the parameters to send to the API </param>
        /// <returns> an API response object </returns>
        /// <exception cref="ResponseException"> when an exception occurs </exception>
        public virtual Search[] Get(Params @params)
        {
            Response response = client.Get("/v1/travel/analytics/air-traffic/searched", @params);

            return((Search[])Resource.FromArray(response, typeof(Search[])));
        }