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
@@ -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_api_hub_instance 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_api_hub_instance",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Longrunning::Operation.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_api_hub_instance",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ApiHub::V1::ApiHubInstance.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: "lookup_api_hub_instance",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::ApiHub::V1::LookupApiHubInstanceResponse.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,8 +23,6 @@ require "google/cloud/api_hub/v1/version"
24
23
 
25
24
  require "google/cloud/api_hub/v1/provisioning/credentials"
26
25
  require "google/cloud/api_hub/v1/provisioning/paths"
27
- require "google/cloud/api_hub/v1/provisioning/operations"
28
- require "google/cloud/api_hub/v1/provisioning/client"
29
26
  require "google/cloud/api_hub/v1/provisioning/rest"
30
27
 
31
28
  module Google
@@ -35,11 +32,6 @@ module Google
35
32
  ##
36
33
  # This service is used for managing the data plane provisioning of the API hub.
37
34
  #
38
- # @example Load this service and instantiate a gRPC client
39
- #
40
- # require "google/cloud/api_hub/v1/provisioning"
41
- # client = ::Google::Cloud::ApiHub::V1::Provisioning::Client.new
42
- #
43
35
  # @example Load this service and instantiate a REST client
44
36
  #
45
37
  # require "google/cloud/api_hub/v1/provisioning/rest"
@@ -170,15 +170,27 @@ module Google
170
170
  endpoint: @config.endpoint,
171
171
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
172
  universe_domain: @config.universe_domain,
173
- credentials: credentials
173
+ credentials: credentials,
174
+ logger: @config.logger
174
175
  )
175
176
 
177
+ @runtime_project_attachment_service_stub.logger(stub: true)&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
176
187
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
177
188
  config.credentials = credentials
178
189
  config.quota_project = @quota_project_id
179
190
  config.endpoint = @runtime_project_attachment_service_stub.endpoint
180
191
  config.universe_domain = @runtime_project_attachment_service_stub.universe_domain
181
192
  config.bindings_override = @config.bindings_override
193
+ config.logger = @runtime_project_attachment_service_stub.logger if config.respond_to? :logger=
182
194
  end
183
195
  end
184
196
 
@@ -189,6 +201,15 @@ module Google
189
201
  #
190
202
  attr_reader :location_client
191
203
 
204
+ ##
205
+ # The logger used for request/response debug logging.
206
+ #
207
+ # @return [Logger]
208
+ #
209
+ def logger
210
+ @runtime_project_attachment_service_stub.logger
211
+ end
212
+
192
213
  # Service calls
193
214
 
194
215
  ##
@@ -272,7 +293,6 @@ module Google
272
293
 
273
294
  @runtime_project_attachment_service_stub.create_runtime_project_attachment request, options do |result, operation|
274
295
  yield result, operation if block_given?
275
- return result
276
296
  end
277
297
  rescue ::Gapic::Rest::Error => e
278
298
  raise ::Google::Cloud::Error.from_error(e)
@@ -353,7 +373,6 @@ module Google
353
373
 
354
374
  @runtime_project_attachment_service_stub.get_runtime_project_attachment request, options do |result, operation|
355
375
  yield result, operation if block_given?
356
- return result
357
376
  end
358
377
  rescue ::Gapic::Rest::Error => e
359
378
  raise ::Google::Cloud::Error.from_error(e)
@@ -470,7 +489,7 @@ module Google
470
489
  @runtime_project_attachment_service_stub.list_runtime_project_attachments request, options do |result, operation|
471
490
  result = ::Gapic::Rest::PagedEnumerable.new @runtime_project_attachment_service_stub, :list_runtime_project_attachments, "runtime_project_attachments", request, result, options
472
491
  yield result, operation if block_given?
473
- return result
492
+ throw :response, result
474
493
  end
475
494
  rescue ::Gapic::Rest::Error => e
476
495
  raise ::Google::Cloud::Error.from_error(e)
@@ -552,7 +571,6 @@ module Google
552
571
 
553
572
  @runtime_project_attachment_service_stub.delete_runtime_project_attachment request, options do |result, operation|
554
573
  yield result, operation if block_given?
555
- return result
556
574
  end
557
575
  rescue ::Gapic::Rest::Error => e
558
576
  raise ::Google::Cloud::Error.from_error(e)
@@ -634,7 +652,6 @@ module Google
634
652
 
635
653
  @runtime_project_attachment_service_stub.lookup_runtime_project_attachment request, options do |result, operation|
636
654
  yield result, operation if block_given?
637
- return result
638
655
  end
639
656
  rescue ::Gapic::Rest::Error => e
640
657
  raise ::Google::Cloud::Error.from_error(e)
@@ -714,6 +731,11 @@ module Google
714
731
  # default endpoint URL. The default value of nil uses the environment
715
732
  # universe (usually the default "googleapis.com" universe).
716
733
  # @return [::String,nil]
734
+ # @!attribute [rw] logger
735
+ # A custom logger to use for request/response debug logging, or the value
736
+ # `:default` (the default) to construct a default logger, or `nil` to
737
+ # explicitly disable logging.
738
+ # @return [::Logger,:default,nil]
717
739
  #
718
740
  class Configuration
719
741
  extend ::Gapic::Config
@@ -742,6 +764,7 @@ module Google
742
764
  # by the host service.
743
765
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
744
766
  config_attr :bindings_override, {}, ::Hash, nil
767
+ config_attr :logger, :default, ::Logger, nil, :default
745
768
 
746
769
  # @private
747
770
  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_runtime_project_attachment 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_runtime_project_attachment",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment.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_runtime_project_attachment",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachment.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: "list_runtime_project_attachments",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::ApiHub::V1::ListRuntimeProjectAttachmentsResponse.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_runtime_project_attachment",
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: "lookup_runtime_project_attachment",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::ApiHub::V1::LookupRuntimeProjectAttachmentResponse.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/runtime_project_attachment_service/credentials"
26
25
  require "google/cloud/api_hub/v1/runtime_project_attachment_service/paths"
27
- require "google/cloud/api_hub/v1/runtime_project_attachment_service/client"
28
26
  require "google/cloud/api_hub/v1/runtime_project_attachment_service/rest"
29
27
 
30
28
  module Google
@@ -34,11 +32,6 @@ module Google
34
32
  ##
35
33
  # This service is used for managing the runtime project attachments.
36
34
  #
37
- # @example Load this service and instantiate a gRPC client
38
- #
39
- # require "google/cloud/api_hub/v1/runtime_project_attachment_service"
40
- # client = ::Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Client.new
41
- #
42
35
  # @example Load this service and instantiate a REST client
43
36
  #
44
37
  # require "google/cloud/api_hub/v1/runtime_project_attachment_service/rest"
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ApiHub
23
23
  module V1
24
- VERSION = "0.1.1"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -31,11 +31,6 @@ module Google
31
31
  ##
32
32
  # API client module.
33
33
  #
34
- # @example Load this package, including all its services, and instantiate a gRPC client
35
- #
36
- # require "google/cloud/api_hub/v1"
37
- # client = ::Google::Cloud::ApiHub::V1::ApiHub::Client.new
38
- #
39
34
  # @example Load this package, including all its services, and instantiate a REST client
40
35
  #
41
36
  # require "google/cloud/api_hub/v1"
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization