Class: DuffelAPI::Client
- Inherits:
-
Object
- Object
- DuffelAPI::Client
- Defined in:
- lib/duffel_api/client.rb
Overview
A client for accessing the Duffel API, configured with a provided access token and base URL, which provides access to API services
Constant Summary collapse
- API_VERSION =
"v1"
Instance Method Summary collapse
- #aircraft ⇒ Services::AircraftService
- #airlines ⇒ Services::AirlinesService
- #airports ⇒ Services::AirportsService
-
#initialize(access_token:, base_url: "https://api.duffel.com") ⇒ Client
constructor
Sets up the client with your access token.
- #offer_passengers ⇒ Services::OfferPassengersService
- #offer_requests ⇒ Services::OfferRequestsService
- #offers ⇒ Services::OffersService
- #order_cancellations ⇒ Services::OrderCancellationsService
- #order_change_offers ⇒ Services::OrderChangeOffersService
- #order_change_requests ⇒ Services::OrderChangeRequestsService
- #order_changes ⇒ Services::OrderChangesService
- #orders ⇒ Services::OrdersService
- #payment_intents ⇒ Services::PaymentIntentsService
- #payments ⇒ Services::PaymentsService
- #refunds ⇒ Services::RefundsService
- #seat_maps ⇒ Services::SeatMapsService
- #webhooks ⇒ Services::WebhooksService
Constructor Details
#initialize(access_token:, base_url: "https://api.duffel.com") ⇒ Client
Sets up the client with your access token
14 15 16 |
# File 'lib/duffel_api/client.rb', line 14 def initialize(access_token:, base_url: "https://api.duffel.com") @api_service = APIService.new(base_url, access_token, **) end |
Instance Method Details
#aircraft ⇒ Services::AircraftService
19 20 21 |
# File 'lib/duffel_api/client.rb', line 19 def aircraft @aircraft ||= Services::AircraftService.new(@api_service) end |
#airlines ⇒ Services::AirlinesService
24 25 26 |
# File 'lib/duffel_api/client.rb', line 24 def airlines @airlines ||= Services::AirlinesService.new(@api_service) end |
#airports ⇒ Services::AirportsService
29 30 31 |
# File 'lib/duffel_api/client.rb', line 29 def airports @airports ||= Services::AirportsService.new(@api_service) end |
#offer_passengers ⇒ Services::OfferPassengersService
34 35 36 |
# File 'lib/duffel_api/client.rb', line 34 def offer_passengers @offer_passengers ||= Services::OfferPassengersService.new(@api_service) end |
#offer_requests ⇒ Services::OfferRequestsService
39 40 41 |
# File 'lib/duffel_api/client.rb', line 39 def offer_requests @offer_requests ||= Services::OfferRequestsService.new(@api_service) end |
#offers ⇒ Services::OffersService
44 45 46 |
# File 'lib/duffel_api/client.rb', line 44 def offers @offers ||= Services::OffersService.new(@api_service) end |
#order_cancellations ⇒ Services::OrderCancellationsService
49 50 51 |
# File 'lib/duffel_api/client.rb', line 49 def order_cancellations @order_cancellations ||= Services::OrderCancellationsService.new(@api_service) end |
#order_change_offers ⇒ Services::OrderChangeOffersService
54 55 56 |
# File 'lib/duffel_api/client.rb', line 54 def order_change_offers @order_change_offers ||= Services::OrderChangeOffersService.new(@api_service) end |
#order_change_requests ⇒ Services::OrderChangeRequestsService
59 60 61 |
# File 'lib/duffel_api/client.rb', line 59 def order_change_requests @order_change_requests ||= Services::OrderChangeRequestsService.new(@api_service) end |
#order_changes ⇒ Services::OrderChangesService
64 65 66 |
# File 'lib/duffel_api/client.rb', line 64 def order_changes @order_changes ||= Services::OrderChangesService.new(@api_service) end |
#orders ⇒ Services::OrdersService
69 70 71 |
# File 'lib/duffel_api/client.rb', line 69 def orders @orders ||= Services::OrdersService.new(@api_service) end |
#payment_intents ⇒ Services::PaymentIntentsService
74 75 76 |
# File 'lib/duffel_api/client.rb', line 74 def payment_intents @payment_intents ||= Services::PaymentIntentsService.new(@api_service) end |
#payments ⇒ Services::PaymentsService
79 80 81 |
# File 'lib/duffel_api/client.rb', line 79 def payments @payments ||= Services::PaymentsService.new(@api_service) end |
#refunds ⇒ Services::RefundsService
84 85 86 |
# File 'lib/duffel_api/client.rb', line 84 def refunds @refunds ||= Services::RefundsService.new(@api_service) end |
#seat_maps ⇒ Services::SeatMapsService
89 90 91 |
# File 'lib/duffel_api/client.rb', line 89 def seat_maps @seat_maps ||= Services::SeatMapsService.new(@api_service) end |
#webhooks ⇒ Services::WebhooksService
94 95 96 |
# File 'lib/duffel_api/client.rb', line 94 def webhooks @webhooks ||= Services::WebhooksService.new(@api_service) end |