Module: LookerSDK::Configurable
Overview
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#api_endpoint ⇒ String
Base URL for API requests.
-
#auto_paginate ⇒ Boolean
Auto fetch next page of results until rate limit reached.
- #client_id ⇒ Object
- #client_secret ⇒ Object
-
#connection_options ⇒ Hash
Configure connection options for Faraday.
- #default_media_type ⇒ Object
- #faraday ⇒ Object
- #lazy_swagger ⇒ Object
-
#middleware ⇒ Faraday::Builder or Faraday::RackBuilder
Configure middleware for Faraday.
-
#netrc ⇒ Boolean
Instruct Looker to get credentials from .netrc file.
-
#netrc_file ⇒ String
Path to .netrc file.
-
#per_page ⇒ String
Configure page size for paginated results.
-
#proxy ⇒ String
URI for proxy server.
- #raw_responses ⇒ Object
- #shared_swagger ⇒ Object
- #swagger ⇒ Object
-
#user_agent ⇒ String
Configure User-Agent header for requests.
-
#web_endpoint ⇒ String
Base URL for generated web URLs.
Class Method Summary collapse
-
.keys ⇒ Array
List of configurable keys for Client.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
- #netrc? ⇒ Boolean
-
#reset! ⇒ Object
(also: #setup)
Reset configuration options to default values.
Instance Attribute Details
#access_token ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def access_token @access_token end |
#api_endpoint ⇒ String
Returns Base URL for API requests. default: api.looker.com/ look TODO: this is the wrong url… what’s the right one? Also update all other references to “api.looker.com”.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#auto_paginate ⇒ Boolean
Returns Auto fetch next page of results until rate limit reached.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#client_id ⇒ Object
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#client_secret ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def client_secret @client_secret end |
#connection_options ⇒ Hash
Returns Configure connection options for Faraday.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#default_media_type ⇒ Object
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#faraday ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def faraday @faraday end |
#lazy_swagger ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def lazy_swagger @lazy_swagger end |
#middleware ⇒ Faraday::Builder or Faraday::RackBuilder
Returns Configure middleware for Faraday.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#netrc ⇒ Boolean
Returns Instruct Looker to get credentials from .netrc file.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#netrc_file ⇒ String
Returns Path to .netrc file. default: ~/.netrc.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#per_page ⇒ String
Returns Configure page size for paginated results. API default: 30.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#proxy ⇒ String
Returns URI for proxy server.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#raw_responses ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def raw_responses @raw_responses end |
#shared_swagger ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def shared_swagger @shared_swagger end |
#swagger ⇒ Object
66 67 68 |
# File 'lib/looker-sdk/configurable.rb', line 66 def swagger @swagger end |
#user_agent ⇒ String
Returns Configure User-Agent header for requests.
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
#web_endpoint ⇒ String
Base URL for generated web URLs
66 67 68 69 70 |
# File 'lib/looker-sdk/configurable.rb', line 66 attr_accessor :access_token, :auto_paginate, :client_id, :client_secret, :default_media_type, :connection_options, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :swagger, :shared_swagger, :raw_responses, :lazy_swagger |
Class Method Details
.keys ⇒ Array
List of configurable keys for LookerSDK::Client
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/looker-sdk/configurable.rb', line 77 def keys @keys ||= [ :access_token, :api_endpoint, :auto_paginate, :client_id, :client_secret, :connection_options, :default_media_type, :middleware, :netrc, :netrc_file, :per_page, :proxy, :user_agent, :faraday, :shared_swagger, :swagger, :raw_responses, :web_endpoint, :lazy_swagger, ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
103 104 105 |
# File 'lib/looker-sdk/configurable.rb', line 103 def configure yield self end |
#netrc? ⇒ Boolean
127 128 129 |
# File 'lib/looker-sdk/configurable.rb', line 127 def netrc? !!@netrc end |
#reset! ⇒ Object Also known as: setup
Reset configuration options to default values
108 109 110 111 112 113 |
# File 'lib/looker-sdk/configurable.rb', line 108 def reset! LookerSDK::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", LookerSDK::Default.[key]) end self end |