google-shopping-merchant-notifications 0.1.0 → 0.2.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: 6486d1adc0189e8a01bf00ece7d8c5a43d10ebe3221acc6986da5caf7395d136
4
- data.tar.gz: 48fb870422a6c3eae5279e7892fd53cb861f14bb0b38d037809b32fc01372cbf
3
+ metadata.gz: 7f9da22fdb86376a60b876395464b2256aae0a4cc050a7c9d0faf2d3a7e94551
4
+ data.tar.gz: c2f2f7b32c6b5ca5d61ca9199dbbbe1da0b04b4cbcb381983cbdda2eb115c783
5
5
  SHA512:
6
- metadata.gz: 44bbf8d2c741478abfea67967d3a4295d6dceb68401717da0ec2c252584c89142b615cf0de665e3c6606854090f73ead6ff87910aff44e88eb5255fb4118c1ad
7
- data.tar.gz: 8f339140639d483e6e5c6485d650a75b5c30b8b11c97f5c38a7fb7172deef099de8983c9d0151d149de40866446b14d24e5263f32c24d84d272025c3b2cac74d
6
+ metadata.gz: 53c7264543f34d8b6a6308a856529a87438ab6b4db81c668e7dfef26a38c2957e86ed8ef088af14660b137ce378ef206bde7fe74a0d87950d7470b0334ddd58d
7
+ data.tar.gz: 244afbc8a3efed65f4e5ba80d037bf6bb6ddbcd3487631d7839f5b483357fe31f74f7433de8298007bbfe62ff60290e3984e238b9f193b276349d5116fa05cf9
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-notifications-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-notifications-v1beta](https://rubydoc.info/gems/google-shopping-merchant-notifications-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 Notifications
24
- VERSION = "0.1.0"
24
+ VERSION = "0.2.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 NotificationsApiService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Notifications.notifications_api_service_available?}.
48
+ #
44
49
  # ## About NotificationsApiService
45
50
  #
46
51
  # Service to manage notification subscriptions for merchants
@@ -61,6 +66,37 @@ module Google
61
66
  service_module = service_module.const_get(:Rest) if transport == :rest
62
67
  service_module.const_get(:Client).new(&block)
63
68
  end
69
+
70
+ ##
71
+ # Determines whether the NotificationsApiService service is supported by the current client.
72
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Notifications.notifications_api_service}.
73
+ # If false, that method will raise an exception. This could happen if the given
74
+ # API version does not exist or does not support the NotificationsApiService service,
75
+ # or if the versioned client gem needs an update to support the NotificationsApiService service.
76
+ #
77
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
78
+ # Defaults to `:v1beta`.
79
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
80
+ # @return [boolean] Whether the service is available.
81
+ #
82
+ def self.notifications_api_service_available? version: :v1beta, transport: :grpc
83
+ require "google/shopping/merchant/notifications/#{version.to_s.downcase}"
84
+ package_name = Google::Shopping::Merchant::Notifications
85
+ .constants
86
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
87
+ .first
88
+ return false unless package_name
89
+ service_module = Google::Shopping::Merchant::Notifications.const_get package_name
90
+ return false unless service_module.const_defined? :NotificationsApiService
91
+ service_module = service_module.const_get :NotificationsApiService
92
+ if transport == :rest
93
+ return false unless service_module.const_defined? :Rest
94
+ service_module = service_module.const_get :Rest
95
+ end
96
+ service_module.const_defined? :Client
97
+ rescue ::LoadError
98
+ false
99
+ end
64
100
  end
65
101
  end
66
102
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.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-04-25 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: []