google-shopping-merchant-accounts-v1beta 0.2.0 → 0.4.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 +30 -20
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +28 -2
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +28 -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 +28 -4
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +28 -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_pb.rb +1 -1
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +38 -9
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +38 -9
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +62 -38
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_services_pb.rb +5 -1
- data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/client.rb +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/rest/client.rb +27 -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 +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +27 -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 +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +27 -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 +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +27 -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 +27 -5
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +27 -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 +28 -3
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +28 -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 +28 -5
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +28 -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 +28 -6
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +28 -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 +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +27 -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 +27 -3
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +27 -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 +27 -4
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +27 -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 +28 -6
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +28 -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/accounts.rb +4 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6915e815f2e5bd835a5c3fdaa7bf35659bf51105b52d7792711f85c53def0eb5
|
4
|
+
data.tar.gz: b770db28737f35e302053038b4a5a3b59b15f76ae4edeac8c5cb67a24214f9a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c41dde993a8233da09e8da48237e242d84ad3677d37030e779a73fcf2f2365414ec01a585078bb97d1729af2d9bbb6b0e700e2b7a03705e9f63d417f14f555f
|
7
|
+
data.tar.gz: bb32b5d841f840958ba05cd83ca88ddf340643e0fc1c9fd90cef95211a46d17a33e457584dc92bff747ad30cf57f6978903f1a5a3d3f358ddc263b192e4c74ec
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ 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).
|
@@ -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)
|
@@ -363,6 +383,11 @@ module Google
|
|
363
383
|
# default endpoint URL. The default value of nil uses the environment
|
364
384
|
# universe (usually the default "googleapis.com" universe).
|
365
385
|
# @return [::String,nil]
|
386
|
+
# @!attribute [rw] logger
|
387
|
+
# A custom logger to use for request/response debug logging, or the value
|
388
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
389
|
+
# explicitly disable logging.
|
390
|
+
# @return [::Logger,:default,nil]
|
366
391
|
#
|
367
392
|
class Configuration
|
368
393
|
extend ::Gapic::Config
|
@@ -387,6 +412,7 @@ module Google
|
|
387
412
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
388
413
|
config_attr :quota_project, nil, ::String, nil
|
389
414
|
config_attr :universe_domain, nil, ::String, nil
|
415
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
390
416
|
|
391
417
|
# @private
|
392
418
|
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)
|
@@ -340,6 +360,11 @@ module Google
|
|
340
360
|
# default endpoint URL. The default value of nil uses the environment
|
341
361
|
# universe (usually the default "googleapis.com" universe).
|
342
362
|
# @return [::String,nil]
|
363
|
+
# @!attribute [rw] logger
|
364
|
+
# A custom logger to use for request/response debug logging, or the value
|
365
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
366
|
+
# explicitly disable logging.
|
367
|
+
# @return [::Logger,:default,nil]
|
343
368
|
#
|
344
369
|
class Configuration
|
345
370
|
extend ::Gapic::Config
|
@@ -361,6 +386,7 @@ module Google
|
|
361
386
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
362
387
|
config_attr :quota_project, nil, ::String, nil
|
363
388
|
config_attr :universe_domain, nil, ::String, nil
|
389
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
364
390
|
|
365
391
|
# @private
|
366
392
|
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)
|
@@ -530,6 +548,11 @@ module Google
|
|
530
548
|
# default endpoint URL. The default value of nil uses the environment
|
531
549
|
# universe (usually the default "googleapis.com" universe).
|
532
550
|
# @return [::String,nil]
|
551
|
+
# @!attribute [rw] logger
|
552
|
+
# A custom logger to use for request/response debug logging, or the value
|
553
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
554
|
+
# explicitly disable logging.
|
555
|
+
# @return [::Logger,:default,nil]
|
533
556
|
#
|
534
557
|
class Configuration
|
535
558
|
extend ::Gapic::Config
|
@@ -554,6 +577,7 @@ module Google
|
|
554
577
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
555
578
|
config_attr :quota_project, nil, ::String, nil
|
556
579
|
config_attr :universe_domain, nil, ::String, nil
|
580
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
557
581
|
|
558
582
|
# @private
|
559
583
|
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)
|
@@ -493,6 +511,11 @@ module Google
|
|
493
511
|
# default endpoint URL. The default value of nil uses the environment
|
494
512
|
# universe (usually the default "googleapis.com" universe).
|
495
513
|
# @return [::String,nil]
|
514
|
+
# @!attribute [rw] logger
|
515
|
+
# A custom logger to use for request/response debug logging, or the value
|
516
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
517
|
+
# explicitly disable logging.
|
518
|
+
# @return [::Logger,:default,nil]
|
496
519
|
#
|
497
520
|
class Configuration
|
498
521
|
extend ::Gapic::Config
|
@@ -514,6 +537,7 @@ module Google
|
|
514
537
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
515
538
|
config_attr :quota_project, nil, ::String, nil
|
516
539
|
config_attr :universe_domain, nil, ::String, nil
|
540
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
517
541
|
|
518
542
|
# @private
|
519
543
|
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
|
##
|
@@ -15,7 +15,7 @@ require 'google/shopping/merchant/accounts/v1beta/user_pb'
|
|
15
15
|
require 'google/type/datetime_pb'
|
16
16
|
|
17
17
|
|
18
|
-
descriptor_data = "\n7google/shopping/merchant/accounts/v1beta/accounts.proto\x12(google.shopping.merchant.accounts.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a>google/shopping/merchant/accounts/v1beta/accountservices.proto\x1a\x33google/shopping/merchant/accounts/v1beta/user.proto\x1a\x1agoogle/type/datetime.proto\"\x8a\x02\n\x07\x41\x63\x63ount\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\naccount_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x61\x63\x63ount_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\radult_content\x18\x04 \x01(\x08\x12\x19\n\x0ctest_account\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12-\n\ttime_zone\x18\x06 \x01(\x0b\x32\x15.google.type.TimeZoneB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x07 \x01(\tB\x03\xe0\x41\x02:;\xea\x41\x38\n\"merchantapi.googleapis.com/Account\x12\x12\x61\x63\x63ounts/{account}\"M\n\x11GetAccountRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"merchantapi.googleapis.com/Account\"\x9f\x06\n CreateAndConfigureAccountRequest\x12G\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x31.google.shopping.merchant.accounts.v1beta.AccountB\x03\xe0\x41\x02\x12O\n\x05users\x18\x02 \x03(\x0b\x32;.google.shopping.merchant.accounts.v1beta.CreateUserRequestB\x03\xe0\x41\x01\x12\x8a\x01\n\x17\x61\x63\x63\x65pt_terms_of_service\x18\x03 \x01(\x0b\x32_.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfServiceB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12r\n\x07service\x18\x04 \x03(\x0b\x32\\.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountServiceB\x03\xe0\x41\x02\x1aq\n\x14\x41\x63\x63\x65ptTermsOfService\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)merchantapi.googleapis.com/TermsOfService\x12\x18\n\x0bregion_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\xd0\x01\n\x11\x41\x64\x64\x41\x63\x63ountService\x12[\n\x13\x61\x63\x63ount_aggregation\x18g \x01(\x0b\x32<.google.shopping.merchant.accounts.v1beta.AccountAggregationH\x00\x12\x41\n\x08provider\x18\x01 \x01(\tB*\xe0\x41\x01\xfa\x41$\n\"merchantapi.googleapis.com/AccountH\x01\x88\x01\x01\x42\x0e\n\x0cservice_typeB\x0b\n\t_providerB\x1a\n\x18_accept_terms_of_service\"
|
18
|
+
descriptor_data = "\n7google/shopping/merchant/accounts/v1beta/accounts.proto\x12(google.shopping.merchant.accounts.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a>google/shopping/merchant/accounts/v1beta/accountservices.proto\x1a\x33google/shopping/merchant/accounts/v1beta/user.proto\x1a\x1agoogle/type/datetime.proto\"\x8a\x02\n\x07\x41\x63\x63ount\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\naccount_id\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x61\x63\x63ount_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\radult_content\x18\x04 \x01(\x08\x12\x19\n\x0ctest_account\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12-\n\ttime_zone\x18\x06 \x01(\x0b\x32\x15.google.type.TimeZoneB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x07 \x01(\tB\x03\xe0\x41\x02:;\xea\x41\x38\n\"merchantapi.googleapis.com/Account\x12\x12\x61\x63\x63ounts/{account}\"M\n\x11GetAccountRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"merchantapi.googleapis.com/Account\"\x9f\x06\n CreateAndConfigureAccountRequest\x12G\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x31.google.shopping.merchant.accounts.v1beta.AccountB\x03\xe0\x41\x02\x12O\n\x05users\x18\x02 \x03(\x0b\x32;.google.shopping.merchant.accounts.v1beta.CreateUserRequestB\x03\xe0\x41\x01\x12\x8a\x01\n\x17\x61\x63\x63\x65pt_terms_of_service\x18\x03 \x01(\x0b\x32_.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfServiceB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12r\n\x07service\x18\x04 \x03(\x0b\x32\\.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountServiceB\x03\xe0\x41\x02\x1aq\n\x14\x41\x63\x63\x65ptTermsOfService\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)merchantapi.googleapis.com/TermsOfService\x12\x18\n\x0bregion_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\xd0\x01\n\x11\x41\x64\x64\x41\x63\x63ountService\x12[\n\x13\x61\x63\x63ount_aggregation\x18g \x01(\x0b\x32<.google.shopping.merchant.accounts.v1beta.AccountAggregationH\x00\x12\x41\n\x08provider\x18\x01 \x01(\tB*\xe0\x41\x01\xfa\x41$\n\"merchantapi.googleapis.com/AccountH\x01\x88\x01\x01\x42\x0e\n\x0cservice_typeB\x0b\n\t_providerB\x1a\n\x18_accept_terms_of_service\"d\n\x14\x44\x65leteAccountRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"merchantapi.googleapis.com/Account\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x14UpdateAccountRequest\x12G\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x31.google.shopping.merchant.accounts.v1beta.AccountB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"[\n\x13ListAccountsRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"t\n\x14ListAccountsResponse\x12\x43\n\x08\x61\x63\x63ounts\x18\x01 \x03(\x0b\x32\x31.google.shopping.merchant.accounts.v1beta.Account\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x87\x01\n\x16ListSubAccountsRequest\x12<\n\x08provider\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"merchantapi.googleapis.com/Account\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"w\n\x17ListSubAccountsResponse\x12\x43\n\x08\x61\x63\x63ounts\x18\x01 \x03(\x0b\x32\x31.google.shopping.merchant.accounts.v1beta.Account\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xee\t\n\x0f\x41\x63\x63ountsService\x12\xaf\x01\n\nGetAccount\x12;.google.shopping.merchant.accounts.v1beta.GetAccountRequest\x1a\x31.google.shopping.merchant.accounts.v1beta.Account\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\x12\"/accounts/v1beta/{name=accounts/*}\x12\xd3\x01\n\x19\x43reateAndConfigureAccount\x12J.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest\x1a\x31.google.shopping.merchant.accounts.v1beta.Account\"7\x82\xd3\xe4\x93\x02\x31\",/accounts/v1beta/accounts:createAndConfigure:\x01*\x12\x9a\x01\n\rDeleteAccount\x12>.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest\x1a\x16.google.protobuf.Empty\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$*\"/accounts/v1beta/{name=accounts/*}\x12\xd5\x01\n\rUpdateAccount\x12>.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest\x1a\x31.google.shopping.merchant.accounts.v1beta.Account\"Q\xda\x41\x13\x61\x63\x63ount,update_mask\x82\xd3\xe4\x93\x02\x35\x32*/accounts/v1beta/{account.name=accounts/*}:\x07\x61\x63\x63ount\x12\xb0\x01\n\x0cListAccounts\x12=.google.shopping.merchant.accounts.v1beta.ListAccountsRequest\x1a>.google.shopping.merchant.accounts.v1beta.ListAccountsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/accounts/v1beta/accounts\x12\xe1\x01\n\x0fListSubAccounts\x12@.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest\x1a\x41.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse\"I\xda\x41\x08provider\x82\xd3\xe4\x93\x02\x38\x12\x36/accounts/v1beta/{provider=accounts/*}:listSubaccounts\x1aG\xca\x41\x1amerchantapi.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/contentB\x8f\x01\n,com.google.shopping.merchant.accounts.v1betaB\rAccountsProtoP\x01ZNcloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspbb\x06proto3"
|
19
19
|
|
20
20
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
21
21
|
|