Module: LookerSDK::Default
- Defined in:
- lib/looker-sdk/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- API_ENDPOINT =
Default API endpoint look TODO update this as needed
"https://localhost:19999/api/3.0/".freeze
- USER_AGENT =
Default User Agent header string
"Looker Ruby Gem #{LookerSDK::VERSION}".freeze
- MEDIA_TYPE =
Default media type
"application/json"
- WEB_ENDPOINT =
Default WEB endpoint
"https://localhost:9999".freeze
- RACK_BUILDER_CLASS =
In Faraday 0.9, Faraday::Builder was renamed to Faraday::RackBuilder
defined?(Faraday::RackBuilder) ? Faraday::RackBuilder : Faraday::Builder
- MIDDLEWARE =
Default Faraday middleware stack
RACK_BUILDER_CLASS.new do |builder| builder.use LookerSDK::Response::RaiseError builder.adapter Faraday.default_adapter end
Class Method Summary collapse
-
.access_token ⇒ String
Default access token from ENV.
-
.api_endpoint ⇒ String
Default API endpoint from ENV or API_ENDPOINT.
-
.auto_paginate ⇒ String
Default pagination preference from ENV.
-
.client_id ⇒ String
Default OAuth app key from ENV.
-
.client_secret ⇒ String
Default OAuth app secret from ENV.
-
.connection_options ⇒ Hash
Default options for Faraday::Connection.
-
.default_media_type ⇒ String
Default media type from ENV or MEDIA_TYPE.
- .faraday ⇒ Object
-
.lazy_swagger ⇒ Boolean
Default behavior for loading swagger during initialization or at first call.
-
.middleware ⇒ String
Default middleware stack for Faraday::Connection from MIDDLEWARE.
-
.netrc ⇒ Boolean
Default behavior for reading .netrc file.
-
.netrc_file ⇒ String
Default path for .netrc file.
-
.options ⇒ Hash
Configuration options.
-
.per_page ⇒ Fixnum
Default pagination page size from ENV.
-
.proxy ⇒ String
Default proxy server URI for Faraday connection from ENV.
- .raw_responses ⇒ Object
- .shared_swagger ⇒ Object
- .swagger ⇒ Object
-
.user_agent ⇒ String
Default User-Agent header string from ENV or USER_AGENT.
-
.web_endpoint ⇒ String
Default web endpoint from ENV or WEB_ENDPOINT.
Class Method Details
.access_token ⇒ String
Default access token from ENV
64 65 66 |
# File 'lib/looker-sdk/default.rb', line 64 def access_token ENV['LOOKER_ACCESS_TOKEN'] end |
.api_endpoint ⇒ String
Default API endpoint from ENV or API_ENDPOINT
70 71 72 |
# File 'lib/looker-sdk/default.rb', line 70 def api_endpoint ENV['LOOKER_API_ENDPOINT'] || API_ENDPOINT end |
.auto_paginate ⇒ String
Default pagination preference from ENV
76 77 78 |
# File 'lib/looker-sdk/default.rb', line 76 def auto_paginate ENV['LOOKER_AUTO_PAGINATE'] end |
.client_id ⇒ String
Default OAuth app key from ENV
82 83 84 |
# File 'lib/looker-sdk/default.rb', line 82 def client_id ENV['LOOKER_CLIENT_ID'] end |
.client_secret ⇒ String
Default OAuth app secret from ENV
88 89 90 |
# File 'lib/looker-sdk/default.rb', line 88 def client_secret ENV['LOOKER_SECRET'] end |
.connection_options ⇒ Hash
Default options for Faraday::Connection
94 95 96 97 98 99 100 101 |
# File 'lib/looker-sdk/default.rb', line 94 def { :headers => { :accept => default_media_type, :user_agent => user_agent } } end |
.default_media_type ⇒ String
Default media type from ENV or MEDIA_TYPE
105 106 107 |
# File 'lib/looker-sdk/default.rb', line 105 def default_media_type ENV['LOOKER_DEFAULT_MEDIA_TYPE'] || MEDIA_TYPE end |
.faraday ⇒ Object
116 117 118 |
# File 'lib/looker-sdk/default.rb', line 116 def faraday nil end |
.lazy_swagger ⇒ Boolean
Default behavior for loading swagger during initialization or at first call
130 131 132 |
# File 'lib/looker-sdk/default.rb', line 130 def lazy_swagger false end |
.middleware ⇒ String
Default middleware stack for Faraday::Connection from MIDDLEWARE
112 113 114 |
# File 'lib/looker-sdk/default.rb', line 112 def middleware MIDDLEWARE end |
.netrc ⇒ Boolean
Default behavior for reading .netrc file
166 167 168 |
# File 'lib/looker-sdk/default.rb', line 166 def netrc ENV['LOOKER_NETRC'] || false end |
.netrc_file ⇒ String
Default path for .netrc file
172 173 174 |
# File 'lib/looker-sdk/default.rb', line 172 def netrc_file ENV['LOOKER_NETRC_FILE'] || File.join(ENV['HOME'].to_s, '.netrc') end |
.options ⇒ Hash
Configuration options
58 59 60 |
# File 'lib/looker-sdk/default.rb', line 58 def Hash[LookerSDK::Configurable.keys.map{|key| [key, send(key)]}] end |
.per_page ⇒ Fixnum
Default pagination page size from ENV
140 141 142 143 144 |
# File 'lib/looker-sdk/default.rb', line 140 def per_page page_size = ENV['LOOKER_PER_PAGE'] page_size.to_i if page_size end |
.proxy ⇒ String
Default proxy server URI for Faraday connection from ENV
148 149 150 |
# File 'lib/looker-sdk/default.rb', line 148 def proxy ENV['LOOKER_PROXY'] end |
.raw_responses ⇒ Object
134 135 136 |
# File 'lib/looker-sdk/default.rb', line 134 def raw_responses false end |
.shared_swagger ⇒ Object
124 125 126 |
# File 'lib/looker-sdk/default.rb', line 124 def shared_swagger false end |
.swagger ⇒ Object
120 121 122 |
# File 'lib/looker-sdk/default.rb', line 120 def swagger nil end |
.user_agent ⇒ String
Default User-Agent header string from ENV or USER_AGENT
154 155 156 |
# File 'lib/looker-sdk/default.rb', line 154 def user_agent ENV['LOOKER_USER_AGENT'] || USER_AGENT end |
.web_endpoint ⇒ String
Default web endpoint from ENV or WEB_ENDPOINT
160 161 162 |
# File 'lib/looker-sdk/default.rb', line 160 def web_endpoint ENV['LOOKER_WEB_ENDPOINT'] || WEB_ENDPOINT end |