google-shopping-merchant-data_sources 0.2.0 → 0.3.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: 0f87b77fdcda9d1d48ea24076be10eede507819f964af0827d4cdca417df022b
4
- data.tar.gz: 63c606fb2788dcc28bf885b746249e254c7ef9edc05499a1e92355e34369e7d2
3
+ metadata.gz: ff80dd03269deb18f72a01f526d87cd36c86d38a14e9cef77ba3c9d817117e6b
4
+ data.tar.gz: 2b06516f0bf50ae27561a86a19a47d5e40a4a289f17e91ce0b6f10801fa0126f
5
5
  SHA512:
6
- metadata.gz: 193f532a78ad49ec1964faaa66d53c77ade3e85da8098b89297f14f240e7df40337ce112cccb7232d4985b7060b4ac76881fda699479bc63c330af6f832ca7d1
7
- data.tar.gz: 8bad29d6dab8fb4cee89793017fc9b7496f7879362374bf81dcc6493f8c51d1dc8bdec86bf3e5b87821d98546caf96f1eb0f966ebf4f822668c8668b11d9ccd7
6
+ metadata.gz: fc66eff21d3f151dd5d6718760f515c21b86f6a4ca9ace5689bc6f445afb82ebba06da5001b34283a11df257acc3184b070dd4e75aa73bd27dd0435468180c46
7
+ data.tar.gz: a4139bbb51d0a68049aa1090d87479740c69407dc58876d59bb7cfd3c2d87a315b4f4f531f6e4c9be6ec0b6516d39c61d14d7ce907383a5402ab0892f30d918e
data/README.md CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/merchantapi.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-shopping-merchant-data_sources-v1beta](https://rubydoc.info/gems/google-shopping-merchant-data_sources-v1beta).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  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 DataSources
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.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 DataSourcesService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::DataSources.data_sources_service_available?}.
48
+ #
44
49
  # ## About DataSourcesService
45
50
  #
46
51
  # Service to manage primary, supplemental, inventory and other data sources.
@@ -64,6 +69,37 @@ module Google
64
69
  service_module.const_get(:Client).new(&block)
65
70
  end
66
71
 
72
+ ##
73
+ # Determines whether the DataSourcesService service is supported by the current client.
74
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::DataSources.data_sources_service}.
75
+ # If false, that method will raise an exception. This could happen if the given
76
+ # API version does not exist or does not support the DataSourcesService service,
77
+ # or if the versioned client gem needs an update to support the DataSourcesService service.
78
+ #
79
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
80
+ # Defaults to `:v1beta`.
81
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
82
+ # @return [boolean] Whether the service is available.
83
+ #
84
+ def self.data_sources_service_available? version: :v1beta, transport: :grpc
85
+ require "google/shopping/merchant/data_sources/#{version.to_s.downcase}"
86
+ package_name = Google::Shopping::Merchant::DataSources
87
+ .constants
88
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
89
+ .first
90
+ return false unless package_name
91
+ service_module = Google::Shopping::Merchant::DataSources.const_get package_name
92
+ return false unless service_module.const_defined? :DataSourcesService
93
+ service_module = service_module.const_get :DataSourcesService
94
+ if transport == :rest
95
+ return false unless service_module.const_defined? :Rest
96
+ service_module = service_module.const_get :Rest
97
+ end
98
+ service_module.const_defined? :Client
99
+ rescue ::LoadError
100
+ false
101
+ end
102
+
67
103
  ##
68
104
  # Create a new client object for FileUploadsService.
69
105
  #
@@ -77,6 +113,11 @@ module Google
77
113
  # You can also specify a different transport by passing `:rest` or `:grpc` in
78
114
  # the `transport` parameter.
79
115
  #
116
+ # Raises an exception if the currently installed versioned client gem for the
117
+ # given API version does not support the given transport of the FileUploadsService service.
118
+ # You can determine whether the method will succeed by calling
119
+ # {Google::Shopping::Merchant::DataSources.file_uploads_service_available?}.
120
+ #
80
121
  # ## About FileUploadsService
81
122
  #
82
123
  # Service to manage data source file uploads.
@@ -97,6 +138,37 @@ module Google
97
138
  service_module = service_module.const_get(:Rest) if transport == :rest
98
139
  service_module.const_get(:Client).new(&block)
99
140
  end
141
+
142
+ ##
143
+ # Determines whether the FileUploadsService service is supported by the current client.
144
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::DataSources.file_uploads_service}.
145
+ # If false, that method will raise an exception. This could happen if the given
146
+ # API version does not exist or does not support the FileUploadsService service,
147
+ # or if the versioned client gem needs an update to support the FileUploadsService service.
148
+ #
149
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
150
+ # Defaults to `:v1beta`.
151
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
152
+ # @return [boolean] Whether the service is available.
153
+ #
154
+ def self.file_uploads_service_available? version: :v1beta, transport: :grpc
155
+ require "google/shopping/merchant/data_sources/#{version.to_s.downcase}"
156
+ package_name = Google::Shopping::Merchant::DataSources
157
+ .constants
158
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
159
+ .first
160
+ return false unless package_name
161
+ service_module = Google::Shopping::Merchant::DataSources.const_get package_name
162
+ return false unless service_module.const_defined? :FileUploadsService
163
+ service_module = service_module.const_get :FileUploadsService
164
+ if transport == :rest
165
+ return false unless service_module.const_defined? :Rest
166
+ service_module = service_module.const_get :Rest
167
+ end
168
+ service_module.const_defined? :Client
169
+ rescue ::LoadError
170
+ false
171
+ end
100
172
  end
101
173
  end
102
174
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-data_sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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-10-04 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
@@ -73,7 +72,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
73
72
  licenses:
74
73
  - Apache-2.0
75
74
  metadata: {}
76
- post_install_message:
77
75
  rdoc_options: []
78
76
  require_paths:
79
77
  - lib
@@ -81,15 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
79
  requirements:
82
80
  - - ">="
83
81
  - !ruby/object:Gem::Version
84
- version: '2.7'
82
+ version: '3.0'
85
83
  required_rubygems_version: !ruby/object:Gem::Requirement
86
84
  requirements:
87
85
  - - ">="
88
86
  - !ruby/object:Gem::Version
89
87
  version: '0'
90
88
  requirements: []
91
- rubygems_version: 3.5.6
92
- signing_key:
89
+ rubygems_version: 3.6.2
93
90
  specification_version: 4
94
91
  summary: Programmatically manage your Merchant Center Accounts.
95
92
  test_files: []