google-ads-googleads 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 472e4ffd57de2e62dbb2b83ebc0358b73de5caa2722dc26806a5f6759d95966f
4
- data.tar.gz: 719ad3264e1e22ca184a139a662996730aedc2ad4a6588b59ad0a736587baed7
3
+ metadata.gz: acdbcc60bc0cc8bac0e6bde7ffccd079a9493eb5af1dad50d1f4ec03a8492b26
4
+ data.tar.gz: 776f9a06b923d43c267343ea008bf8354390bfb87e6185d1e1db88b8c4afac96
5
5
  SHA512:
6
- metadata.gz: bf5f0074ad68a985b83c417fecbdb0f4bbac848c86367c31abd2bb7a69f01c7aea04581d4857bd002a44ada4cda8abefcb6d56edd0e51d6440127318e8ba6dbf
7
- data.tar.gz: 374002fcfe8bb1f3c522f4f3173798e210069940d8d8c6f8dccd8fd64c703f575b57b1ff68aad3f94a2dd688104462f8125831c9abe8b0a5ad9fce4eacdaa5ed
6
+ metadata.gz: b43368237848284c9cefb6e57d5abd6ee221217e0905b79fbfea68499766bec3f0798205f9eaef79bf453b3becc0effbaa6078e0ba6e5e31591413830c4043d1
7
+ data.tar.gz: 8a75307ecac6158de3042f705e1d4d9026b1b3d8ff2f87ab24dabe3f3933f343d031dc093da4425c7eb33a381f2e625f6ccd244227fb517f48e9b9d260f6e3b7
data/ChangeLog CHANGED
@@ -1,3 +1,5 @@
1
+ 3.0.1:
2
+ - Add an insecure channel config flag
1
3
  3.0.0:
2
4
  - Compatability with v2 of the API: https://developers.google.com/google-ads/api/docs/release-notes
3
5
  - Removed the symbol based lookup util, favoring a method based one:
@@ -39,6 +39,8 @@ module Google
39
39
  attr_accessor :treat_deprecation_warnings_as_errors
40
40
  attr_accessor :warn_on_all_deprecations
41
41
 
42
+ attr_accessor :use_insecure_channel
43
+
42
44
  def initialize(&block)
43
45
  @refresh_token = nil
44
46
  @client_id = nil
@@ -58,6 +60,8 @@ module Google
58
60
  @treat_deprecation_warnings_as_errors = false
59
61
  @warn_on_all_deprecations = false
60
62
 
63
+ @use_insecure_channel = false
64
+
61
65
  yield self if block_given?
62
66
  end
63
67
 
@@ -155,9 +155,13 @@ module Google
155
155
  MAX_METADATA_SIZE => 16*1024*1024,
156
156
  }
157
157
 
158
- call_creds = GRPC::Core::CallCredentials.new(get_credentials)
159
- chan_creds = GRPC::Core::ChannelCredentials.new.compose(call_creds)
160
- GRPC::Core::Channel.new(target, channel_args, chan_creds)
158
+ if !@config.use_insecure_channel
159
+ call_creds = GRPC::Core::CallCredentials.new(get_credentials)
160
+ chan_creds = GRPC::Core::ChannelCredentials.new.compose(call_creds)
161
+ GRPC::Core::Channel.new(target, channel_args, chan_creds)
162
+ else
163
+ GRPC::Core::Channel.new(target, channel_args, :this_channel_is_insecure)
164
+ end
161
165
  end
162
166
 
163
167
  def patch_lro_headers(class_to_return, headers)
@@ -80,17 +80,20 @@ module Google
80
80
  begin
81
81
  gax_error.status_details.each do |detail|
82
82
  # If there is an underlying GoogleAdsFailure, throw that one.
83
- if detail.is_a?(
84
- Google::Ads::GoogleAds::V1::Errors::GoogleAdsFailure)
83
+ if detail.class.name.start_with?("Google::Ads::GoogleAds") &&
84
+ detail.class.name.end_with?("GoogleAdsFailure")
85
85
  raise Google::Ads::GoogleAds::Errors::GoogleAdsError.new(
86
- detail)
87
- end
88
- if detail.is_a?(Google::Protobuf::Any)
86
+ detail
87
+ )
88
+ elsif detail.is_a?(Google::Protobuf::Any)
89
89
  type = Google::Protobuf::DescriptorPool.generated_pool.lookup(
90
- detail.type_name).msgclass
90
+ detail.type_name
91
+ ).msgclass
91
92
  failure = detail.unpack(type)
93
+
92
94
  raise Google::Ads::GoogleAds::Errors::GoogleAdsError.new(
93
- failure)
95
+ failure
96
+ )
94
97
  end
95
98
  end
96
99
  rescue Google::Ads::GoogleAds::Errors::GoogleAdsError
@@ -19,7 +19,7 @@
19
19
  module Google
20
20
  module Ads
21
21
  module GoogleAds
22
- CLIENT_LIB_VERSION = '3.0.0'.freeze
22
+ CLIENT_LIB_VERSION = '3.0.1'.freeze
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-googleads
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax