google-shopping-merchant-reports 0.2.0 → 0.4.0

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: 0adf2dcc37773e539f98bcd2270913b6ac5d04acf8d13b5515a01ed8d3d6f13e
4
- data.tar.gz: 798740ec254213198331d3978a2468ce7dd88f418ca7b8f7452bbbd39e95404b
3
+ metadata.gz: 00cde6bdfb77c31201821bd9a955883f628bb11c1f8cdca7aa52973e8b3b411b
4
+ data.tar.gz: eeb00397753eaedc8e798766cccbdd085a25c7146242e20f2044906d4cc51a03
5
5
  SHA512:
6
- metadata.gz: aba69244d2949943ac865615211fb247af683e103289966c66bb1ff46ca99a9db26b642166237bfbbce144aff12c25dbe9857ec6f3414ac117a27f79a469c7f4
7
- data.tar.gz: 624fd46e5850ddd3186945335451f7ca7b7d19683e7650e6cc51a821de1df16e3a4d4a5c4a26d3d89d924c84c57da2e41863a19bb7895c67ea963167a334889d
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.6+.
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.2.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.2.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-01-15 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
@@ -44,118 +43,6 @@ dependencies:
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-style
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 1.26.1
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: 1.26.1
61
- - !ruby/object:Gem::Dependency
62
- name: minitest
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '5.16'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '5.16'
75
- - !ruby/object:Gem::Dependency
76
- name: minitest-focus
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.1'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.1'
89
- - !ruby/object:Gem::Dependency
90
- name: minitest-rg
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '5.2'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '5.2'
103
- - !ruby/object:Gem::Dependency
104
- name: rake
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '13.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '13.0'
117
- - !ruby/object:Gem::Dependency
118
- name: redcarpet
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '3.0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '3.0'
131
- - !ruby/object:Gem::Dependency
132
- name: simplecov
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '0.9'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '0.9'
145
- - !ruby/object:Gem::Dependency
146
- name: yard
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '0.9'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '0.9'
159
46
  description: Programmatically manage your Merchant Center accounts.
160
47
  email: googleapis-packages@google.com
161
48
  executables: []
@@ -173,7 +60,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
173
60
  licenses:
174
61
  - Apache-2.0
175
62
  metadata: {}
176
- post_install_message:
177
63
  rdoc_options: []
178
64
  require_paths:
179
65
  - lib
@@ -181,15 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
67
  requirements:
182
68
  - - ">="
183
69
  - !ruby/object:Gem::Version
184
- version: '2.6'
70
+ version: '3.0'
185
71
  required_rubygems_version: !ruby/object:Gem::Requirement
186
72
  requirements:
187
73
  - - ">="
188
74
  - !ruby/object:Gem::Version
189
75
  version: '0'
190
76
  requirements: []
191
- rubygems_version: 3.5.3
192
- signing_key:
77
+ rubygems_version: 3.6.2
193
78
  specification_version: 4
194
79
  summary: Programmatically manage your Merchant Center accounts.
195
80
  test_files: []