Module: LookerSDK::Configurable

Included in:
LookerSDK, Client
Defined in:
lib/looker-sdk/configurable.rb

Overview

Configuration options for Client, defaulting to values in Default

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def access_token
  @access_token
end

#api_endpointString

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”.

Returns:

  • (String)

    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_paginateBoolean

Returns Auto fetch next page of results until rate limit reached.

Returns:

  • (Boolean)

    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_idObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


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_secretObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def client_secret
  @client_secret
end

#connection_optionsHash

Returns Configure connection options for Faraday.

Returns:

  • (Hash)

    Configure connection options for Faraday

See Also:



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_typeObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


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

#faradayObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def faraday
  @faraday
end

#lazy_swaggerObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def lazy_swagger
  @lazy_swagger
end

#middlewareFaraday::Builder or Faraday::RackBuilder

Returns Configure middleware for Faraday.

Returns:

  • (Faraday::Builder or Faraday::RackBuilder)

    Configure middleware for Faraday

See Also:



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

#netrcBoolean

Returns Instruct Looker to get credentials from .netrc file.

Returns:

  • (Boolean)

    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_fileString

Returns Path to .netrc file. default: ~/.netrc.

Returns:

  • (String)

    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_pageString

Returns Configure page size for paginated results. API default: 30.

Returns:

  • (String)

    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

#proxyString

Returns URI for proxy server.

Returns:

  • (String)

    URI for proxy server

See Also:



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_responsesObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def raw_responses
  @raw_responses
end

#shared_swaggerObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def shared_swagger
  @shared_swagger
end

#swaggerObject

See Also:

  • TODO docs link @return [String] OAuth2 access token for authentication
  • TODO docs link @return [String] Configure OAuth app key
  • TODO docs link @return [String] Configure OAuth app secret
  • TODO docs link @return [String] Configure preferred media type (for API versioning, for example)


66
67
68
# File 'lib/looker-sdk/configurable.rb', line 66

def swagger
  @swagger
end

#user_agentString

Returns Configure User-Agent header for requests.

Returns:

  • (String)

    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_endpointString

Base URL for generated web URLs

Returns:

  • (String)

    Default: https://<client>.looker.com/ look TODO is this correct?



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

.keysArray

List of configurable keys for LookerSDK::Client

Returns:

  • (Array)

    of option keys



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

Yields:

  • (_self)

Yield Parameters:



103
104
105
# File 'lib/looker-sdk/configurable.rb', line 103

def configure
  yield self
end

#netrc?Boolean

Returns:

  • (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.options[key])
  end
  self
end