google-shopping-merchant-reports 0.3.0 → 0.4.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: 6808b1c8bbc385a498e8d03f59888b108cc94d989f6ed1111fb1a72ee9cdd254
4
- data.tar.gz: 70191d9dc1e2bc20d5bf9763433c176de64af799055404d3a81371cdfbec8751
3
+ metadata.gz: 00cde6bdfb77c31201821bd9a955883f628bb11c1f8cdca7aa52973e8b3b411b
4
+ data.tar.gz: eeb00397753eaedc8e798766cccbdd085a25c7146242e20f2044906d4cc51a03
5
5
  SHA512:
6
- metadata.gz: d1d2aa3a55e5fcac3d4ce9b09d86af9484e499b75d58235bcce7d5170fa2ce1ecce607cd24deccb02f19e0cf6027d24290e9820effcdeb554b1fbfb1fab4b4b5
7
- data.tar.gz: 9137bf036afd1f8b0251827ec9d40cf8038180bdaed69976460828782b39ae35e7f716b1a5071016c1f23447228102297306e210b5874cc08f4151e8b1b2071b
6
+ metadata.gz: b315c3747ab683916a513f01f02c87073d2101dd441a9e3de12b257a4e8aebd0e25e5e4a0974c2a726f290cf055f5c318bfcd6c0656968cc4a1170b77fea6773
7
+ data.tar.gz: 8bf66b0b98ed1d2f1850dc9c9f9199ccbf90ea420107b5cc91625fca696b50f71d06d53e8bec664ded0a7c93060e8779774ba34822d4e1b67c2f19f0b2bae467
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Programmatically manage your Merchant Center accounts.
4
4
 
5
- Programmatically manage your Merchant Center accounts.
6
5
 
7
6
  Actual client classes for the various versions of this API are defined in
8
7
  _versioned_ client gems, with names of the form `google-shopping-merchant-reports-v*`.
@@ -34,9 +33,39 @@ In order to use this library, you first need to go through the following steps:
34
33
  1. [Enable the API.](https://console.cloud.google.com/apis/library/merchantapi.googleapis.com)
35
34
  1. {file:AUTHENTICATION.md Set up authentication.}
36
35
 
36
+ ## Debug Logging
37
+
38
+ This library comes with opt-in Debug Logging that can help you troubleshoot
39
+ your application's integration with the API. When logging is activated, key
40
+ events such as requests and responses, along with data payloads and metadata
41
+ such as headers and client configuration, are logged to the standard error
42
+ stream.
43
+
44
+ **WARNING:** Client Library Debug Logging includes your data payloads in
45
+ plaintext, which could include sensitive data such as PII for yourself or your
46
+ customers, private keys, or other security data that could be compromising if
47
+ leaked. Always practice good data hygiene with your application logs, and follow
48
+ the principle of least access. Google also recommends that Client Library Debug
49
+ Logging be enabled only temporarily during active debugging, and not used
50
+ permanently in production.
51
+
52
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
53
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
54
+ list of client library gem names. This will select the default logging behavior,
55
+ which writes logs to the standard error stream. On a local workstation, this may
56
+ result in logs appearing on the console. When running on a Google Cloud hosting
57
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
58
+ results in logs appearing alongside your application logs in the
59
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
60
+
61
+ Debug logging also requires that the versioned clients for this service be
62
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
63
+ working, try updating the versioned clients in your bundle or installed gems:
64
+ [google-shopping-merchant-reports-v1beta](https://rubydoc.info/gems/google-shopping-merchant-reports-v1beta).
65
+
37
66
  ## Supported Ruby Versions
38
67
 
39
- This library is supported on Ruby 2.7+.
68
+ This library is supported on Ruby 3.0+.
40
69
 
41
70
  Google provides official support for Ruby versions that are actively supported
42
71
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -21,7 +21,7 @@ module Google
21
21
  module Shopping
22
22
  module Merchant
23
23
  module Reports
24
- VERSION = "0.3.0"
24
+ VERSION = "0.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -41,6 +41,11 @@ module Google
41
41
  # You can also specify a different transport by passing `:rest` or `:grpc` in
42
42
  # the `transport` parameter.
43
43
  #
44
+ # Raises an exception if the currently installed versioned client gem for the
45
+ # given API version does not support the given transport of the ReportService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Reports.report_service_available?}.
48
+ #
44
49
  # ## About ReportService
45
50
  #
46
51
  # Service for retrieving reports and insights about your products, their
@@ -62,6 +67,37 @@ module Google
62
67
  service_module = service_module.const_get(:Rest) if transport == :rest
63
68
  service_module.const_get(:Client).new(&block)
64
69
  end
70
+
71
+ ##
72
+ # Determines whether the ReportService service is supported by the current client.
73
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Reports.report_service}.
74
+ # If false, that method will raise an exception. This could happen if the given
75
+ # API version does not exist or does not support the ReportService service,
76
+ # or if the versioned client gem needs an update to support the ReportService service.
77
+ #
78
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
79
+ # Defaults to `:v1beta`.
80
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
81
+ # @return [boolean] Whether the service is available.
82
+ #
83
+ def self.report_service_available? version: :v1beta, transport: :grpc
84
+ require "google/shopping/merchant/reports/#{version.to_s.downcase}"
85
+ package_name = Google::Shopping::Merchant::Reports
86
+ .constants
87
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
88
+ .first
89
+ return false unless package_name
90
+ service_module = Google::Shopping::Merchant::Reports.const_get package_name
91
+ return false unless service_module.const_defined? :ReportService
92
+ service_module = service_module.const_get :ReportService
93
+ if transport == :rest
94
+ return false unless service_module.const_defined? :Rest
95
+ service_module = service_module.const_get :Rest
96
+ end
97
+ service_module.const_defined? :Client
98
+ rescue ::LoadError
99
+ false
100
+ end
65
101
  end
66
102
  end
67
103
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-reports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -61,7 +60,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
61
60
  licenses:
62
61
  - Apache-2.0
63
62
  metadata: {}
64
- post_install_message:
65
63
  rdoc_options: []
66
64
  require_paths:
67
65
  - lib
@@ -69,15 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
67
  requirements:
70
68
  - - ">="
71
69
  - !ruby/object:Gem::Version
72
- version: '2.7'
70
+ version: '3.0'
73
71
  required_rubygems_version: !ruby/object:Gem::Requirement
74
72
  requirements:
75
73
  - - ">="
76
74
  - !ruby/object:Gem::Version
77
75
  version: '0'
78
76
  requirements: []
79
- rubygems_version: 3.5.6
80
- signing_key:
77
+ rubygems_version: 3.6.2
81
78
  specification_version: 4
82
79
  summary: Programmatically manage your Merchant Center accounts.
83
80
  test_files: []