Class: Google::Ads::GoogleAds::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/google/ads/google_ads/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Config

Returns a new instance of Config.

Yields:

  • (_self)

Yield Parameters:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/google/ads/google_ads/config.rb', line 48

def initialize(&block)
  @refresh_token = nil
  @client_id = nil
  @client_secret = nil
  @keyfile = nil
  @impersonate = nil
  @authentication = nil

  @developer_token = nil
  @login_customer_id = nil
  @linked_customer_id = nil
  @use_cloud_org_for_api_access = false

  @log_level = nil
  @log_target = nil
  @logger = nil

  @treat_deprecation_warnings_as_errors = false
  @warn_on_all_deprecations = false

  @use_insecure_channel = false

  @api_endpoint = nil

  yield self if block_given?
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



46
47
48
# File 'lib/google/ads/google_ads/config.rb', line 46

def api_endpoint
  @api_endpoint
end

#authenticationObject

Returns the value of attribute authentication.



30
31
32
# File 'lib/google/ads/google_ads/config.rb', line 30

def authentication
  @authentication
end

#client_idObject

Returns the value of attribute client_id.



26
27
28
# File 'lib/google/ads/google_ads/config.rb', line 26

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



27
28
29
# File 'lib/google/ads/google_ads/config.rb', line 27

def client_secret
  @client_secret
end

#developer_tokenObject

Returns the value of attribute developer_token.



32
33
34
# File 'lib/google/ads/google_ads/config.rb', line 32

def developer_token
  @developer_token
end

#impersonateObject

Returns the value of attribute impersonate.



29
30
31
# File 'lib/google/ads/google_ads/config.rb', line 29

def impersonate
  @impersonate
end

#keyfileObject

Returns the value of attribute keyfile.



28
29
30
# File 'lib/google/ads/google_ads/config.rb', line 28

def keyfile
  @keyfile
end

#linked_customer_idObject

Returns the value of attribute linked_customer_id.



34
35
36
# File 'lib/google/ads/google_ads/config.rb', line 34

def linked_customer_id
  @linked_customer_id
end

#log_levelObject

Returns the value of attribute log_level.



37
38
39
# File 'lib/google/ads/google_ads/config.rb', line 37

def log_level
  @log_level
end

#log_targetObject

Returns the value of attribute log_target.



38
39
40
# File 'lib/google/ads/google_ads/config.rb', line 38

def log_target
  @log_target
end

#loggerObject

Returns the value of attribute logger.



39
40
41
# File 'lib/google/ads/google_ads/config.rb', line 39

def logger
  @logger
end

#login_customer_idObject

Returns the value of attribute login_customer_id.



33
34
35
# File 'lib/google/ads/google_ads/config.rb', line 33

def 
  @login_customer_id
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



25
26
27
# File 'lib/google/ads/google_ads/config.rb', line 25

def refresh_token
  @refresh_token
end

#treat_deprecation_warnings_as_errorsObject

Returns the value of attribute treat_deprecation_warnings_as_errors.



41
42
43
# File 'lib/google/ads/google_ads/config.rb', line 41

def treat_deprecation_warnings_as_errors
  @treat_deprecation_warnings_as_errors
end

#use_cloud_org_for_api_accessObject

Returns the value of attribute use_cloud_org_for_api_access.



35
36
37
# File 'lib/google/ads/google_ads/config.rb', line 35

def use_cloud_org_for_api_access
  @use_cloud_org_for_api_access
end

#use_insecure_channelObject

Returns the value of attribute use_insecure_channel.



44
45
46
# File 'lib/google/ads/google_ads/config.rb', line 44

def use_insecure_channel
  @use_insecure_channel
end

#warn_on_all_deprecationsObject

Returns the value of attribute warn_on_all_deprecations.



42
43
44
# File 'lib/google/ads/google_ads/config.rb', line 42

def warn_on_all_deprecations
  @warn_on_all_deprecations
end

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



75
76
77
# File 'lib/google/ads/google_ads/config.rb', line 75

def configure(&block)
  yield self
end

#http_proxyObject



93
94
95
# File 'lib/google/ads/google_ads/config.rb', line 93

def http_proxy
  ENV["http_proxy"]
end

#http_proxy=(uri) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/google/ads/google_ads/config.rb', line 79

def http_proxy=(uri)
  if uri.nil?
    ENV["http_proxy"] = nil
    return
  end

  u = URI.parse(uri)
  if u.scheme != "http" && u.scheme != "https"
    raise ArgumentError, "#{uri} has invalid scheme #{u.scheme}, should be http or https"
  end

  ENV["http_proxy"] = uri
end