google-shopping-merchant-conversions 0.1.0 → 0.2.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: 17efbfa338234b85244b435de6bb4684dc91a8656711fdcd4f6474e00e6358e8
4
- data.tar.gz: 3f49b4c56accf1221b3e3f9694a89f4e162e57aee60d0c4b70380cbaa86de13c
3
+ metadata.gz: d324972b96cf71ea7931ed8173344d03c52432684b50549a2a068f9f0160793e
4
+ data.tar.gz: d0a869241a1d528414611ec2468413a3935a96ffdb097c359082b15e6883271c
5
5
  SHA512:
6
- metadata.gz: db1066d97e140b641d4ab6c0a751609a21f003a034712f2104be251197a605957d1d2bcdfa2dd7c567518c6e3b29790e223083ae2df0d5b6cd7c3e5c42a2ee60
7
- data.tar.gz: 2a85024f37abf972a8041502ce5cb381f670107f9f3cd82b0d9b90d0a940d0178537695d4c5fd2beb797d66da36c9d2309ef6d6cae112713c338e521c974c823
6
+ metadata.gz: 8020d4666b832587c84ec1fac8f527c040b721f4c384eaf7e0cac6c0ca043226fc92649807ac9347284e63388ec23ff14e32bb64db907c4c036ac2efa1d364c5
7
+ data.tar.gz: 83fe2341a880d616c90513fd360589e1a4d42c761dfd5b820458dd8b4a21b0eca8f51dc5a932c2d38597f8dde6b98a862e782904042b47e0684c08e5979c614e
data/README.md CHANGED
@@ -2,12 +2,11 @@
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-conversions-v*`.
9
8
  The gem `google-shopping-merchant-conversions` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
9
+ versioned gems in as dependencies, and provides high-level methods for
11
10
  constructing clients. More information on versioned clients can be found below
12
11
  in the section titled *Which client should I use?*.
13
12
 
@@ -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-conversions-v1beta](https://rubydoc.info/gems/google-shopping-merchant-conversions-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 Conversions
24
- VERSION = "0.1.0"
24
+ VERSION = "0.2.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 ConversionSourcesService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Conversions.conversion_sources_service_available?}.
48
+ #
44
49
  # ## About ConversionSourcesService
45
50
  #
46
51
  # Service for managing conversion sources for a merchant account.
@@ -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 ConversionSourcesService service is supported by the current client.
72
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Conversions.conversion_sources_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 ConversionSourcesService service,
75
+ # or if the versioned client gem needs an update to support the ConversionSourcesService 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.conversion_sources_service_available? version: :v1beta, transport: :grpc
83
+ require "google/shopping/merchant/conversions/#{version.to_s.downcase}"
84
+ package_name = Google::Shopping::Merchant::Conversions
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::Conversions.const_get package_name
90
+ return false unless service_module.const_defined? :ConversionSourcesService
91
+ service_module = service_module.const_get :ConversionSourcesService
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-conversions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.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-04-24 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
@@ -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.8
81
78
  specification_version: 4
82
79
  summary: Programmatically manage your Merchant Center accounts.
83
80
  test_files: []