google-shopping-merchant-accounts-v1beta 0.3.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_service/client.rb +29 -7
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +29 -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 +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
- metadata +5 -5
data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_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_shipping_settings 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_shipping_settings",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.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: "insert_shipping_settings",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.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
|
##
|
data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb
CHANGED
@@ -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
|
+
@terms_of_service_agreement_state_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
|
+
@terms_of_service_agreement_state_service_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -251,7 +271,6 @@ module Google
|
|
251
271
|
|
252
272
|
@terms_of_service_agreement_state_service_stub.call_rpc :get_terms_of_service_agreement_state, 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)
|
@@ -338,7 +357,6 @@ module Google
|
|
338
357
|
|
339
358
|
@terms_of_service_agreement_state_service_stub.call_rpc :retrieve_for_application_terms_of_service_agreement_state, request, options: options do |response, operation|
|
340
359
|
yield response, operation if block_given?
|
341
|
-
return response
|
342
360
|
end
|
343
361
|
rescue ::GRPC::BadStatus => e
|
344
362
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -427,6 +445,11 @@ module Google
|
|
427
445
|
# default endpoint URL. The default value of nil uses the environment
|
428
446
|
# universe (usually the default "googleapis.com" universe).
|
429
447
|
# @return [::String,nil]
|
448
|
+
# @!attribute [rw] logger
|
449
|
+
# A custom logger to use for request/response debug logging, or the value
|
450
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
451
|
+
# explicitly disable logging.
|
452
|
+
# @return [::Logger,:default,nil]
|
430
453
|
#
|
431
454
|
class Configuration
|
432
455
|
extend ::Gapic::Config
|
@@ -451,6 +474,7 @@ module Google
|
|
451
474
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
452
475
|
config_attr :quota_project, nil, ::String, nil
|
453
476
|
config_attr :universe_domain, nil, ::String, nil
|
477
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
454
478
|
|
455
479
|
# @private
|
456
480
|
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
|
+
@terms_of_service_agreement_state_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
|
+
@terms_of_service_agreement_state_service_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -237,7 +257,6 @@ module Google
|
|
237
257
|
|
238
258
|
@terms_of_service_agreement_state_service_stub.get_terms_of_service_agreement_state 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)
|
@@ -317,7 +336,6 @@ module Google
|
|
317
336
|
|
318
337
|
@terms_of_service_agreement_state_service_stub.retrieve_for_application_terms_of_service_agreement_state request, options do |result, operation|
|
319
338
|
yield result, operation if block_given?
|
320
|
-
return result
|
321
339
|
end
|
322
340
|
rescue ::Gapic::Rest::Error => e
|
323
341
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -397,6 +415,11 @@ module Google
|
|
397
415
|
# default endpoint URL. The default value of nil uses the environment
|
398
416
|
# universe (usually the default "googleapis.com" universe).
|
399
417
|
# @return [::String,nil]
|
418
|
+
# @!attribute [rw] logger
|
419
|
+
# A custom logger to use for request/response debug logging, or the value
|
420
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
421
|
+
# explicitly disable logging.
|
422
|
+
# @return [::Logger,:default,nil]
|
400
423
|
#
|
401
424
|
class Configuration
|
402
425
|
extend ::Gapic::Config
|
@@ -418,6 +441,7 @@ module Google
|
|
418
441
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
419
442
|
config_attr :quota_project, nil, ::String, nil
|
420
443
|
config_attr :universe_domain, nil, ::String, nil
|
444
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
421
445
|
|
422
446
|
# @private
|
423
447
|
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_terms_of_service_agreement_state 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_terms_of_service_agreement_state",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceAgreementState.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: "retrieve_for_application_terms_of_service_agreement_state",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceAgreementState.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
|
+
@terms_of_service_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
|
+
@terms_of_service_service_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -250,7 +270,6 @@ module Google
|
|
250
270
|
|
251
271
|
@terms_of_service_service_stub.call_rpc :get_terms_of_service, 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)
|
@@ -333,7 +352,6 @@ module Google
|
|
333
352
|
|
334
353
|
@terms_of_service_service_stub.call_rpc :retrieve_latest_terms_of_service, request, options: options do |response, operation|
|
335
354
|
yield response, operation if block_given?
|
336
|
-
return response
|
337
355
|
end
|
338
356
|
rescue ::GRPC::BadStatus => e
|
339
357
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -426,7 +444,6 @@ module Google
|
|
426
444
|
|
427
445
|
@terms_of_service_service_stub.call_rpc :accept_terms_of_service, request, options: options do |response, operation|
|
428
446
|
yield response, operation if block_given?
|
429
|
-
return response
|
430
447
|
end
|
431
448
|
rescue ::GRPC::BadStatus => e
|
432
449
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -515,6 +532,11 @@ module Google
|
|
515
532
|
# default endpoint URL. The default value of nil uses the environment
|
516
533
|
# universe (usually the default "googleapis.com" universe).
|
517
534
|
# @return [::String,nil]
|
535
|
+
# @!attribute [rw] logger
|
536
|
+
# A custom logger to use for request/response debug logging, or the value
|
537
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
538
|
+
# explicitly disable logging.
|
539
|
+
# @return [::Logger,:default,nil]
|
518
540
|
#
|
519
541
|
class Configuration
|
520
542
|
extend ::Gapic::Config
|
@@ -539,6 +561,7 @@ module Google
|
|
539
561
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
540
562
|
config_attr :quota_project, nil, ::String, nil
|
541
563
|
config_attr :universe_domain, nil, ::String, nil
|
564
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
542
565
|
|
543
566
|
# @private
|
544
567
|
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
|
+
@terms_of_service_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
|
+
@terms_of_service_service_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -236,7 +256,6 @@ module Google
|
|
236
256
|
|
237
257
|
@terms_of_service_service_stub.get_terms_of_service 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)
|
@@ -320,7 +339,6 @@ module Google
|
|
320
339
|
|
321
340
|
@terms_of_service_service_stub.retrieve_latest_terms_of_service request, options do |result, operation|
|
322
341
|
yield result, operation if block_given?
|
323
|
-
return result
|
324
342
|
end
|
325
343
|
rescue ::Gapic::Rest::Error => e
|
326
344
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -406,7 +424,6 @@ module Google
|
|
406
424
|
|
407
425
|
@terms_of_service_service_stub.accept_terms_of_service request, options do |result, operation|
|
408
426
|
yield result, operation if block_given?
|
409
|
-
return result
|
410
427
|
end
|
411
428
|
rescue ::Gapic::Rest::Error => e
|
412
429
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -486,6 +503,11 @@ module Google
|
|
486
503
|
# default endpoint URL. The default value of nil uses the environment
|
487
504
|
# universe (usually the default "googleapis.com" universe).
|
488
505
|
# @return [::String,nil]
|
506
|
+
# @!attribute [rw] logger
|
507
|
+
# A custom logger to use for request/response debug logging, or the value
|
508
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
509
|
+
# explicitly disable logging.
|
510
|
+
# @return [::Logger,:default,nil]
|
489
511
|
#
|
490
512
|
class Configuration
|
491
513
|
extend ::Gapic::Config
|
@@ -507,6 +529,7 @@ module Google
|
|
507
529
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
508
530
|
config_attr :quota_project, nil, ::String, nil
|
509
531
|
config_attr :universe_domain, nil, ::String, nil
|
532
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
510
533
|
|
511
534
|
# @private
|
512
535
|
def initialize parent_config = nil
|
data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_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_terms_of_service 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_terms_of_service",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService.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: "retrieve_latest_terms_of_service",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService.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: "accept_terms_of_service",
|
170
187
|
options: options
|
171
188
|
)
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
173
190
|
result = ::Google::Protobuf::Empty.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
|
##
|
@@ -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
|
+
@user_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
|
+
@user_service_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -254,7 +274,6 @@ module Google
|
|
254
274
|
|
255
275
|
@user_service_stub.call_rpc :get_user, request, options: options do |response, operation|
|
256
276
|
yield response, operation if block_given?
|
257
|
-
return response
|
258
277
|
end
|
259
278
|
rescue ::GRPC::BadStatus => e
|
260
279
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -347,7 +366,6 @@ module Google
|
|
347
366
|
|
348
367
|
@user_service_stub.call_rpc :create_user, request, options: options do |response, operation|
|
349
368
|
yield response, operation if block_given?
|
350
|
-
return response
|
351
369
|
end
|
352
370
|
rescue ::GRPC::BadStatus => e
|
353
371
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -438,7 +456,6 @@ module Google
|
|
438
456
|
|
439
457
|
@user_service_stub.call_rpc :delete_user, request, options: options do |response, operation|
|
440
458
|
yield response, operation if block_given?
|
441
|
-
return response
|
442
459
|
end
|
443
460
|
rescue ::GRPC::BadStatus => e
|
444
461
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -530,7 +547,6 @@ module Google
|
|
530
547
|
|
531
548
|
@user_service_stub.call_rpc :update_user, request, options: options do |response, operation|
|
532
549
|
yield response, operation if block_given?
|
533
|
-
return response
|
534
550
|
end
|
535
551
|
rescue ::GRPC::BadStatus => e
|
536
552
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -632,7 +648,7 @@ module Google
|
|
632
648
|
@user_service_stub.call_rpc :list_users, request, options: options do |response, operation|
|
633
649
|
response = ::Gapic::PagedEnumerable.new @user_service_stub, :list_users, request, response, operation, options
|
634
650
|
yield response, operation if block_given?
|
635
|
-
|
651
|
+
throw :response, response
|
636
652
|
end
|
637
653
|
rescue ::GRPC::BadStatus => e
|
638
654
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -721,6 +737,11 @@ module Google
|
|
721
737
|
# default endpoint URL. The default value of nil uses the environment
|
722
738
|
# universe (usually the default "googleapis.com" universe).
|
723
739
|
# @return [::String,nil]
|
740
|
+
# @!attribute [rw] logger
|
741
|
+
# A custom logger to use for request/response debug logging, or the value
|
742
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
743
|
+
# explicitly disable logging.
|
744
|
+
# @return [::Logger,:default,nil]
|
724
745
|
#
|
725
746
|
class Configuration
|
726
747
|
extend ::Gapic::Config
|
@@ -745,6 +766,7 @@ module Google
|
|
745
766
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
746
767
|
config_attr :quota_project, nil, ::String, nil
|
747
768
|
config_attr :universe_domain, nil, ::String, nil
|
769
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
748
770
|
|
749
771
|
# @private
|
750
772
|
def initialize parent_config = nil
|