Class: Amadeus::Client
- Inherits:
-
Object
- Object
- Amadeus::Client
- Includes:
- HTTP, Pagination, Namespaces
- Defined in:
- lib/amadeus/client.rb,
lib/amadeus/client/http.rb,
lib/amadeus/client/decorator.rb,
lib/amadeus/client/validator.rb,
lib/amadeus/client/pagination.rb,
lib/amadeus/client/access_token.rb
Overview
The Amadeus client library for accessing the travel APIs
Defined Under Namespace
Modules: HTTP, Pagination
Constant Summary collapse
- HOSTS =
The available hosts for this API
{ test: 'test.api.amadeus.com', production: 'api.amadeus.com' }.freeze
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
The API key used to authenticate against the API.
-
#client_secret ⇒ Object
readonly
The API secret used to authenticate against the API.
-
#custom_app_id ⇒ Object
readonly
A custom App ID to be passed in the User Agent to the server.
-
#custom_app_version ⇒ Object
readonly
A custom App version to be passed in the User Agent to the server.
-
#host ⇒ Object
readonly
The host domain used to make API calls against.
-
#hostname ⇒ Object
readonly
The short name of the host used to make API calls against.
-
#http ⇒ Object
readonly
The Net:HTTP compatible HTTP client in use.
-
#log_level ⇒ Object
readonly
If this client is running in debug, warn, or silent mode.
-
#logger ⇒ Object
readonly
The logger used to output warnings and debug messages.
-
#port ⇒ Object
readonly
The port to connect to, if not the default 443.
-
#ssl ⇒ Object
readonly
Wether to use HTTPS to connect.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Initialize using your credentials:.
Methods included from Namespaces
#reference_data, #shopping, #travel
Methods included from Pagination
#first, #last, #next, #previous
Methods included from HTTP
Constructor Details
#initialize(options = {}) ⇒ Client
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/amadeus/client.rb', line 78 def initialize( = {}) initialize_client_credentials() initialize_logger() initialize_host() initialize_custom_app() initialize_http() = %i[client_id client_secret logger host hostname custom_app_id custom_app_version http log_level ssl port] (, logger, ) end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
The API key used to authenticate against the API
19 20 21 |
# File 'lib/amadeus/client.rb', line 19 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
The API secret used to authenticate against the API
21 22 23 |
# File 'lib/amadeus/client.rb', line 21 def client_secret @client_secret end |
#custom_app_id ⇒ Object (readonly)
A custom App ID to be passed in the User Agent to the server
35 36 37 |
# File 'lib/amadeus/client.rb', line 35 def custom_app_id @custom_app_id end |
#custom_app_version ⇒ Object (readonly)
A custom App version to be passed in the User Agent to the server
37 38 39 |
# File 'lib/amadeus/client.rb', line 37 def custom_app_version @custom_app_version end |
#host ⇒ Object (readonly)
The host domain used to make API calls against
29 30 31 |
# File 'lib/amadeus/client.rb', line 29 def host @host end |
#hostname ⇒ Object (readonly)
The short name of the host used to make API calls against
27 28 29 |
# File 'lib/amadeus/client.rb', line 27 def hostname @hostname end |
#http ⇒ Object (readonly)
The Net:HTTP compatible HTTP client in use
39 40 41 |
# File 'lib/amadeus/client.rb', line 39 def http @http end |
#log_level ⇒ Object (readonly)
If this client is running in debug, warn, or silent mode
25 26 27 |
# File 'lib/amadeus/client.rb', line 25 def log_level @log_level end |
#logger ⇒ Object (readonly)
The logger used to output warnings and debug messages
23 24 25 |
# File 'lib/amadeus/client.rb', line 23 def logger @logger end |
#port ⇒ Object (readonly)
The port to connect to, if not the default 443
33 34 35 |
# File 'lib/amadeus/client.rb', line 33 def port @port end |
#ssl ⇒ Object (readonly)
Wether to use HTTPS to connect
31 32 33 |
# File 'lib/amadeus/client.rb', line 31 def ssl @ssl end |