google-cloud-api_hub-v1 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +31 -21
  4. data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +36 -36
  5. data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +294 -212
  6. data/lib/google/cloud/api_hub/v1/api_hub.rb +0 -7
  7. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/client.rb +29 -6
  8. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/service_stub.rb +54 -32
  9. data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +0 -7
  10. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +28 -4
  11. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +38 -20
  12. data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +0 -7
  13. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/client.rb +29 -4
  14. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/service_stub.rb +38 -20
  15. data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +0 -7
  16. data/lib/google/cloud/api_hub/v1/linting_service/rest/client.rb +28 -5
  17. data/lib/google/cloud/api_hub/v1/linting_service/rest/service_stub.rb +46 -26
  18. data/lib/google/cloud/api_hub/v1/linting_service.rb +0 -7
  19. data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +29 -4
  20. data/lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb +43 -38
  21. data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +38 -20
  22. data/lib/google/cloud/api_hub/v1/provisioning.rb +0 -8
  23. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/client.rb +29 -6
  24. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/service_stub.rb +54 -32
  25. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +0 -7
  26. data/lib/google/cloud/api_hub/v1/version.rb +1 -1
  27. data/lib/google/cloud/api_hub/v1.rb +0 -5
  28. data/proto_docs/google/api/client.rb +39 -0
  29. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +47 -47
  30. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1 -1
  31. data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +4 -4
  32. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +3 -3
  33. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +4 -4
  34. data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +7 -7
  35. data/proto_docs/google/longrunning/operations.rb +19 -14
  36. metadata +5 -13
  37. data/lib/google/cloud/api_hub/v1/api_hub/client.rb +0 -4514
  38. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +0 -906
  39. data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +0 -640
  40. data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +0 -689
  41. data/lib/google/cloud/api_hub/v1/linting_service/client.rb +0 -744
  42. data/lib/google/cloud/api_hub/v1/provisioning/client.rb +0 -676
  43. data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +0 -809
  44. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +0 -885
@@ -16,7 +16,6 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/common"
20
19
  require "gapic/config"
21
20
  require "gapic/config/method"
22
21
 
@@ -24,7 +23,6 @@ require "google/cloud/api_hub/v1/version"
24
23
 
25
24
  require "google/cloud/api_hub/v1/api_hub/credentials"
26
25
  require "google/cloud/api_hub/v1/api_hub/paths"
27
- require "google/cloud/api_hub/v1/api_hub/client"
28
26
  require "google/cloud/api_hub/v1/api_hub/rest"
29
27
 
30
28
  module Google
@@ -34,11 +32,6 @@ module Google
34
32
  ##
35
33
  # This service provides all methods related to the API hub.
36
34
  #
37
- # @example Load this service and instantiate a gRPC client
38
- #
39
- # require "google/cloud/api_hub/v1/api_hub"
40
- # client = ::Google::Cloud::ApiHub::V1::ApiHub::Client.new
41
- #
42
35
  # @example Load this service and instantiate a REST client
43
36
  #
44
37
  # require "google/cloud/api_hub/v1/api_hub/rest"
@@ -168,15 +168,27 @@ module Google
168
168
  endpoint: @config.endpoint,
169
169
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
170
  universe_domain: @config.universe_domain,
171
- credentials: credentials
171
+ credentials: credentials,
172
+ logger: @config.logger
172
173
  )
173
174
 
175
+ @api_hub_dependencies_stub.logger(stub: true)&.info do |entry|
176
+ entry.set_system_name
177
+ entry.set_service
178
+ entry.message = "Created client for #{entry.service}"
179
+ entry.set_credentials_fields credentials
180
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
181
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
182
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
183
+ end
184
+
174
185
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
175
186
  config.credentials = credentials
176
187
  config.quota_project = @quota_project_id
177
188
  config.endpoint = @api_hub_dependencies_stub.endpoint
178
189
  config.universe_domain = @api_hub_dependencies_stub.universe_domain
179
190
  config.bindings_override = @config.bindings_override
191
+ config.logger = @api_hub_dependencies_stub.logger if config.respond_to? :logger=
180
192
  end
181
193
  end
182
194
 
@@ -187,6 +199,15 @@ module Google
187
199
  #
188
200
  attr_reader :location_client
189
201
 
202
+ ##
203
+ # The logger used for request/response debug logging.
204
+ #
205
+ # @return [Logger]
206
+ #
207
+ def logger
208
+ @api_hub_dependencies_stub.logger
209
+ end
210
+
190
211
  # Service calls
191
212
 
192
213
  ##
@@ -274,7 +295,6 @@ module Google
274
295
 
275
296
  @api_hub_dependencies_stub.create_dependency request, options do |result, operation|
276
297
  yield result, operation if block_given?
277
- return result
278
298
  end
279
299
  rescue ::Gapic::Rest::Error => e
280
300
  raise ::Google::Cloud::Error.from_error(e)
@@ -354,7 +374,6 @@ module Google
354
374
 
355
375
  @api_hub_dependencies_stub.get_dependency request, options do |result, operation|
356
376
  yield result, operation if block_given?
357
- return result
358
377
  end
359
378
  rescue ::Gapic::Rest::Error => e
360
379
  raise ::Google::Cloud::Error.from_error(e)
@@ -444,7 +463,6 @@ module Google
444
463
 
445
464
  @api_hub_dependencies_stub.update_dependency request, options do |result, operation|
446
465
  yield result, operation if block_given?
447
- return result
448
466
  end
449
467
  rescue ::Gapic::Rest::Error => e
450
468
  raise ::Google::Cloud::Error.from_error(e)
@@ -524,7 +542,6 @@ module Google
524
542
 
525
543
  @api_hub_dependencies_stub.delete_dependency request, options do |result, operation|
526
544
  yield result, operation if block_given?
527
- return result
528
545
  end
529
546
  rescue ::Gapic::Rest::Error => e
530
547
  raise ::Google::Cloud::Error.from_error(e)
@@ -655,7 +672,7 @@ module Google
655
672
  @api_hub_dependencies_stub.list_dependencies request, options do |result, operation|
656
673
  result = ::Gapic::Rest::PagedEnumerable.new @api_hub_dependencies_stub, :list_dependencies, "dependencies", request, result, options
657
674
  yield result, operation if block_given?
658
- return result
675
+ throw :response, result
659
676
  end
660
677
  rescue ::Gapic::Rest::Error => e
661
678
  raise ::Google::Cloud::Error.from_error(e)
@@ -735,6 +752,11 @@ module Google
735
752
  # default endpoint URL. The default value of nil uses the environment
736
753
  # universe (usually the default "googleapis.com" universe).
737
754
  # @return [::String,nil]
755
+ # @!attribute [rw] logger
756
+ # A custom logger to use for request/response debug logging, or the value
757
+ # `:default` (the default) to construct a default logger, or `nil` to
758
+ # explicitly disable logging.
759
+ # @return [::Logger,:default,nil]
738
760
  #
739
761
  class Configuration
740
762
  extend ::Gapic::Config
@@ -763,6 +785,7 @@ module Google
763
785
  # by the host service.
764
786
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
765
787
  config_attr :bindings_override, {}, ::Hash, nil
788
+ config_attr :logger, :default, ::Logger, nil, :default
766
789
 
767
790
  # @private
768
791
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_dependency REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_dependency",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ApiHub::V1::Dependency.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_dependency",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ApiHub::V1::Dependency.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "update_dependency",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::ApiHub::V1::Dependency.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "delete_dependency",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "list_dependencies",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::ApiHub::V1::ListDependenciesResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -16,7 +16,6 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/common"
20
19
  require "gapic/config"
21
20
  require "gapic/config/method"
22
21
 
@@ -24,7 +23,6 @@ require "google/cloud/api_hub/v1/version"
24
23
 
25
24
  require "google/cloud/api_hub/v1/api_hub_dependencies/credentials"
26
25
  require "google/cloud/api_hub/v1/api_hub_dependencies/paths"
27
- require "google/cloud/api_hub/v1/api_hub_dependencies/client"
28
26
  require "google/cloud/api_hub/v1/api_hub_dependencies/rest"
29
27
 
30
28
  module Google
@@ -35,11 +33,6 @@ module Google
35
33
  # This service provides methods for various operations related to a
36
34
  # {::Google::Cloud::ApiHub::V1::Dependency Dependency} in the API hub.
37
35
  #
38
- # @example Load this service and instantiate a gRPC client
39
- #
40
- # require "google/cloud/api_hub/v1/api_hub_dependencies"
41
- # client = ::Google::Cloud::ApiHub::V1::ApiHubDependencies::Client.new
42
- #
43
36
  # @example Load this service and instantiate a REST client
44
37
  #
45
38
  # require "google/cloud/api_hub/v1/api_hub_dependencies/rest"
@@ -160,15 +160,27 @@ 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
  )
165
166
 
167
+ @api_hub_plugin_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
+
166
177
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
178
  config.credentials = credentials
168
179
  config.quota_project = @quota_project_id
169
180
  config.endpoint = @api_hub_plugin_stub.endpoint
170
181
  config.universe_domain = @api_hub_plugin_stub.universe_domain
171
182
  config.bindings_override = @config.bindings_override
183
+ config.logger = @api_hub_plugin_stub.logger if config.respond_to? :logger=
172
184
  end
173
185
  end
174
186
 
@@ -179,6 +191,15 @@ module Google
179
191
  #
180
192
  attr_reader :location_client
181
193
 
194
+ ##
195
+ # The logger used for request/response debug logging.
196
+ #
197
+ # @return [Logger]
198
+ #
199
+ def logger
200
+ @api_hub_plugin_stub.logger
201
+ end
202
+
182
203
  # Service calls
183
204
 
184
205
  ##
@@ -255,7 +276,6 @@ module Google
255
276
 
256
277
  @api_hub_plugin_stub.get_plugin request, options do |result, operation|
257
278
  yield result, operation if block_given?
258
- return result
259
279
  end
260
280
  rescue ::Gapic::Rest::Error => e
261
281
  raise ::Google::Cloud::Error.from_error(e)
@@ -336,7 +356,6 @@ module Google
336
356
 
337
357
  @api_hub_plugin_stub.enable_plugin request, options do |result, operation|
338
358
  yield result, operation if block_given?
339
- return result
340
359
  end
341
360
  rescue ::Gapic::Rest::Error => e
342
361
  raise ::Google::Cloud::Error.from_error(e)
@@ -417,7 +436,6 @@ module Google
417
436
 
418
437
  @api_hub_plugin_stub.disable_plugin request, options do |result, operation|
419
438
  yield result, operation if block_given?
420
- return result
421
439
  end
422
440
  rescue ::Gapic::Rest::Error => e
423
441
  raise ::Google::Cloud::Error.from_error(e)
@@ -497,6 +515,11 @@ module Google
497
515
  # default endpoint URL. The default value of nil uses the environment
498
516
  # universe (usually the default "googleapis.com" universe).
499
517
  # @return [::String,nil]
518
+ # @!attribute [rw] logger
519
+ # A custom logger to use for request/response debug logging, or the value
520
+ # `:default` (the default) to construct a default logger, or `nil` to
521
+ # explicitly disable logging.
522
+ # @return [::Logger,:default,nil]
500
523
  #
501
524
  class Configuration
502
525
  extend ::Gapic::Config
@@ -525,6 +548,7 @@ module Google
525
548
  # by the host service.
526
549
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
527
550
  config_attr :bindings_override, {}, ::Hash, nil
551
+ config_attr :logger, :default, ::Logger, nil, :default
528
552
 
529
553
  # @private
530
554
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_plugin REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_plugin",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ApiHub::V1::Plugin.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "enable_plugin",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ApiHub::V1::Plugin.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "disable_plugin",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::ApiHub::V1::Plugin.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -16,7 +16,6 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/common"
20
19
  require "gapic/config"
21
20
  require "gapic/config/method"
22
21
 
@@ -24,7 +23,6 @@ require "google/cloud/api_hub/v1/version"
24
23
 
25
24
  require "google/cloud/api_hub/v1/api_hub_plugin/credentials"
26
25
  require "google/cloud/api_hub/v1/api_hub_plugin/paths"
27
- require "google/cloud/api_hub/v1/api_hub_plugin/client"
28
26
  require "google/cloud/api_hub/v1/api_hub_plugin/rest"
29
27
 
30
28
  module Google
@@ -34,11 +32,6 @@ module Google
34
32
  ##
35
33
  # This service is used for managing plugins inside the API Hub.
36
34
  #
37
- # @example Load this service and instantiate a gRPC client
38
- #
39
- # require "google/cloud/api_hub/v1/api_hub_plugin"
40
- # client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Client.new
41
- #
42
35
  # @example Load this service and instantiate a REST client
43
36
  #
44
37
  # require "google/cloud/api_hub/v1/api_hub_plugin/rest"
@@ -163,15 +163,27 @@ module Google
163
163
  endpoint: @config.endpoint,
164
164
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
165
  universe_domain: @config.universe_domain,
166
- credentials: credentials
166
+ credentials: credentials,
167
+ logger: @config.logger
167
168
  )
168
169
 
170
+ @host_project_registration_service_stub.logger(stub: true)&.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
+
169
180
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
181
  config.credentials = credentials
171
182
  config.quota_project = @quota_project_id
172
183
  config.endpoint = @host_project_registration_service_stub.endpoint
173
184
  config.universe_domain = @host_project_registration_service_stub.universe_domain
174
185
  config.bindings_override = @config.bindings_override
186
+ config.logger = @host_project_registration_service_stub.logger if config.respond_to? :logger=
175
187
  end
176
188
  end
177
189
 
@@ -182,6 +194,15 @@ module Google
182
194
  #
183
195
  attr_reader :location_client
184
196
 
197
+ ##
198
+ # The logger used for request/response debug logging.
199
+ #
200
+ # @return [Logger]
201
+ #
202
+ def logger
203
+ @host_project_registration_service_stub.logger
204
+ end
205
+
185
206
  # Service calls
186
207
 
187
208
  ##
@@ -269,7 +290,6 @@ module Google
269
290
 
270
291
  @host_project_registration_service_stub.create_host_project_registration request, options do |result, operation|
271
292
  yield result, operation if block_given?
272
- return result
273
293
  end
274
294
  rescue ::Gapic::Rest::Error => e
275
295
  raise ::Google::Cloud::Error.from_error(e)
@@ -349,7 +369,6 @@ module Google
349
369
 
350
370
  @host_project_registration_service_stub.get_host_project_registration request, options do |result, operation|
351
371
  yield result, operation if block_given?
352
- return result
353
372
  end
354
373
  rescue ::Gapic::Rest::Error => e
355
374
  raise ::Google::Cloud::Error.from_error(e)
@@ -466,7 +485,7 @@ module Google
466
485
  @host_project_registration_service_stub.list_host_project_registrations request, options do |result, operation|
467
486
  result = ::Gapic::Rest::PagedEnumerable.new @host_project_registration_service_stub, :list_host_project_registrations, "host_project_registrations", request, result, options
468
487
  yield result, operation if block_given?
469
- return result
488
+ throw :response, result
470
489
  end
471
490
  rescue ::Gapic::Rest::Error => e
472
491
  raise ::Google::Cloud::Error.from_error(e)
@@ -546,6 +565,11 @@ module Google
546
565
  # default endpoint URL. The default value of nil uses the environment
547
566
  # universe (usually the default "googleapis.com" universe).
548
567
  # @return [::String,nil]
568
+ # @!attribute [rw] logger
569
+ # A custom logger to use for request/response debug logging, or the value
570
+ # `:default` (the default) to construct a default logger, or `nil` to
571
+ # explicitly disable logging.
572
+ # @return [::Logger,:default,nil]
549
573
  #
550
574
  class Configuration
551
575
  extend ::Gapic::Config
@@ -574,6 +598,7 @@ module Google
574
598
  # by the host service.
575
599
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
576
600
  config_attr :bindings_override, {}, ::Hash, nil
601
+ config_attr :logger, :default, ::Logger, nil, :default
577
602
 
578
603
  # @private
579
604
  def initialize parent_config = nil