google-ads-data_manager 0.4.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 411bc95b43c1419004d058753f6ce234b1f8fcb3e2bccbc5013bcee1977eed25
4
- data.tar.gz: 988cc6b67502e059c942f01e4fcc47dee10d264940394401c5e2eaee956519b5
3
+ metadata.gz: f005d74a790d7ca6e5e80eef96b4b6b3642b82b1093d2700ca059a9abc819682
4
+ data.tar.gz: 0bac610d4a429e729c67e6fa58fc82821416ed475aa967130d1fcaefdcdaa725
5
5
  SHA512:
6
- metadata.gz: 5dc9ca7609300d34fb89c923eaea4d117fca7785b481d55a7dcb2466cd896fa87715a3c69701558a6ca678a9f16b34d0e6937115cafc91100b73f18e4f4a48da
7
- data.tar.gz: 40c757535c1a306033e534e3ff12f82890ec7166b89088b510b700d6fc2453493d8c5ca97f52be01713a43e73385c14d42a7505a67bad3dc2913b69082e75694
6
+ metadata.gz: 4659ac2eaeedf858c020528ae5d76d069bc9867a9568804370c8c9471e1f2ef544c6cdccdb8c934bd2d3c51e658d5223bbe81e0ed6d23f39b4b4bedccc47d83f
7
+ data.tar.gz: 1b07a868382ef88f14509c2005a30bcad9760324fd42ff7c3c354a2f326f5596bbc2c58997133f6e02a52f9b76d9082b8fd53b0cb86b3fce3383fd02126fa725
data/README.md CHANGED
@@ -75,12 +75,10 @@ working, try updating the versioned clients in your bundle or installed gems:
75
75
 
76
76
  This library is supported on Ruby 3.2+.
77
77
 
78
- Google provides official support for Ruby versions that are actively supported
79
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or
80
- in security maintenance, and not end of life. Older versions of Ruby _may_
81
- still work, but are unsupported and not recommended. See
82
- https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
83
- support schedule.
78
+ Google provides official support for Ruby versions as described in the
79
+ [Supported Ruby versions](https://docs.cloud.google.com/ruby/getting-started/supported-ruby-versions)
80
+ policy. Older versions of Ruby _may_ still work, but are unsupported and not
81
+ recommended.
84
82
 
85
83
  ## Which client should I use?
86
84
 
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Ads
22
22
  module DataManager
23
- VERSION = "0.4.2"
23
+ VERSION = "0.6.0"
24
24
  end
25
25
  end
26
26
  end
@@ -239,6 +239,76 @@ module Google
239
239
  false
240
240
  end
241
241
 
242
+ ##
243
+ # Create a new client object for ReportingService.
244
+ #
245
+ # By default, this returns an instance of
246
+ # [Google::Ads::DataManager::V1::ReportingService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/ReportingService/Client)
247
+ # for a gRPC client for version V1 of the API.
248
+ # However, you can specify a different API version by passing it in the
249
+ # `version` parameter. If the ReportingService service is
250
+ # supported by that API version, and the corresponding gem is available, the
251
+ # appropriate versioned client will be returned.
252
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
253
+ # the `transport` parameter.
254
+ #
255
+ # Raises an exception if the currently installed versioned client gem for the
256
+ # given API version does not support the given transport of the ReportingService service.
257
+ # You can determine whether the method will succeed by calling
258
+ # {Google::Ads::DataManager.reporting_service_available?}.
259
+ #
260
+ # ## About ReportingService
261
+ #
262
+ # Service for querying reports.
263
+ #
264
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
265
+ # Defaults to `:v1`.
266
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
267
+ # @return [::Object] A client object for the specified version.
268
+ #
269
+ def self.reporting_service version: :v1, transport: :grpc, &block
270
+ require "google/ads/data_manager/#{version.to_s.downcase}"
271
+
272
+ package_name = Google::Ads::DataManager
273
+ .constants
274
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
275
+ .first
276
+ service_module = Google::Ads::DataManager.const_get(package_name).const_get(:ReportingService)
277
+ service_module = service_module.const_get(:Rest) if transport == :rest
278
+ service_module.const_get(:Client).new(&block)
279
+ end
280
+
281
+ ##
282
+ # Determines whether the ReportingService service is supported by the current client.
283
+ # If true, you can retrieve a client object by calling {Google::Ads::DataManager.reporting_service}.
284
+ # If false, that method will raise an exception. This could happen if the given
285
+ # API version does not exist or does not support the ReportingService service,
286
+ # or if the versioned client gem needs an update to support the ReportingService service.
287
+ #
288
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
289
+ # Defaults to `:v1`.
290
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
291
+ # @return [boolean] Whether the service is available.
292
+ #
293
+ def self.reporting_service_available? version: :v1, transport: :grpc
294
+ require "google/ads/data_manager/#{version.to_s.downcase}"
295
+ package_name = Google::Ads::DataManager
296
+ .constants
297
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
298
+ .first
299
+ return false unless package_name
300
+ service_module = Google::Ads::DataManager.const_get package_name
301
+ return false unless service_module.const_defined? :ReportingService
302
+ service_module = service_module.const_get :ReportingService
303
+ if transport == :rest
304
+ return false unless service_module.const_defined? :Rest
305
+ service_module = service_module.const_get :Rest
306
+ end
307
+ service_module.const_defined? :Client
308
+ rescue ::LoadError
309
+ false
310
+ end
311
+
242
312
  ##
243
313
  # Create a new client object for UserListDirectLicenseService.
244
314
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-data_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC