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
@@ -164,8 +164,28 @@ module Google
|
|
164
164
|
universe_domain: @config.universe_domain,
|
165
165
|
channel_args: @config.channel_args,
|
166
166
|
interceptors: @config.interceptors,
|
167
|
-
channel_pool_config: @config.channel_pool
|
167
|
+
channel_pool_config: @config.channel_pool,
|
168
|
+
logger: @config.logger
|
168
169
|
)
|
170
|
+
|
171
|
+
@business_identity_service_stub.stub_logger&.info do |entry|
|
172
|
+
entry.set_system_name
|
173
|
+
entry.set_service
|
174
|
+
entry.message = "Created client for #{entry.service}"
|
175
|
+
entry.set_credentials_fields credentials
|
176
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
177
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
178
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# The logger used for request/response debug logging.
|
184
|
+
#
|
185
|
+
# @return [Logger]
|
186
|
+
#
|
187
|
+
def logger
|
188
|
+
@business_identity_service_stub.logger
|
169
189
|
end
|
170
190
|
|
171
191
|
# Service calls
|
@@ -251,7 +271,6 @@ module Google
|
|
251
271
|
|
252
272
|
@business_identity_service_stub.call_rpc :get_business_identity, request, options: options do |response, operation|
|
253
273
|
yield response, operation if block_given?
|
254
|
-
return response
|
255
274
|
end
|
256
275
|
rescue ::GRPC::BadStatus => e
|
257
276
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -340,7 +359,6 @@ module Google
|
|
340
359
|
|
341
360
|
@business_identity_service_stub.call_rpc :update_business_identity, request, options: options do |response, operation|
|
342
361
|
yield response, operation if block_given?
|
343
|
-
return response
|
344
362
|
end
|
345
363
|
rescue ::GRPC::BadStatus => e
|
346
364
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,6 +408,13 @@ module Google
|
|
390
408
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
391
409
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
392
410
|
# * (`nil`) indicating no credentials
|
411
|
+
#
|
412
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
413
|
+
# external source for authentication to Google Cloud, you must validate it before
|
414
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
415
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
416
|
+
# For more information, refer to [Validate credential configurations from external
|
417
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
393
418
|
# @return [::Object]
|
394
419
|
# @!attribute [rw] scope
|
395
420
|
# The OAuth scopes
|
@@ -429,6 +454,11 @@ module Google
|
|
429
454
|
# default endpoint URL. The default value of nil uses the environment
|
430
455
|
# universe (usually the default "googleapis.com" universe).
|
431
456
|
# @return [::String,nil]
|
457
|
+
# @!attribute [rw] logger
|
458
|
+
# A custom logger to use for request/response debug logging, or the value
|
459
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
460
|
+
# explicitly disable logging.
|
461
|
+
# @return [::Logger,:default,nil]
|
432
462
|
#
|
433
463
|
class Configuration
|
434
464
|
extend ::Gapic::Config
|
@@ -453,6 +483,7 @@ module Google
|
|
453
483
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
454
484
|
config_attr :quota_project, nil, ::String, nil
|
455
485
|
config_attr :universe_domain, nil, ::String, nil
|
486
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
456
487
|
|
457
488
|
# @private
|
458
489
|
def initialize parent_config = nil
|
@@ -157,8 +157,28 @@ module Google
|
|
157
157
|
endpoint: @config.endpoint,
|
158
158
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
159
159
|
universe_domain: @config.universe_domain,
|
160
|
-
credentials: credentials
|
160
|
+
credentials: credentials,
|
161
|
+
logger: @config.logger
|
161
162
|
)
|
163
|
+
|
164
|
+
@business_identity_service_stub.logger(stub: true)&.info do |entry|
|
165
|
+
entry.set_system_name
|
166
|
+
entry.set_service
|
167
|
+
entry.message = "Created client for #{entry.service}"
|
168
|
+
entry.set_credentials_fields credentials
|
169
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
170
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
171
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# The logger used for request/response debug logging.
|
177
|
+
#
|
178
|
+
# @return [Logger]
|
179
|
+
#
|
180
|
+
def logger
|
181
|
+
@business_identity_service_stub.logger
|
162
182
|
end
|
163
183
|
|
164
184
|
# Service calls
|
@@ -237,7 +257,6 @@ module Google
|
|
237
257
|
|
238
258
|
@business_identity_service_stub.get_business_identity request, options do |result, operation|
|
239
259
|
yield result, operation if block_given?
|
240
|
-
return result
|
241
260
|
end
|
242
261
|
rescue ::Gapic::Rest::Error => e
|
243
262
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -319,7 +338,6 @@ module Google
|
|
319
338
|
|
320
339
|
@business_identity_service_stub.update_business_identity request, options do |result, operation|
|
321
340
|
yield result, operation if block_given?
|
322
|
-
return result
|
323
341
|
end
|
324
342
|
rescue ::Gapic::Rest::Error => e
|
325
343
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -367,6 +385,13 @@ module Google
|
|
367
385
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
368
386
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
369
387
|
# * (`nil`) indicating no credentials
|
388
|
+
#
|
389
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
390
|
+
# external source for authentication to Google Cloud, you must validate it before
|
391
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
392
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
393
|
+
# For more information, refer to [Validate credential configurations from external
|
394
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
370
395
|
# @return [::Object]
|
371
396
|
# @!attribute [rw] scope
|
372
397
|
# The OAuth scopes
|
@@ -399,6 +424,11 @@ module Google
|
|
399
424
|
# default endpoint URL. The default value of nil uses the environment
|
400
425
|
# universe (usually the default "googleapis.com" universe).
|
401
426
|
# @return [::String,nil]
|
427
|
+
# @!attribute [rw] logger
|
428
|
+
# A custom logger to use for request/response debug logging, or the value
|
429
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
430
|
+
# explicitly disable logging.
|
431
|
+
# @return [::Logger,:default,nil]
|
402
432
|
#
|
403
433
|
class Configuration
|
404
434
|
extend ::Gapic::Config
|
@@ -420,6 +450,7 @@ module Google
|
|
420
450
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
421
451
|
config_attr :quota_project, nil, ::String, nil
|
422
452
|
config_attr :universe_domain, nil, ::String, nil
|
453
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
423
454
|
|
424
455
|
# @private
|
425
456
|
def initialize parent_config = nil
|
data/lib/google/shopping/merchant/accounts/v1beta/business_identity_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 get_business_identity 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_business_identity",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::BusinessIdentity.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: "update_business_identity",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::BusinessIdentity.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
|
##
|
@@ -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
|
+
@business_info_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
|
+
@business_info_service_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -250,7 +270,6 @@ module Google
|
|
250
270
|
|
251
271
|
@business_info_service_stub.call_rpc :get_business_info, request, options: options do |response, operation|
|
252
272
|
yield response, operation if block_given?
|
253
|
-
return response
|
254
273
|
end
|
255
274
|
rescue ::GRPC::BadStatus => e
|
256
275
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -339,7 +358,6 @@ module Google
|
|
339
358
|
|
340
359
|
@business_info_service_stub.call_rpc :update_business_info, request, options: options do |response, operation|
|
341
360
|
yield response, operation if block_given?
|
342
|
-
return response
|
343
361
|
end
|
344
362
|
rescue ::GRPC::BadStatus => e
|
345
363
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -389,6 +407,13 @@ module Google
|
|
389
407
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
390
408
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
391
409
|
# * (`nil`) indicating no credentials
|
410
|
+
#
|
411
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
412
|
+
# external source for authentication to Google Cloud, you must validate it before
|
413
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
414
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
415
|
+
# For more information, refer to [Validate credential configurations from external
|
416
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
392
417
|
# @return [::Object]
|
393
418
|
# @!attribute [rw] scope
|
394
419
|
# The OAuth scopes
|
@@ -428,6 +453,11 @@ module Google
|
|
428
453
|
# default endpoint URL. The default value of nil uses the environment
|
429
454
|
# universe (usually the default "googleapis.com" universe).
|
430
455
|
# @return [::String,nil]
|
456
|
+
# @!attribute [rw] logger
|
457
|
+
# A custom logger to use for request/response debug logging, or the value
|
458
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
459
|
+
# explicitly disable logging.
|
460
|
+
# @return [::Logger,:default,nil]
|
431
461
|
#
|
432
462
|
class Configuration
|
433
463
|
extend ::Gapic::Config
|
@@ -452,6 +482,7 @@ module Google
|
|
452
482
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
453
483
|
config_attr :quota_project, nil, ::String, nil
|
454
484
|
config_attr :universe_domain, nil, ::String, nil
|
485
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
455
486
|
|
456
487
|
# @private
|
457
488
|
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
|
+
@business_info_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
|
+
@business_info_service_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -236,7 +256,6 @@ module Google
|
|
236
256
|
|
237
257
|
@business_info_service_stub.get_business_info request, options do |result, operation|
|
238
258
|
yield result, operation if block_given?
|
239
|
-
return result
|
240
259
|
end
|
241
260
|
rescue ::Gapic::Rest::Error => e
|
242
261
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -318,7 +337,6 @@ module Google
|
|
318
337
|
|
319
338
|
@business_info_service_stub.update_business_info request, options do |result, operation|
|
320
339
|
yield result, operation if block_given?
|
321
|
-
return result
|
322
340
|
end
|
323
341
|
rescue ::Gapic::Rest::Error => e
|
324
342
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -366,6 +384,13 @@ module Google
|
|
366
384
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
367
385
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
368
386
|
# * (`nil`) indicating no credentials
|
387
|
+
#
|
388
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
389
|
+
# external source for authentication to Google Cloud, you must validate it before
|
390
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
391
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
392
|
+
# For more information, refer to [Validate credential configurations from external
|
393
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
369
394
|
# @return [::Object]
|
370
395
|
# @!attribute [rw] scope
|
371
396
|
# The OAuth scopes
|
@@ -398,6 +423,11 @@ module Google
|
|
398
423
|
# default endpoint URL. The default value of nil uses the environment
|
399
424
|
# universe (usually the default "googleapis.com" universe).
|
400
425
|
# @return [::String,nil]
|
426
|
+
# @!attribute [rw] logger
|
427
|
+
# A custom logger to use for request/response debug logging, or the value
|
428
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
429
|
+
# explicitly disable logging.
|
430
|
+
# @return [::Logger,:default,nil]
|
401
431
|
#
|
402
432
|
class Configuration
|
403
433
|
extend ::Gapic::Config
|
@@ -419,6 +449,7 @@ module Google
|
|
419
449
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
420
450
|
config_attr :quota_project, nil, ::String, nil
|
421
451
|
config_attr :universe_domain, nil, ::String, nil
|
452
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
422
453
|
|
423
454
|
# @private
|
424
455
|
def initialize parent_config = nil
|
data/lib/google/shopping/merchant/accounts/v1beta/business_info_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 get_business_info 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_business_info",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::BusinessInfo.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: "update_business_info",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::BusinessInfo.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
|
##
|
@@ -166,8 +166,28 @@ module Google
|
|
166
166
|
universe_domain: @config.universe_domain,
|
167
167
|
channel_args: @config.channel_args,
|
168
168
|
interceptors: @config.interceptors,
|
169
|
-
channel_pool_config: @config.channel_pool
|
169
|
+
channel_pool_config: @config.channel_pool,
|
170
|
+
logger: @config.logger
|
170
171
|
)
|
172
|
+
|
173
|
+
@email_preferences_service_stub.stub_logger&.info do |entry|
|
174
|
+
entry.set_system_name
|
175
|
+
entry.set_service
|
176
|
+
entry.message = "Created client for #{entry.service}"
|
177
|
+
entry.set_credentials_fields credentials
|
178
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
179
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
180
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# The logger used for request/response debug logging.
|
186
|
+
#
|
187
|
+
# @return [Logger]
|
188
|
+
#
|
189
|
+
def logger
|
190
|
+
@email_preferences_service_stub.logger
|
171
191
|
end
|
172
192
|
|
173
193
|
# Service calls
|
@@ -256,7 +276,6 @@ module Google
|
|
256
276
|
|
257
277
|
@email_preferences_service_stub.call_rpc :get_email_preferences, request, options: options do |response, operation|
|
258
278
|
yield response, operation if block_given?
|
259
|
-
return response
|
260
279
|
end
|
261
280
|
rescue ::GRPC::BadStatus => e
|
262
281
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -354,7 +373,6 @@ module Google
|
|
354
373
|
|
355
374
|
@email_preferences_service_stub.call_rpc :update_email_preferences, request, options: options do |response, operation|
|
356
375
|
yield response, operation if block_given?
|
357
|
-
return response
|
358
376
|
end
|
359
377
|
rescue ::GRPC::BadStatus => e
|
360
378
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -404,6 +422,13 @@ module Google
|
|
404
422
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
405
423
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
406
424
|
# * (`nil`) indicating no credentials
|
425
|
+
#
|
426
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
427
|
+
# external source for authentication to Google Cloud, you must validate it before
|
428
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
429
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
430
|
+
# For more information, refer to [Validate credential configurations from external
|
431
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
407
432
|
# @return [::Object]
|
408
433
|
# @!attribute [rw] scope
|
409
434
|
# The OAuth scopes
|
@@ -443,6 +468,11 @@ module Google
|
|
443
468
|
# default endpoint URL. The default value of nil uses the environment
|
444
469
|
# universe (usually the default "googleapis.com" universe).
|
445
470
|
# @return [::String,nil]
|
471
|
+
# @!attribute [rw] logger
|
472
|
+
# A custom logger to use for request/response debug logging, or the value
|
473
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
474
|
+
# explicitly disable logging.
|
475
|
+
# @return [::Logger,:default,nil]
|
446
476
|
#
|
447
477
|
class Configuration
|
448
478
|
extend ::Gapic::Config
|
@@ -467,6 +497,7 @@ module Google
|
|
467
497
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
468
498
|
config_attr :quota_project, nil, ::String, nil
|
469
499
|
config_attr :universe_domain, nil, ::String, nil
|
500
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
470
501
|
|
471
502
|
# @private
|
472
503
|
def initialize parent_config = nil
|
@@ -159,8 +159,28 @@ module Google
|
|
159
159
|
endpoint: @config.endpoint,
|
160
160
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
161
161
|
universe_domain: @config.universe_domain,
|
162
|
-
credentials: credentials
|
162
|
+
credentials: credentials,
|
163
|
+
logger: @config.logger
|
163
164
|
)
|
165
|
+
|
166
|
+
@email_preferences_service_stub.logger(stub: true)&.info do |entry|
|
167
|
+
entry.set_system_name
|
168
|
+
entry.set_service
|
169
|
+
entry.message = "Created client for #{entry.service}"
|
170
|
+
entry.set_credentials_fields credentials
|
171
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
172
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
173
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# The logger used for request/response debug logging.
|
179
|
+
#
|
180
|
+
# @return [Logger]
|
181
|
+
#
|
182
|
+
def logger
|
183
|
+
@email_preferences_service_stub.logger
|
164
184
|
end
|
165
185
|
|
166
186
|
# Service calls
|
@@ -242,7 +262,6 @@ module Google
|
|
242
262
|
|
243
263
|
@email_preferences_service_stub.get_email_preferences request, options do |result, operation|
|
244
264
|
yield result, operation if block_given?
|
245
|
-
return result
|
246
265
|
end
|
247
266
|
rescue ::Gapic::Rest::Error => e
|
248
267
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -333,7 +352,6 @@ module Google
|
|
333
352
|
|
334
353
|
@email_preferences_service_stub.update_email_preferences request, options do |result, operation|
|
335
354
|
yield result, operation if block_given?
|
336
|
-
return result
|
337
355
|
end
|
338
356
|
rescue ::Gapic::Rest::Error => e
|
339
357
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -381,6 +399,13 @@ module Google
|
|
381
399
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
382
400
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
383
401
|
# * (`nil`) indicating no credentials
|
402
|
+
#
|
403
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
404
|
+
# external source for authentication to Google Cloud, you must validate it before
|
405
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
406
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
407
|
+
# For more information, refer to [Validate credential configurations from external
|
408
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
384
409
|
# @return [::Object]
|
385
410
|
# @!attribute [rw] scope
|
386
411
|
# The OAuth scopes
|
@@ -413,6 +438,11 @@ module Google
|
|
413
438
|
# default endpoint URL. The default value of nil uses the environment
|
414
439
|
# universe (usually the default "googleapis.com" universe).
|
415
440
|
# @return [::String,nil]
|
441
|
+
# @!attribute [rw] logger
|
442
|
+
# A custom logger to use for request/response debug logging, or the value
|
443
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
444
|
+
# explicitly disable logging.
|
445
|
+
# @return [::Logger,:default,nil]
|
416
446
|
#
|
417
447
|
class Configuration
|
418
448
|
extend ::Gapic::Config
|
@@ -434,6 +464,7 @@ module Google
|
|
434
464
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
435
465
|
config_attr :quota_project, nil, ::String, nil
|
436
466
|
config_attr :universe_domain, nil, ::String, nil
|
467
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
437
468
|
|
438
469
|
# @private
|
439
470
|
def initialize parent_config = nil
|