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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

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”



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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)


42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

def client_secret
  @client_secret
end

#connection_optionsHash

Returns Configure connection options for Faraday.

Returns:

  • (Hash)

    Configure connection options for Faraday

See Also:



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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)


42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

def faraday
  @faraday
end

#middlewareFaraday::Builder or Faraday::RackBuilder

Returns Configure middleware for Faraday.

Returns:

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

    Configure middleware for Faraday

See Also:



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#netrcBoolean

Returns Instruct Looker to get credentials from .netrc file.

Returns:

  • (Boolean)

    Instruct Looker to get credentials from .netrc file



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#netrc_fileString

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

Returns:

  • (String)

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



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#per_pageString

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

Returns:

  • (String)

    Configure page size for paginated results. API default: 30



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#proxyString

Returns URI for proxy server.

Returns:

  • (String)

    URI for proxy server

See Also:



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

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)


42
43
44
# File 'lib/looker-sdk/configurable.rb', line 42

def swagger
  @swagger
end

#user_agentString

Returns Configure User-Agent header for requests.

Returns:

  • (String)

    Configure User-Agent header for requests.



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

#web_endpointString

Base URL for generated web URLs

Returns:

  • (String)

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



42
43
44
45
# File 'lib/looker-sdk/configurable.rb', line 42

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

Class Method Details

.keysArray

List of configurable keys for LookerSDK::Client

Returns:

  • (Array)

    of option keys



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/looker-sdk/configurable.rb', line 52

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
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Set configuration options using a block

Yields:

  • (_self)

Yield Parameters:



77
78
79
# File 'lib/looker-sdk/configurable.rb', line 77

def configure
  yield self
end

#netrc?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/looker-sdk/configurable.rb', line 101

def netrc?
  !!@netrc
end

#reset!Object Also known as: setup

Reset configuration options to default values



82
83
84
85
86
87
# File 'lib/looker-sdk/configurable.rb', line 82

def reset!
  LookerSDK::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", LookerSDK::Default.options[key])
  end
  self
end