google-shopping-merchant-accounts-v1beta 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +35 -2
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +35 -2
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb +22 -8
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/client.rb +35 -4
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +35 -4
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/service_stub.rb +38 -20
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +36 -7
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +36 -7
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +62 -38
- data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/client.rb +34 -5
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +34 -5
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/service_stub.rb +46 -26
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +35 -3
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +35 -3
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/client.rb +35 -5
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +35 -5
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/service_stub.rb +46 -26
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/client.rb +35 -6
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +35 -6
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/service_stub.rb +54 -32
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +34 -3
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/service_stub.rb +30 -14
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/client.rb +34 -4
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +34 -4
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub.rb +38 -20
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/client.rb +35 -6
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +35 -6
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/service_stub.rb +54 -32
- data/lib/google/shopping/merchant/accounts/v1beta/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +4 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/tax_rule.rb +8 -0
- data/proto_docs/google/type/datetime.rb +4 -0
- data/proto_docs/google/type/phone_number.rb +4 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29234369a3c430f50e1caed5ca719f2dab3702557cc4d75b5cba08d53a13d15e
|
4
|
+
data.tar.gz: bbc0985d5e10c2dfebd7ace72f9577f39987f4d85852a3f6a91887f321986f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03e9fb1fb51296928aafd98bf05d7c76adf2d8d5f6b479594cdf584f6d3c6e50a52a904101f484218e6af9c824bb471d31bead96238249b4ac9771d8eb31bad
|
7
|
+
data.tar.gz: a39853fff95b34550e2739ca935e762ac824e7b109af80de8ce1ae2d30089981d81e4f2172c1fddb15fa13e610ddff3c876d7c62a53ded58abd30d576c1d81f7
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://developers.google.com/merchant/api)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/shopping/merchant/accounts/v1beta"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Shopping::Merchant::Accounts::V1beta::AccountTaxService::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
86
|
|
77
87
|
## Supported Ruby Versions
|
78
88
|
|
79
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
80
90
|
|
81
91
|
Google provides official support for Ruby versions that are actively supported
|
82
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -163,8 +163,28 @@ module Google
|
|
163
163
|
universe_domain: @config.universe_domain,
|
164
164
|
channel_args: @config.channel_args,
|
165
165
|
interceptors: @config.interceptors,
|
166
|
-
channel_pool_config: @config.channel_pool
|
166
|
+
channel_pool_config: @config.channel_pool,
|
167
|
+
logger: @config.logger
|
167
168
|
)
|
169
|
+
|
170
|
+
@account_issue_service_stub.stub_logger&.info do |entry|
|
171
|
+
entry.set_system_name
|
172
|
+
entry.set_service
|
173
|
+
entry.message = "Created client for #{entry.service}"
|
174
|
+
entry.set_credentials_fields credentials
|
175
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
176
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
177
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# The logger used for request/response debug logging.
|
183
|
+
#
|
184
|
+
# @return [Logger]
|
185
|
+
#
|
186
|
+
def logger
|
187
|
+
@account_issue_service_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -274,7 +294,7 @@ module Google
|
|
274
294
|
@account_issue_service_stub.call_rpc :list_account_issues, request, options: options do |response, operation|
|
275
295
|
response = ::Gapic::PagedEnumerable.new @account_issue_service_stub, :list_account_issues, request, response, operation, options
|
276
296
|
yield response, operation if block_given?
|
277
|
-
|
297
|
+
throw :response, response
|
278
298
|
end
|
279
299
|
rescue ::GRPC::BadStatus => e
|
280
300
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -324,6 +344,13 @@ module Google
|
|
324
344
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
325
345
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
326
346
|
# * (`nil`) indicating no credentials
|
347
|
+
#
|
348
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
349
|
+
# external source for authentication to Google Cloud, you must validate it before
|
350
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
351
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
352
|
+
# For more information, refer to [Validate credential configurations from external
|
353
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
327
354
|
# @return [::Object]
|
328
355
|
# @!attribute [rw] scope
|
329
356
|
# The OAuth scopes
|
@@ -363,6 +390,11 @@ module Google
|
|
363
390
|
# default endpoint URL. The default value of nil uses the environment
|
364
391
|
# universe (usually the default "googleapis.com" universe).
|
365
392
|
# @return [::String,nil]
|
393
|
+
# @!attribute [rw] logger
|
394
|
+
# A custom logger to use for request/response debug logging, or the value
|
395
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
396
|
+
# explicitly disable logging.
|
397
|
+
# @return [::Logger,:default,nil]
|
366
398
|
#
|
367
399
|
class Configuration
|
368
400
|
extend ::Gapic::Config
|
@@ -387,6 +419,7 @@ module Google
|
|
387
419
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
388
420
|
config_attr :quota_project, nil, ::String, nil
|
389
421
|
config_attr :universe_domain, nil, ::String, nil
|
422
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
390
423
|
|
391
424
|
# @private
|
392
425
|
def initialize parent_config = nil
|
@@ -156,8 +156,28 @@ module Google
|
|
156
156
|
endpoint: @config.endpoint,
|
157
157
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
158
158
|
universe_domain: @config.universe_domain,
|
159
|
-
credentials: credentials
|
159
|
+
credentials: credentials,
|
160
|
+
logger: @config.logger
|
160
161
|
)
|
162
|
+
|
163
|
+
@account_issue_service_stub.logger(stub: true)&.info do |entry|
|
164
|
+
entry.set_system_name
|
165
|
+
entry.set_service
|
166
|
+
entry.message = "Created client for #{entry.service}"
|
167
|
+
entry.set_credentials_fields credentials
|
168
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
169
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
170
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# The logger used for request/response debug logging.
|
176
|
+
#
|
177
|
+
# @return [Logger]
|
178
|
+
#
|
179
|
+
def logger
|
180
|
+
@account_issue_service_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -260,7 +280,7 @@ module Google
|
|
260
280
|
@account_issue_service_stub.list_account_issues request, options do |result, operation|
|
261
281
|
result = ::Gapic::Rest::PagedEnumerable.new @account_issue_service_stub, :list_account_issues, "account_issues", request, result, options
|
262
282
|
yield result, operation if block_given?
|
263
|
-
|
283
|
+
throw :response, result
|
264
284
|
end
|
265
285
|
rescue ::Gapic::Rest::Error => e
|
266
286
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -308,6 +328,13 @@ module Google
|
|
308
328
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
309
329
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
310
330
|
# * (`nil`) indicating no credentials
|
331
|
+
#
|
332
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
333
|
+
# external source for authentication to Google Cloud, you must validate it before
|
334
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
335
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
336
|
+
# For more information, refer to [Validate credential configurations from external
|
337
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
311
338
|
# @return [::Object]
|
312
339
|
# @!attribute [rw] scope
|
313
340
|
# The OAuth scopes
|
@@ -340,6 +367,11 @@ module Google
|
|
340
367
|
# default endpoint URL. The default value of nil uses the environment
|
341
368
|
# universe (usually the default "googleapis.com" universe).
|
342
369
|
# @return [::String,nil]
|
370
|
+
# @!attribute [rw] logger
|
371
|
+
# A custom logger to use for request/response debug logging, or the value
|
372
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
373
|
+
# explicitly disable logging.
|
374
|
+
# @return [::Logger,:default,nil]
|
343
375
|
#
|
344
376
|
class Configuration
|
345
377
|
extend ::Gapic::Config
|
@@ -361,6 +393,7 @@ module Google
|
|
361
393
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
362
394
|
config_attr :quota_project, nil, ::String, nil
|
363
395
|
config_attr :universe_domain, nil, ::String, nil
|
396
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
364
397
|
|
365
398
|
# @private
|
366
399
|
def initialize parent_config = nil
|
data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb
CHANGED
@@ -31,7 +31,8 @@ module Google
|
|
31
31
|
# including transcoding, making the REST call, and deserialing the response.
|
32
32
|
#
|
33
33
|
class ServiceStub
|
34
|
-
|
34
|
+
# @private
|
35
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
35
36
|
# These require statements are intentionally placed here to initialize
|
36
37
|
# the REST modules only when it's required.
|
37
38
|
require "gapic/rest"
|
@@ -41,7 +42,9 @@ module Google
|
|
41
42
|
universe_domain: universe_domain,
|
42
43
|
credentials: credentials,
|
43
44
|
numeric_enums: true,
|
44
|
-
|
45
|
+
service_name: self.class,
|
46
|
+
raise_faraday_errors: false,
|
47
|
+
logger: logger
|
45
48
|
end
|
46
49
|
|
47
50
|
##
|
@@ -62,6 +65,15 @@ module Google
|
|
62
65
|
@client_stub.endpoint
|
63
66
|
end
|
64
67
|
|
68
|
+
##
|
69
|
+
# The logger used for request/response debug logging.
|
70
|
+
#
|
71
|
+
# @return [Logger]
|
72
|
+
#
|
73
|
+
def logger stub: false
|
74
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
75
|
+
end
|
76
|
+
|
65
77
|
##
|
66
78
|
# Baseline implementation for the list_account_issues REST call
|
67
79
|
#
|
@@ -88,16 +100,18 @@ module Google
|
|
88
100
|
|
89
101
|
response = @client_stub.make_http_request(
|
90
102
|
verb,
|
91
|
-
uri:
|
92
|
-
body:
|
93
|
-
params:
|
103
|
+
uri: uri,
|
104
|
+
body: body || "",
|
105
|
+
params: query_string_params,
|
106
|
+
method_name: "list_account_issues",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::ListAccountIssuesResponse.decode_json response.body, ignore_unknown_fields: true
|
98
|
-
|
99
|
-
|
100
|
-
|
111
|
+
catch :response do
|
112
|
+
yield result, operation if block_given?
|
113
|
+
result
|
114
|
+
end
|
101
115
|
end
|
102
116
|
|
103
117
|
##
|
@@ -167,8 +167,28 @@ module Google
|
|
167
167
|
universe_domain: @config.universe_domain,
|
168
168
|
channel_args: @config.channel_args,
|
169
169
|
interceptors: @config.interceptors,
|
170
|
-
channel_pool_config: @config.channel_pool
|
170
|
+
channel_pool_config: @config.channel_pool,
|
171
|
+
logger: @config.logger
|
171
172
|
)
|
173
|
+
|
174
|
+
@account_tax_service_stub.stub_logger&.info do |entry|
|
175
|
+
entry.set_system_name
|
176
|
+
entry.set_service
|
177
|
+
entry.message = "Created client for #{entry.service}"
|
178
|
+
entry.set_credentials_fields credentials
|
179
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
180
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
181
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# The logger used for request/response debug logging.
|
187
|
+
#
|
188
|
+
# @return [Logger]
|
189
|
+
#
|
190
|
+
def logger
|
191
|
+
@account_tax_service_stub.logger
|
172
192
|
end
|
173
193
|
|
174
194
|
# Service calls
|
@@ -253,7 +273,6 @@ module Google
|
|
253
273
|
|
254
274
|
@account_tax_service_stub.call_rpc :get_account_tax, request, options: options do |response, operation|
|
255
275
|
yield response, operation if block_given?
|
256
|
-
return response
|
257
276
|
end
|
258
277
|
rescue ::GRPC::BadStatus => e
|
259
278
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -353,7 +372,7 @@ module Google
|
|
353
372
|
@account_tax_service_stub.call_rpc :list_account_tax, request, options: options do |response, operation|
|
354
373
|
response = ::Gapic::PagedEnumerable.new @account_tax_service_stub, :list_account_tax, request, response, operation, options
|
355
374
|
yield response, operation if block_given?
|
356
|
-
|
375
|
+
throw :response, response
|
357
376
|
end
|
358
377
|
rescue ::GRPC::BadStatus => e
|
359
378
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -441,7 +460,6 @@ module Google
|
|
441
460
|
|
442
461
|
@account_tax_service_stub.call_rpc :update_account_tax, request, options: options do |response, operation|
|
443
462
|
yield response, operation if block_given?
|
444
|
-
return response
|
445
463
|
end
|
446
464
|
rescue ::GRPC::BadStatus => e
|
447
465
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -491,6 +509,13 @@ module Google
|
|
491
509
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
492
510
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
493
511
|
# * (`nil`) indicating no credentials
|
512
|
+
#
|
513
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
514
|
+
# external source for authentication to Google Cloud, you must validate it before
|
515
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
516
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
517
|
+
# For more information, refer to [Validate credential configurations from external
|
518
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
494
519
|
# @return [::Object]
|
495
520
|
# @!attribute [rw] scope
|
496
521
|
# The OAuth scopes
|
@@ -530,6 +555,11 @@ module Google
|
|
530
555
|
# default endpoint URL. The default value of nil uses the environment
|
531
556
|
# universe (usually the default "googleapis.com" universe).
|
532
557
|
# @return [::String,nil]
|
558
|
+
# @!attribute [rw] logger
|
559
|
+
# A custom logger to use for request/response debug logging, or the value
|
560
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
561
|
+
# explicitly disable logging.
|
562
|
+
# @return [::Logger,:default,nil]
|
533
563
|
#
|
534
564
|
class Configuration
|
535
565
|
extend ::Gapic::Config
|
@@ -554,6 +584,7 @@ module Google
|
|
554
584
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
555
585
|
config_attr :quota_project, nil, ::String, nil
|
556
586
|
config_attr :universe_domain, nil, ::String, nil
|
587
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
557
588
|
|
558
589
|
# @private
|
559
590
|
def initialize parent_config = nil
|
@@ -160,8 +160,28 @@ module Google
|
|
160
160
|
endpoint: @config.endpoint,
|
161
161
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
162
|
universe_domain: @config.universe_domain,
|
163
|
-
credentials: credentials
|
163
|
+
credentials: credentials,
|
164
|
+
logger: @config.logger
|
164
165
|
)
|
166
|
+
|
167
|
+
@account_tax_service_stub.logger(stub: true)&.info do |entry|
|
168
|
+
entry.set_system_name
|
169
|
+
entry.set_service
|
170
|
+
entry.message = "Created client for #{entry.service}"
|
171
|
+
entry.set_credentials_fields credentials
|
172
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
173
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
174
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# The logger used for request/response debug logging.
|
180
|
+
#
|
181
|
+
# @return [Logger]
|
182
|
+
#
|
183
|
+
def logger
|
184
|
+
@account_tax_service_stub.logger
|
165
185
|
end
|
166
186
|
|
167
187
|
# Service calls
|
@@ -239,7 +259,6 @@ module Google
|
|
239
259
|
|
240
260
|
@account_tax_service_stub.get_account_tax request, options do |result, operation|
|
241
261
|
yield result, operation if block_given?
|
242
|
-
return result
|
243
262
|
end
|
244
263
|
rescue ::Gapic::Rest::Error => e
|
245
264
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -332,7 +351,7 @@ module Google
|
|
332
351
|
@account_tax_service_stub.list_account_tax request, options do |result, operation|
|
333
352
|
result = ::Gapic::Rest::PagedEnumerable.new @account_tax_service_stub, :list_account_tax, "account_taxes", request, result, options
|
334
353
|
yield result, operation if block_given?
|
335
|
-
|
354
|
+
throw :response, result
|
336
355
|
end
|
337
356
|
rescue ::Gapic::Rest::Error => e
|
338
357
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -413,7 +432,6 @@ module Google
|
|
413
432
|
|
414
433
|
@account_tax_service_stub.update_account_tax request, options do |result, operation|
|
415
434
|
yield result, operation if block_given?
|
416
|
-
return result
|
417
435
|
end
|
418
436
|
rescue ::Gapic::Rest::Error => e
|
419
437
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -461,6 +479,13 @@ module Google
|
|
461
479
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
462
480
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
463
481
|
# * (`nil`) indicating no credentials
|
482
|
+
#
|
483
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
484
|
+
# external source for authentication to Google Cloud, you must validate it before
|
485
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
486
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
487
|
+
# For more information, refer to [Validate credential configurations from external
|
488
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
464
489
|
# @return [::Object]
|
465
490
|
# @!attribute [rw] scope
|
466
491
|
# The OAuth scopes
|
@@ -493,6 +518,11 @@ module Google
|
|
493
518
|
# default endpoint URL. The default value of nil uses the environment
|
494
519
|
# universe (usually the default "googleapis.com" universe).
|
495
520
|
# @return [::String,nil]
|
521
|
+
# @!attribute [rw] logger
|
522
|
+
# A custom logger to use for request/response debug logging, or the value
|
523
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
524
|
+
# explicitly disable logging.
|
525
|
+
# @return [::Logger,:default,nil]
|
496
526
|
#
|
497
527
|
class Configuration
|
498
528
|
extend ::Gapic::Config
|
@@ -514,6 +544,7 @@ module Google
|
|
514
544
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
515
545
|
config_attr :quota_project, nil, ::String, nil
|
516
546
|
config_attr :universe_domain, nil, ::String, nil
|
547
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
517
548
|
|
518
549
|
# @private
|
519
550
|
def initialize parent_config = nil
|
@@ -31,7 +31,8 @@ module Google
|
|
31
31
|
# including transcoding, making the REST call, and deserialing the response.
|
32
32
|
#
|
33
33
|
class ServiceStub
|
34
|
-
|
34
|
+
# @private
|
35
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
35
36
|
# These require statements are intentionally placed here to initialize
|
36
37
|
# the REST modules only when it's required.
|
37
38
|
require "gapic/rest"
|
@@ -41,7 +42,9 @@ module Google
|
|
41
42
|
universe_domain: universe_domain,
|
42
43
|
credentials: credentials,
|
43
44
|
numeric_enums: true,
|
44
|
-
|
45
|
+
service_name: self.class,
|
46
|
+
raise_faraday_errors: false,
|
47
|
+
logger: logger
|
45
48
|
end
|
46
49
|
|
47
50
|
##
|
@@ -62,6 +65,15 @@ module Google
|
|
62
65
|
@client_stub.endpoint
|
63
66
|
end
|
64
67
|
|
68
|
+
##
|
69
|
+
# The logger used for request/response debug logging.
|
70
|
+
#
|
71
|
+
# @return [Logger]
|
72
|
+
#
|
73
|
+
def logger stub: false
|
74
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
75
|
+
end
|
76
|
+
|
65
77
|
##
|
66
78
|
# Baseline implementation for the get_account_tax REST call
|
67
79
|
#
|
@@ -88,16 +100,18 @@ module Google
|
|
88
100
|
|
89
101
|
response = @client_stub.make_http_request(
|
90
102
|
verb,
|
91
|
-
uri:
|
92
|
-
body:
|
93
|
-
params:
|
103
|
+
uri: uri,
|
104
|
+
body: body || "",
|
105
|
+
params: query_string_params,
|
106
|
+
method_name: "get_account_tax",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::AccountTax.decode_json response.body, ignore_unknown_fields: true
|
98
|
-
|
99
|
-
|
100
|
-
|
111
|
+
catch :response do
|
112
|
+
yield result, operation if block_given?
|
113
|
+
result
|
114
|
+
end
|
101
115
|
end
|
102
116
|
|
103
117
|
##
|
@@ -126,16 +140,18 @@ module Google
|
|
126
140
|
|
127
141
|
response = @client_stub.make_http_request(
|
128
142
|
verb,
|
129
|
-
uri:
|
130
|
-
body:
|
131
|
-
params:
|
143
|
+
uri: uri,
|
144
|
+
body: body || "",
|
145
|
+
params: query_string_params,
|
146
|
+
method_name: "list_account_tax",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::ListAccountTaxResponse.decode_json response.body, ignore_unknown_fields: true
|
136
|
-
|
137
|
-
|
138
|
-
|
151
|
+
catch :response do
|
152
|
+
yield result, operation if block_given?
|
153
|
+
result
|
154
|
+
end
|
139
155
|
end
|
140
156
|
|
141
157
|
##
|
@@ -164,16 +180,18 @@ module Google
|
|
164
180
|
|
165
181
|
response = @client_stub.make_http_request(
|
166
182
|
verb,
|
167
|
-
uri:
|
168
|
-
body:
|
169
|
-
params:
|
183
|
+
uri: uri,
|
184
|
+
body: body || "",
|
185
|
+
params: query_string_params,
|
186
|
+
method_name: "update_account_tax",
|
170
187
|
options: options
|
171
188
|
)
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
173
190
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::AccountTax.decode_json response.body, ignore_unknown_fields: true
|
174
|
-
|
175
|
-
|
176
|
-
|
191
|
+
catch :response do
|
192
|
+
yield result, operation if block_given?
|
193
|
+
result
|
194
|
+
end
|
177
195
|
end
|
178
196
|
|
179
197
|
##
|