google-shopping-merchant-data_sources 0.2.0 → 0.3.1

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: 2b0e5d68fee448dfa4bdad2979c239ad334e4daae1ed426852bbaf1e5d23f65b
4
+ data.tar.gz: 957c8101f3c079c47084e17ccc3b85b1358585c71d487b4669254b6153c809ae
5
5
  SHA512:
6
- metadata.gz: 193f532a78ad49ec1964faaa66d53c77ade3e85da8098b89297f14f240e7df40337ce112cccb7232d4985b7060b4ac76881fda699479bc63c330af6f832ca7d1
7
- data.tar.gz: 8bad29d6dab8fb4cee89793017fc9b7496f7879362374bf81dcc6493f8c51d1dc8bdec86bf3e5b87821d98546caf96f1eb0f966ebf4f822668c8668b11d9ccd7
6
+ metadata.gz: c96043143a8ae994fdb49ecee07df84f7b6e09e426a5b10b1f68ad2cdb7a512c885013b3624989465b75b81914c11e06cc97bbd253470a5efd2891fe510fb114
7
+ data.tar.gz: b3796fca82d8682184c20b803011d676d7daee728ff1ee3f6b8b55b8b248ee5bdf08a741e7c75b4840d2fe4e43103003b2eecbfae671d0b802ac6704cce5467c
data/README.md CHANGED
@@ -7,7 +7,7 @@ Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you to pro
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-shopping-merchant-data_sources-v*`.
9
9
  The gem `google-shopping-merchant-data_sources` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -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.1"
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.1
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: 1980-01-02 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.8
93
90
  specification_version: 4
94
91
  summary: Programmatically manage your Merchant Center Accounts.
95
92
  test_files: []