google-cloud-api_hub-v1 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/api_hub/v1/api_hub/client.rb +4514 -0
  6. data/lib/google/cloud/api_hub/v1/api_hub/credentials.rb +47 -0
  7. data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +216 -0
  8. data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +4251 -0
  9. data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +2147 -0
  10. data/lib/google/cloud/api_hub/v1/api_hub/rest.rb +53 -0
  11. data/lib/google/cloud/api_hub/v1/api_hub.rb +55 -0
  12. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +906 -0
  13. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/credentials.rb +47 -0
  14. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/paths.rb +88 -0
  15. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/client.rb +853 -0
  16. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/service_stub.rb +366 -0
  17. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest.rb +54 -0
  18. data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +56 -0
  19. data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +640 -0
  20. data/lib/google/cloud/api_hub/v1/api_hub_plugin/credentials.rb +47 -0
  21. data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +52 -0
  22. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +601 -0
  23. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +248 -0
  24. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +53 -0
  25. data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +55 -0
  26. data/lib/google/cloud/api_hub/v1/bindings_override.rb +102 -0
  27. data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +689 -0
  28. data/lib/google/cloud/api_hub/v1/host_project_registration_service/credentials.rb +47 -0
  29. data/lib/google/cloud/api_hub/v1/host_project_registration_service/paths.rb +83 -0
  30. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/client.rb +650 -0
  31. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/service_stub.rb +247 -0
  32. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest.rb +53 -0
  33. data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +55 -0
  34. data/lib/google/cloud/api_hub/v1/linting_service/client.rb +744 -0
  35. data/lib/google/cloud/api_hub/v1/linting_service/credentials.rb +47 -0
  36. data/lib/google/cloud/api_hub/v1/linting_service/paths.rb +75 -0
  37. data/lib/google/cloud/api_hub/v1/linting_service/rest/client.rb +698 -0
  38. data/lib/google/cloud/api_hub/v1/linting_service/rest/service_stub.rb +307 -0
  39. data/lib/google/cloud/api_hub/v1/linting_service/rest.rb +53 -0
  40. data/lib/google/cloud/api_hub/v1/linting_service.rb +55 -0
  41. data/lib/google/cloud/api_hub/v1/provisioning/client.rb +676 -0
  42. data/lib/google/cloud/api_hub/v1/provisioning/credentials.rb +47 -0
  43. data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +809 -0
  44. data/lib/google/cloud/api_hub/v1/provisioning/paths.rb +69 -0
  45. data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +637 -0
  46. data/lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb +902 -0
  47. data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +247 -0
  48. data/lib/google/cloud/api_hub/v1/provisioning/rest.rb +54 -0
  49. data/lib/google/cloud/api_hub/v1/provisioning.rb +56 -0
  50. data/lib/google/cloud/api_hub/v1/rest.rb +44 -0
  51. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +885 -0
  52. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/credentials.rb +47 -0
  53. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/paths.rb +83 -0
  54. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/client.rb +832 -0
  55. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/service_stub.rb +365 -0
  56. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest.rb +53 -0
  57. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +55 -0
  58. data/lib/google/cloud/api_hub/v1/version.rb +7 -2
  59. data/lib/google/cloud/api_hub/v1.rb +51 -0
  60. data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +102 -0
  61. data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +288 -0
  62. data/lib/google/cloud/apihub/v1/common_fields_pb.rb +92 -0
  63. data/lib/google/cloud/apihub/v1/host_project_registration_service_pb.rb +53 -0
  64. data/lib/google/cloud/apihub/v1/host_project_registration_service_services_pb.rb +53 -0
  65. data/lib/google/cloud/apihub/v1/linting_service_pb.rb +56 -0
  66. data/lib/google/cloud/apihub/v1/linting_service_services_pb.rb +53 -0
  67. data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +53 -0
  68. data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +51 -0
  69. data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +53 -0
  70. data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +50 -0
  71. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_pb.rb +57 -0
  72. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_services_pb.rb +55 -0
  73. data/lib/google-cloud-api_hub-v1.rb +21 -0
  74. data/proto_docs/README.md +4 -0
  75. data/proto_docs/google/api/client.rb +420 -0
  76. data/proto_docs/google/api/field_behavior.rb +85 -0
  77. data/proto_docs/google/api/launch_stage.rb +71 -0
  78. data/proto_docs/google/api/resource.rb +227 -0
  79. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +1317 -0
  80. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1296 -0
  81. data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +146 -0
  82. data/proto_docs/google/cloud/apihub/v1/linting_service.rb +103 -0
  83. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +104 -0
  84. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +87 -0
  85. data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +182 -0
  86. data/proto_docs/google/longrunning/operations.rb +164 -0
  87. data/proto_docs/google/protobuf/any.rb +145 -0
  88. data/proto_docs/google/protobuf/duration.rb +98 -0
  89. data/proto_docs/google/protobuf/empty.rb +34 -0
  90. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  91. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  92. data/proto_docs/google/rpc/status.rb +48 -0
  93. metadata +155 -10
@@ -0,0 +1,4514 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/apihub/v1/apihub_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ApiHub
26
+ module V1
27
+ module ApiHub
28
+ ##
29
+ # Client for the ApiHub service.
30
+ #
31
+ # This service provides all methods related to the API hub.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :api_hub_stub
44
+
45
+ ##
46
+ # Configure the ApiHub Client class.
47
+ #
48
+ # See {::Google::Cloud::ApiHub::V1::ApiHub::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all ApiHub clients
54
+ # ::Google::Cloud::ApiHub::V1::ApiHub::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "ApiHub", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.create_api.timeout = 60.0
75
+
76
+ default_config.rpcs.get_api.timeout = 60.0
77
+ default_config.rpcs.get_api.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.list_apis.timeout = 60.0
82
+ default_config.rpcs.list_apis.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.update_api.timeout = 60.0
87
+
88
+ default_config.rpcs.delete_api.timeout = 60.0
89
+
90
+ default_config.rpcs.create_version.timeout = 60.0
91
+
92
+ default_config.rpcs.get_version.timeout = 60.0
93
+ default_config.rpcs.get_version.retry_policy = {
94
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
95
+ }
96
+
97
+ default_config.rpcs.list_versions.timeout = 60.0
98
+ default_config.rpcs.list_versions.retry_policy = {
99
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
100
+ }
101
+
102
+ default_config.rpcs.update_version.timeout = 60.0
103
+
104
+ default_config.rpcs.delete_version.timeout = 60.0
105
+
106
+ default_config.rpcs.create_spec.timeout = 60.0
107
+
108
+ default_config.rpcs.get_spec.timeout = 60.0
109
+ default_config.rpcs.get_spec.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.get_spec_contents.timeout = 60.0
114
+ default_config.rpcs.get_spec_contents.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config.rpcs.list_specs.timeout = 60.0
119
+ default_config.rpcs.list_specs.retry_policy = {
120
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
121
+ }
122
+
123
+ default_config.rpcs.update_spec.timeout = 60.0
124
+
125
+ default_config.rpcs.delete_spec.timeout = 60.0
126
+
127
+ default_config.rpcs.get_api_operation.timeout = 60.0
128
+ default_config.rpcs.get_api_operation.retry_policy = {
129
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
130
+ }
131
+
132
+ default_config.rpcs.list_api_operations.timeout = 60.0
133
+ default_config.rpcs.list_api_operations.retry_policy = {
134
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
135
+ }
136
+
137
+ default_config.rpcs.get_definition.timeout = 60.0
138
+ default_config.rpcs.get_definition.retry_policy = {
139
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
140
+ }
141
+
142
+ default_config.rpcs.create_deployment.timeout = 60.0
143
+
144
+ default_config.rpcs.get_deployment.timeout = 60.0
145
+ default_config.rpcs.get_deployment.retry_policy = {
146
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
147
+ }
148
+
149
+ default_config.rpcs.list_deployments.timeout = 60.0
150
+ default_config.rpcs.list_deployments.retry_policy = {
151
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
152
+ }
153
+
154
+ default_config.rpcs.update_deployment.timeout = 60.0
155
+
156
+ default_config.rpcs.delete_deployment.timeout = 60.0
157
+
158
+ default_config.rpcs.create_attribute.timeout = 60.0
159
+
160
+ default_config.rpcs.get_attribute.timeout = 60.0
161
+ default_config.rpcs.get_attribute.retry_policy = {
162
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
163
+ }
164
+
165
+ default_config.rpcs.update_attribute.timeout = 60.0
166
+
167
+ default_config.rpcs.delete_attribute.timeout = 60.0
168
+
169
+ default_config.rpcs.list_attributes.timeout = 60.0
170
+ default_config.rpcs.list_attributes.retry_policy = {
171
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
172
+ }
173
+
174
+ default_config.rpcs.search_resources.timeout = 60.0
175
+ default_config.rpcs.search_resources.retry_policy = {
176
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
177
+ }
178
+
179
+ default_config.rpcs.create_external_api.timeout = 60.0
180
+
181
+ default_config.rpcs.get_external_api.timeout = 60.0
182
+ default_config.rpcs.get_external_api.retry_policy = {
183
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
184
+ }
185
+
186
+ default_config.rpcs.update_external_api.timeout = 60.0
187
+
188
+ default_config.rpcs.delete_external_api.timeout = 60.0
189
+
190
+ default_config.rpcs.list_external_apis.timeout = 60.0
191
+ default_config.rpcs.list_external_apis.retry_policy = {
192
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
193
+ }
194
+
195
+ default_config
196
+ end
197
+ yield @configure if block_given?
198
+ @configure
199
+ end
200
+
201
+ ##
202
+ # Configure the ApiHub Client instance.
203
+ #
204
+ # The configuration is set to the derived mode, meaning that values can be changed,
205
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
206
+ # should be made on {Client.configure}.
207
+ #
208
+ # See {::Google::Cloud::ApiHub::V1::ApiHub::Client::Configuration}
209
+ # for a description of the configuration fields.
210
+ #
211
+ # @yield [config] Configure the Client client.
212
+ # @yieldparam config [Client::Configuration]
213
+ #
214
+ # @return [Client::Configuration]
215
+ #
216
+ def configure
217
+ yield @config if block_given?
218
+ @config
219
+ end
220
+
221
+ ##
222
+ # The effective universe domain
223
+ #
224
+ # @return [String]
225
+ #
226
+ def universe_domain
227
+ @api_hub_stub.universe_domain
228
+ end
229
+
230
+ ##
231
+ # Create a new ApiHub client object.
232
+ #
233
+ # @example
234
+ #
235
+ # # Create a client using the default configuration
236
+ # client = ::Google::Cloud::ApiHub::V1::ApiHub::Client.new
237
+ #
238
+ # # Create a client using a custom configuration
239
+ # client = ::Google::Cloud::ApiHub::V1::ApiHub::Client.new do |config|
240
+ # config.timeout = 10.0
241
+ # end
242
+ #
243
+ # @yield [config] Configure the ApiHub client.
244
+ # @yieldparam config [Client::Configuration]
245
+ #
246
+ def initialize
247
+ # These require statements are intentionally placed here to initialize
248
+ # the gRPC module only when it's required.
249
+ # See https://github.com/googleapis/toolkit/issues/446
250
+ require "gapic/grpc"
251
+ require "google/cloud/apihub/v1/apihub_service_services_pb"
252
+
253
+ # Create the configuration object
254
+ @config = Configuration.new Client.configure
255
+
256
+ # Yield the configuration if needed
257
+ yield @config if block_given?
258
+
259
+ # Create credentials
260
+ credentials = @config.credentials
261
+ # Use self-signed JWT if the endpoint is unchanged from default,
262
+ # but only if the default endpoint does not have a region prefix.
263
+ enable_self_signed_jwt = @config.endpoint.nil? ||
264
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
265
+ !@config.endpoint.split(".").first.include?("-"))
266
+ credentials ||= Credentials.default scope: @config.scope,
267
+ enable_self_signed_jwt: enable_self_signed_jwt
268
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
269
+ credentials = Credentials.new credentials, scope: @config.scope
270
+ end
271
+ @quota_project_id = @config.quota_project
272
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
273
+
274
+ @api_hub_stub = ::Gapic::ServiceStub.new(
275
+ ::Google::Cloud::ApiHub::V1::ApiHub::Stub,
276
+ credentials: credentials,
277
+ endpoint: @config.endpoint,
278
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
279
+ universe_domain: @config.universe_domain,
280
+ channel_args: @config.channel_args,
281
+ interceptors: @config.interceptors,
282
+ channel_pool_config: @config.channel_pool
283
+ )
284
+
285
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
286
+ config.credentials = credentials
287
+ config.quota_project = @quota_project_id
288
+ config.endpoint = @api_hub_stub.endpoint
289
+ config.universe_domain = @api_hub_stub.universe_domain
290
+ end
291
+ end
292
+
293
+ ##
294
+ # Get the associated client for mix-in of the Locations.
295
+ #
296
+ # @return [Google::Cloud::Location::Locations::Client]
297
+ #
298
+ attr_reader :location_client
299
+
300
+ # Service calls
301
+
302
+ ##
303
+ # Create an API resource in the API hub.
304
+ # Once an API resource is created, versions can be added to it.
305
+ #
306
+ # @overload create_api(request, options = nil)
307
+ # Pass arguments to `create_api` via a request object, either of type
308
+ # {::Google::Cloud::ApiHub::V1::CreateApiRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::ApiHub::V1::CreateApiRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
315
+ #
316
+ # @overload create_api(parent: nil, api_id: nil, api: nil)
317
+ # Pass arguments to `create_api` via keyword arguments. Note that at
318
+ # least one keyword argument is required. To specify no parameters, or to keep all
319
+ # the default parameter values, pass an empty Hash as a request object (see above).
320
+ #
321
+ # @param parent [::String]
322
+ # Required. The parent resource for the API resource.
323
+ # Format: `projects/{project}/locations/{location}`
324
+ # @param api_id [::String]
325
+ # Optional. The ID to use for the API resource, which will become the final
326
+ # component of the API's resource name. This field is optional.
327
+ #
328
+ # * If provided, the same will be used. The service will throw an error if
329
+ # the specified id is already used by another API resource in the API hub.
330
+ # * If not provided, a system generated id will be used.
331
+ #
332
+ # This value should be 4-500 characters, and valid characters
333
+ # are /[a-z][A-Z][0-9]-_/.
334
+ # @param api [::Google::Cloud::ApiHub::V1::Api, ::Hash]
335
+ # Required. The API resource to create.
336
+ #
337
+ # @yield [response, operation] Access the result along with the RPC operation
338
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Api]
339
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
340
+ #
341
+ # @return [::Google::Cloud::ApiHub::V1::Api]
342
+ #
343
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
344
+ #
345
+ # @example Basic example
346
+ # require "google/cloud/api_hub/v1"
347
+ #
348
+ # # Create a client object. The client can be reused for multiple calls.
349
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
350
+ #
351
+ # # Create a request. To set request fields, pass in keyword arguments.
352
+ # request = Google::Cloud::ApiHub::V1::CreateApiRequest.new
353
+ #
354
+ # # Call the create_api method.
355
+ # result = client.create_api request
356
+ #
357
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Api.
358
+ # p result
359
+ #
360
+ def create_api request, options = nil
361
+ raise ::ArgumentError, "request must be provided" if request.nil?
362
+
363
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateApiRequest
364
+
365
+ # Converts hash and nil to an options object
366
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
367
+
368
+ # Customize the options with defaults
369
+ metadata = @config.rpcs.create_api.metadata.to_h
370
+
371
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
372
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
373
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
374
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
375
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
376
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
377
+
378
+ header_params = {}
379
+ if request.parent
380
+ header_params["parent"] = request.parent
381
+ end
382
+
383
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
384
+ metadata[:"x-goog-request-params"] ||= request_params_header
385
+
386
+ options.apply_defaults timeout: @config.rpcs.create_api.timeout,
387
+ metadata: metadata,
388
+ retry_policy: @config.rpcs.create_api.retry_policy
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata,
392
+ retry_policy: @config.retry_policy
393
+
394
+ @api_hub_stub.call_rpc :create_api, request, options: options do |response, operation|
395
+ yield response, operation if block_given?
396
+ return response
397
+ end
398
+ rescue ::GRPC::BadStatus => e
399
+ raise ::Google::Cloud::Error.from_error(e)
400
+ end
401
+
402
+ ##
403
+ # Get API resource details including the API versions contained in it.
404
+ #
405
+ # @overload get_api(request, options = nil)
406
+ # Pass arguments to `get_api` via a request object, either of type
407
+ # {::Google::Cloud::ApiHub::V1::GetApiRequest} or an equivalent Hash.
408
+ #
409
+ # @param request [::Google::Cloud::ApiHub::V1::GetApiRequest, ::Hash]
410
+ # A request object representing the call parameters. Required. To specify no
411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
412
+ # @param options [::Gapic::CallOptions, ::Hash]
413
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
414
+ #
415
+ # @overload get_api(name: nil)
416
+ # Pass arguments to `get_api` via keyword arguments. Note that at
417
+ # least one keyword argument is required. To specify no parameters, or to keep all
418
+ # the default parameter values, pass an empty Hash as a request object (see above).
419
+ #
420
+ # @param name [::String]
421
+ # Required. The name of the API resource to retrieve.
422
+ # Format: `projects/{project}/locations/{location}/apis/{api}`
423
+ #
424
+ # @yield [response, operation] Access the result along with the RPC operation
425
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Api]
426
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
427
+ #
428
+ # @return [::Google::Cloud::ApiHub::V1::Api]
429
+ #
430
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
431
+ #
432
+ # @example Basic example
433
+ # require "google/cloud/api_hub/v1"
434
+ #
435
+ # # Create a client object. The client can be reused for multiple calls.
436
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
437
+ #
438
+ # # Create a request. To set request fields, pass in keyword arguments.
439
+ # request = Google::Cloud::ApiHub::V1::GetApiRequest.new
440
+ #
441
+ # # Call the get_api method.
442
+ # result = client.get_api request
443
+ #
444
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Api.
445
+ # p result
446
+ #
447
+ def get_api request, options = nil
448
+ raise ::ArgumentError, "request must be provided" if request.nil?
449
+
450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetApiRequest
451
+
452
+ # Converts hash and nil to an options object
453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
454
+
455
+ # Customize the options with defaults
456
+ metadata = @config.rpcs.get_api.metadata.to_h
457
+
458
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
459
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
461
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
462
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
463
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ header_params = {}
466
+ if request.name
467
+ header_params["name"] = request.name
468
+ end
469
+
470
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
471
+ metadata[:"x-goog-request-params"] ||= request_params_header
472
+
473
+ options.apply_defaults timeout: @config.rpcs.get_api.timeout,
474
+ metadata: metadata,
475
+ retry_policy: @config.rpcs.get_api.retry_policy
476
+
477
+ options.apply_defaults timeout: @config.timeout,
478
+ metadata: @config.metadata,
479
+ retry_policy: @config.retry_policy
480
+
481
+ @api_hub_stub.call_rpc :get_api, request, options: options do |response, operation|
482
+ yield response, operation if block_given?
483
+ return response
484
+ end
485
+ rescue ::GRPC::BadStatus => e
486
+ raise ::Google::Cloud::Error.from_error(e)
487
+ end
488
+
489
+ ##
490
+ # List API resources in the API hub.
491
+ #
492
+ # @overload list_apis(request, options = nil)
493
+ # Pass arguments to `list_apis` via a request object, either of type
494
+ # {::Google::Cloud::ApiHub::V1::ListApisRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::ApiHub::V1::ListApisRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
+ #
502
+ # @overload list_apis(parent: nil, filter: nil, page_size: nil, page_token: nil)
503
+ # Pass arguments to `list_apis` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param parent [::String]
508
+ # Required. The parent, which owns this collection of API resources.
509
+ # Format: `projects/{project}/locations/{location}`
510
+ # @param filter [::String]
511
+ # Optional. An expression that filters the list of ApiResources.
512
+ #
513
+ # A filter expression consists of a field name, a comparison
514
+ # operator, and a value for filtering. The value must be a string. The
515
+ # comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
516
+ # case sensitive.
517
+ #
518
+ # The following fields in the `ApiResource` are eligible for filtering:
519
+ #
520
+ # * `owner.email` - The email of the team which owns the ApiResource.
521
+ # Allowed comparison operators: `=`.
522
+ # * `create_time` - The time at which the ApiResource was created. The
523
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
524
+ # format. Allowed comparison operators: `>` and `<`.
525
+ # * `display_name` - The display name of the ApiResource. Allowed
526
+ # comparison operators: `=`.
527
+ # * `target_user.enum_values.values.id` - The allowed value id of the
528
+ # target users attribute associated with the ApiResource. Allowed
529
+ # comparison operator is `:`.
530
+ # * `target_user.enum_values.values.display_name` - The allowed value
531
+ # display name of the target users attribute associated with the
532
+ # ApiResource. Allowed comparison operator is `:`.
533
+ # * `team.enum_values.values.id` - The allowed value id of the team
534
+ # attribute associated with the ApiResource. Allowed comparison operator is
535
+ # `:`.
536
+ # * `team.enum_values.values.display_name` - The allowed value display name
537
+ # of the team attribute associated with the ApiResource. Allowed comparison
538
+ # operator is `:`.
539
+ # * `business_unit.enum_values.values.id` - The allowed value id of the
540
+ # business unit attribute associated with the ApiResource. Allowed
541
+ # comparison operator is `:`.
542
+ # * `business_unit.enum_values.values.display_name` - The allowed value
543
+ # display name of the business unit attribute associated with the
544
+ # ApiResource. Allowed comparison operator is `:`.
545
+ # * `maturity_level.enum_values.values.id` - The allowed value id of the
546
+ # maturity level attribute associated with the ApiResource. Allowed
547
+ # comparison operator is `:`.
548
+ # * `maturity_level.enum_values.values.display_name` - The allowed value
549
+ # display name of the maturity level attribute associated with the
550
+ # ApiResource. Allowed comparison operator is `:`.
551
+ # * `api_style.enum_values.values.id` - The allowed value id of the
552
+ # api style attribute associated with the ApiResource. Allowed
553
+ # comparison operator is `:`.
554
+ # * `api_style.enum_values.values.display_name` - The allowed value display
555
+ # name of the api style attribute associated with the ApiResource. Allowed
556
+ # comparison operator is `:`.
557
+ #
558
+ # Expressions are combined with either `AND` logic operator or `OR` logical
559
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
560
+ # operator can be used throughout the filter string and both the operators
561
+ # cannot be used together. No other logical operators are supported. At most
562
+ # three filter fields are allowed in the filter string and if provided
563
+ # more than that then `INVALID_ARGUMENT` error is returned by the API.
564
+ #
565
+ # Here are a few examples:
566
+ #
567
+ # * `owner.email = \"apihub@google.com\"` - - The owner team email is
568
+ # _apihub@google.com_.
569
+ # * `owner.email = \"apihub@google.com\" AND create_time <
570
+ # \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
571
+ # The owner team email is _apihub@google.com_ and the api was created
572
+ # before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
573
+ # * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
574
+ # apihub-team-id` - The filter string specifies the APIs where the owner
575
+ # team email is _apihub@google.com_ or the id of the allowed value
576
+ # associated with the team attribute is _apihub-team-id_.
577
+ # * `owner.email = \"apihub@google.com\" OR
578
+ # team.enum_values.values.display_name: ApiHub Team` - The filter string
579
+ # specifies the APIs where the owner team email is _apihub@google.com_ or
580
+ # the display name of the allowed value associated with the team attribute
581
+ # is `ApiHub Team`.
582
+ # @param page_size [::Integer]
583
+ # Optional. The maximum number of API resources to return. The service may
584
+ # return fewer than this value. If unspecified, at most 50 Apis will be
585
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
586
+ # 1000.
587
+ # @param page_token [::String]
588
+ # Optional. A page token, received from a previous `ListApis` call.
589
+ # Provide this to retrieve the subsequent page.
590
+ #
591
+ # When paginating, all other parameters (except page_size) provided to
592
+ # `ListApis` must match the call that provided the page token.
593
+ #
594
+ # @yield [response, operation] Access the result along with the RPC operation
595
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Api>]
596
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
597
+ #
598
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Api>]
599
+ #
600
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
601
+ #
602
+ # @example Basic example
603
+ # require "google/cloud/api_hub/v1"
604
+ #
605
+ # # Create a client object. The client can be reused for multiple calls.
606
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
607
+ #
608
+ # # Create a request. To set request fields, pass in keyword arguments.
609
+ # request = Google::Cloud::ApiHub::V1::ListApisRequest.new
610
+ #
611
+ # # Call the list_apis method.
612
+ # result = client.list_apis request
613
+ #
614
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
615
+ # # over elements, and API calls will be issued to fetch pages as needed.
616
+ # result.each do |item|
617
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Api.
618
+ # p item
619
+ # end
620
+ #
621
+ def list_apis request, options = nil
622
+ raise ::ArgumentError, "request must be provided" if request.nil?
623
+
624
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListApisRequest
625
+
626
+ # Converts hash and nil to an options object
627
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
628
+
629
+ # Customize the options with defaults
630
+ metadata = @config.rpcs.list_apis.metadata.to_h
631
+
632
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
633
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
634
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
635
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
636
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
637
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
638
+
639
+ header_params = {}
640
+ if request.parent
641
+ header_params["parent"] = request.parent
642
+ end
643
+
644
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
645
+ metadata[:"x-goog-request-params"] ||= request_params_header
646
+
647
+ options.apply_defaults timeout: @config.rpcs.list_apis.timeout,
648
+ metadata: metadata,
649
+ retry_policy: @config.rpcs.list_apis.retry_policy
650
+
651
+ options.apply_defaults timeout: @config.timeout,
652
+ metadata: @config.metadata,
653
+ retry_policy: @config.retry_policy
654
+
655
+ @api_hub_stub.call_rpc :list_apis, request, options: options do |response, operation|
656
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_apis, request, response, operation, options
657
+ yield response, operation if block_given?
658
+ return response
659
+ end
660
+ rescue ::GRPC::BadStatus => e
661
+ raise ::Google::Cloud::Error.from_error(e)
662
+ end
663
+
664
+ ##
665
+ # Update an API resource in the API hub. The following fields in the
666
+ # [API][] can be updated:
667
+ #
668
+ # * {::Google::Cloud::ApiHub::V1::Api#display_name display_name}
669
+ # * {::Google::Cloud::ApiHub::V1::Api#description description}
670
+ # * {::Google::Cloud::ApiHub::V1::Api#owner owner}
671
+ # * {::Google::Cloud::ApiHub::V1::Api#documentation documentation}
672
+ # * {::Google::Cloud::ApiHub::V1::Api#target_user target_user}
673
+ # * {::Google::Cloud::ApiHub::V1::Api#team team}
674
+ # * {::Google::Cloud::ApiHub::V1::Api#business_unit business_unit}
675
+ # * {::Google::Cloud::ApiHub::V1::Api#maturity_level maturity_level}
676
+ # * {::Google::Cloud::ApiHub::V1::Api#attributes attributes}
677
+ #
678
+ # The
679
+ # {::Google::Cloud::ApiHub::V1::UpdateApiRequest#update_mask update_mask}
680
+ # should be used to specify the fields being updated.
681
+ #
682
+ # Updating the owner field requires complete owner message
683
+ # and updates both owner and email fields.
684
+ #
685
+ # @overload update_api(request, options = nil)
686
+ # Pass arguments to `update_api` via a request object, either of type
687
+ # {::Google::Cloud::ApiHub::V1::UpdateApiRequest} or an equivalent Hash.
688
+ #
689
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateApiRequest, ::Hash]
690
+ # A request object representing the call parameters. Required. To specify no
691
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
692
+ # @param options [::Gapic::CallOptions, ::Hash]
693
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
694
+ #
695
+ # @overload update_api(api: nil, update_mask: nil)
696
+ # Pass arguments to `update_api` via keyword arguments. Note that at
697
+ # least one keyword argument is required. To specify no parameters, or to keep all
698
+ # the default parameter values, pass an empty Hash as a request object (see above).
699
+ #
700
+ # @param api [::Google::Cloud::ApiHub::V1::Api, ::Hash]
701
+ # Required. The API resource to update.
702
+ #
703
+ # The API resource's `name` field is used to identify the API resource to
704
+ # update.
705
+ # Format: `projects/{project}/locations/{location}/apis/{api}`
706
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
707
+ # Required. The list of fields to update.
708
+ #
709
+ # @yield [response, operation] Access the result along with the RPC operation
710
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Api]
711
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
712
+ #
713
+ # @return [::Google::Cloud::ApiHub::V1::Api]
714
+ #
715
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
716
+ #
717
+ # @example Basic example
718
+ # require "google/cloud/api_hub/v1"
719
+ #
720
+ # # Create a client object. The client can be reused for multiple calls.
721
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
722
+ #
723
+ # # Create a request. To set request fields, pass in keyword arguments.
724
+ # request = Google::Cloud::ApiHub::V1::UpdateApiRequest.new
725
+ #
726
+ # # Call the update_api method.
727
+ # result = client.update_api request
728
+ #
729
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Api.
730
+ # p result
731
+ #
732
+ def update_api request, options = nil
733
+ raise ::ArgumentError, "request must be provided" if request.nil?
734
+
735
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateApiRequest
736
+
737
+ # Converts hash and nil to an options object
738
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
739
+
740
+ # Customize the options with defaults
741
+ metadata = @config.rpcs.update_api.metadata.to_h
742
+
743
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
744
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
745
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
746
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
747
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
748
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
749
+
750
+ header_params = {}
751
+ if request.api&.name
752
+ header_params["api.name"] = request.api.name
753
+ end
754
+
755
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
756
+ metadata[:"x-goog-request-params"] ||= request_params_header
757
+
758
+ options.apply_defaults timeout: @config.rpcs.update_api.timeout,
759
+ metadata: metadata,
760
+ retry_policy: @config.rpcs.update_api.retry_policy
761
+
762
+ options.apply_defaults timeout: @config.timeout,
763
+ metadata: @config.metadata,
764
+ retry_policy: @config.retry_policy
765
+
766
+ @api_hub_stub.call_rpc :update_api, request, options: options do |response, operation|
767
+ yield response, operation if block_given?
768
+ return response
769
+ end
770
+ rescue ::GRPC::BadStatus => e
771
+ raise ::Google::Cloud::Error.from_error(e)
772
+ end
773
+
774
+ ##
775
+ # Delete an API resource in the API hub. API can only be deleted if all
776
+ # underlying versions are deleted.
777
+ #
778
+ # @overload delete_api(request, options = nil)
779
+ # Pass arguments to `delete_api` via a request object, either of type
780
+ # {::Google::Cloud::ApiHub::V1::DeleteApiRequest} or an equivalent Hash.
781
+ #
782
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteApiRequest, ::Hash]
783
+ # A request object representing the call parameters. Required. To specify no
784
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
785
+ # @param options [::Gapic::CallOptions, ::Hash]
786
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
787
+ #
788
+ # @overload delete_api(name: nil, force: nil)
789
+ # Pass arguments to `delete_api` via keyword arguments. Note that at
790
+ # least one keyword argument is required. To specify no parameters, or to keep all
791
+ # the default parameter values, pass an empty Hash as a request object (see above).
792
+ #
793
+ # @param name [::String]
794
+ # Required. The name of the API resource to delete.
795
+ # Format: `projects/{project}/locations/{location}/apis/{api}`
796
+ # @param force [::Boolean]
797
+ # Optional. If set to true, any versions from this API will also be deleted.
798
+ # Otherwise, the request will only work if the API has no versions.
799
+ #
800
+ # @yield [response, operation] Access the result along with the RPC operation
801
+ # @yieldparam response [::Google::Protobuf::Empty]
802
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
803
+ #
804
+ # @return [::Google::Protobuf::Empty]
805
+ #
806
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
807
+ #
808
+ # @example Basic example
809
+ # require "google/cloud/api_hub/v1"
810
+ #
811
+ # # Create a client object. The client can be reused for multiple calls.
812
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
813
+ #
814
+ # # Create a request. To set request fields, pass in keyword arguments.
815
+ # request = Google::Cloud::ApiHub::V1::DeleteApiRequest.new
816
+ #
817
+ # # Call the delete_api method.
818
+ # result = client.delete_api request
819
+ #
820
+ # # The returned object is of type Google::Protobuf::Empty.
821
+ # p result
822
+ #
823
+ def delete_api request, options = nil
824
+ raise ::ArgumentError, "request must be provided" if request.nil?
825
+
826
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteApiRequest
827
+
828
+ # Converts hash and nil to an options object
829
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
830
+
831
+ # Customize the options with defaults
832
+ metadata = @config.rpcs.delete_api.metadata.to_h
833
+
834
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
835
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
836
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
837
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
838
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
839
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
840
+
841
+ header_params = {}
842
+ if request.name
843
+ header_params["name"] = request.name
844
+ end
845
+
846
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
847
+ metadata[:"x-goog-request-params"] ||= request_params_header
848
+
849
+ options.apply_defaults timeout: @config.rpcs.delete_api.timeout,
850
+ metadata: metadata,
851
+ retry_policy: @config.rpcs.delete_api.retry_policy
852
+
853
+ options.apply_defaults timeout: @config.timeout,
854
+ metadata: @config.metadata,
855
+ retry_policy: @config.retry_policy
856
+
857
+ @api_hub_stub.call_rpc :delete_api, request, options: options do |response, operation|
858
+ yield response, operation if block_given?
859
+ return response
860
+ end
861
+ rescue ::GRPC::BadStatus => e
862
+ raise ::Google::Cloud::Error.from_error(e)
863
+ end
864
+
865
+ ##
866
+ # Create an API version for an API resource in the API hub.
867
+ #
868
+ # @overload create_version(request, options = nil)
869
+ # Pass arguments to `create_version` via a request object, either of type
870
+ # {::Google::Cloud::ApiHub::V1::CreateVersionRequest} or an equivalent Hash.
871
+ #
872
+ # @param request [::Google::Cloud::ApiHub::V1::CreateVersionRequest, ::Hash]
873
+ # A request object representing the call parameters. Required. To specify no
874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
875
+ # @param options [::Gapic::CallOptions, ::Hash]
876
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
877
+ #
878
+ # @overload create_version(parent: nil, version_id: nil, version: nil)
879
+ # Pass arguments to `create_version` via keyword arguments. Note that at
880
+ # least one keyword argument is required. To specify no parameters, or to keep all
881
+ # the default parameter values, pass an empty Hash as a request object (see above).
882
+ #
883
+ # @param parent [::String]
884
+ # Required. The parent resource for API version.
885
+ # Format: `projects/{project}/locations/{location}/apis/{api}`
886
+ # @param version_id [::String]
887
+ # Optional. The ID to use for the API version, which will become the final
888
+ # component of the version's resource name. This field is optional.
889
+ #
890
+ # * If provided, the same will be used. The service will throw an error if
891
+ # the specified id is already used by another version in the API resource.
892
+ # * If not provided, a system generated id will be used.
893
+ #
894
+ # This value should be 4-500 characters, and valid characters
895
+ # are /[a-z][A-Z][0-9]-_/.
896
+ # @param version [::Google::Cloud::ApiHub::V1::Version, ::Hash]
897
+ # Required. The version to create.
898
+ #
899
+ # @yield [response, operation] Access the result along with the RPC operation
900
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Version]
901
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
902
+ #
903
+ # @return [::Google::Cloud::ApiHub::V1::Version]
904
+ #
905
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
906
+ #
907
+ # @example Basic example
908
+ # require "google/cloud/api_hub/v1"
909
+ #
910
+ # # Create a client object. The client can be reused for multiple calls.
911
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
912
+ #
913
+ # # Create a request. To set request fields, pass in keyword arguments.
914
+ # request = Google::Cloud::ApiHub::V1::CreateVersionRequest.new
915
+ #
916
+ # # Call the create_version method.
917
+ # result = client.create_version request
918
+ #
919
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Version.
920
+ # p result
921
+ #
922
+ def create_version request, options = nil
923
+ raise ::ArgumentError, "request must be provided" if request.nil?
924
+
925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateVersionRequest
926
+
927
+ # Converts hash and nil to an options object
928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
929
+
930
+ # Customize the options with defaults
931
+ metadata = @config.rpcs.create_version.metadata.to_h
932
+
933
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
934
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
936
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
937
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
938
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
939
+
940
+ header_params = {}
941
+ if request.parent
942
+ header_params["parent"] = request.parent
943
+ end
944
+
945
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
946
+ metadata[:"x-goog-request-params"] ||= request_params_header
947
+
948
+ options.apply_defaults timeout: @config.rpcs.create_version.timeout,
949
+ metadata: metadata,
950
+ retry_policy: @config.rpcs.create_version.retry_policy
951
+
952
+ options.apply_defaults timeout: @config.timeout,
953
+ metadata: @config.metadata,
954
+ retry_policy: @config.retry_policy
955
+
956
+ @api_hub_stub.call_rpc :create_version, request, options: options do |response, operation|
957
+ yield response, operation if block_given?
958
+ return response
959
+ end
960
+ rescue ::GRPC::BadStatus => e
961
+ raise ::Google::Cloud::Error.from_error(e)
962
+ end
963
+
964
+ ##
965
+ # Get details about the API version of an API resource. This will include
966
+ # information about the specs and operations present in the API
967
+ # version as well as the deployments linked to it.
968
+ #
969
+ # @overload get_version(request, options = nil)
970
+ # Pass arguments to `get_version` via a request object, either of type
971
+ # {::Google::Cloud::ApiHub::V1::GetVersionRequest} or an equivalent Hash.
972
+ #
973
+ # @param request [::Google::Cloud::ApiHub::V1::GetVersionRequest, ::Hash]
974
+ # A request object representing the call parameters. Required. To specify no
975
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
976
+ # @param options [::Gapic::CallOptions, ::Hash]
977
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
978
+ #
979
+ # @overload get_version(name: nil)
980
+ # Pass arguments to `get_version` via keyword arguments. Note that at
981
+ # least one keyword argument is required. To specify no parameters, or to keep all
982
+ # the default parameter values, pass an empty Hash as a request object (see above).
983
+ #
984
+ # @param name [::String]
985
+ # Required. The name of the API version to retrieve.
986
+ # Format:
987
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
988
+ #
989
+ # @yield [response, operation] Access the result along with the RPC operation
990
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Version]
991
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
992
+ #
993
+ # @return [::Google::Cloud::ApiHub::V1::Version]
994
+ #
995
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
996
+ #
997
+ # @example Basic example
998
+ # require "google/cloud/api_hub/v1"
999
+ #
1000
+ # # Create a client object. The client can be reused for multiple calls.
1001
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1002
+ #
1003
+ # # Create a request. To set request fields, pass in keyword arguments.
1004
+ # request = Google::Cloud::ApiHub::V1::GetVersionRequest.new
1005
+ #
1006
+ # # Call the get_version method.
1007
+ # result = client.get_version request
1008
+ #
1009
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Version.
1010
+ # p result
1011
+ #
1012
+ def get_version request, options = nil
1013
+ raise ::ArgumentError, "request must be provided" if request.nil?
1014
+
1015
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetVersionRequest
1016
+
1017
+ # Converts hash and nil to an options object
1018
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1019
+
1020
+ # Customize the options with defaults
1021
+ metadata = @config.rpcs.get_version.metadata.to_h
1022
+
1023
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1024
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1025
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1026
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1027
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1028
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1029
+
1030
+ header_params = {}
1031
+ if request.name
1032
+ header_params["name"] = request.name
1033
+ end
1034
+
1035
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1036
+ metadata[:"x-goog-request-params"] ||= request_params_header
1037
+
1038
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
1039
+ metadata: metadata,
1040
+ retry_policy: @config.rpcs.get_version.retry_policy
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
1044
+ retry_policy: @config.retry_policy
1045
+
1046
+ @api_hub_stub.call_rpc :get_version, request, options: options do |response, operation|
1047
+ yield response, operation if block_given?
1048
+ return response
1049
+ end
1050
+ rescue ::GRPC::BadStatus => e
1051
+ raise ::Google::Cloud::Error.from_error(e)
1052
+ end
1053
+
1054
+ ##
1055
+ # List API versions of an API resource in the API hub.
1056
+ #
1057
+ # @overload list_versions(request, options = nil)
1058
+ # Pass arguments to `list_versions` via a request object, either of type
1059
+ # {::Google::Cloud::ApiHub::V1::ListVersionsRequest} or an equivalent Hash.
1060
+ #
1061
+ # @param request [::Google::Cloud::ApiHub::V1::ListVersionsRequest, ::Hash]
1062
+ # A request object representing the call parameters. Required. To specify no
1063
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1064
+ # @param options [::Gapic::CallOptions, ::Hash]
1065
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1066
+ #
1067
+ # @overload list_versions(parent: nil, filter: nil, page_size: nil, page_token: nil)
1068
+ # Pass arguments to `list_versions` via keyword arguments. Note that at
1069
+ # least one keyword argument is required. To specify no parameters, or to keep all
1070
+ # the default parameter values, pass an empty Hash as a request object (see above).
1071
+ #
1072
+ # @param parent [::String]
1073
+ # Required. The parent which owns this collection of API versions i.e., the
1074
+ # API resource Format: `projects/{project}/locations/{location}/apis/{api}`
1075
+ # @param filter [::String]
1076
+ # Optional. An expression that filters the list of Versions.
1077
+ #
1078
+ # A filter expression consists of a field name, a comparison
1079
+ # operator, and a value for filtering. The value must be a string, a
1080
+ # number, or a boolean. The comparison operator must be one of: `<`, `>` or
1081
+ # `=`. Filters are not case sensitive.
1082
+ #
1083
+ # The following fields in the `Version` are eligible for filtering:
1084
+ #
1085
+ # * `display_name` - The display name of the Version. Allowed
1086
+ # comparison operators: `=`.
1087
+ # * `create_time` - The time at which the Version was created. The
1088
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
1089
+ # format. Allowed comparison operators: `>` and `<`.
1090
+ # * `lifecycle.enum_values.values.id` - The allowed value id of the
1091
+ # lifecycle attribute associated with the Version. Allowed comparison
1092
+ # operators: `:`.
1093
+ # * `lifecycle.enum_values.values.display_name` - The allowed value display
1094
+ # name of the lifecycle attribute associated with the Version. Allowed
1095
+ # comparison operators: `:`.
1096
+ # * `compliance.enum_values.values.id` - The allowed value id of the
1097
+ # compliances attribute associated with the Version. Allowed comparison
1098
+ # operators: `:`.
1099
+ # * `compliance.enum_values.values.display_name` - The allowed value
1100
+ # display name of the compliances attribute associated with the Version.
1101
+ # Allowed comparison operators: `:`.
1102
+ # * `accreditation.enum_values.values.id` - The allowed value id of the
1103
+ # accreditations attribute associated with the Version. Allowed
1104
+ # comparison operators: `:`.
1105
+ # * `accreditation.enum_values.values.display_name` - The allowed value
1106
+ # display name of the accreditations attribute associated with the Version.
1107
+ # Allowed comparison operators: `:`.
1108
+ #
1109
+ # Expressions are combined with either `AND` logic operator or `OR` logical
1110
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
1111
+ # operator can be used throughout the filter string and both the operators
1112
+ # cannot be used together. No other logical operators are
1113
+ # supported. At most three filter fields are allowed in the filter
1114
+ # string and if provided more than that then `INVALID_ARGUMENT` error is
1115
+ # returned by the API.
1116
+ #
1117
+ # Here are a few examples:
1118
+ #
1119
+ # * `lifecycle.enum_values.values.id: preview-id` - The filter string
1120
+ # specifies that the id of the allowed value associated with the lifecycle
1121
+ # attribute of the Version is _preview-id_.
1122
+ # * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
1123
+ # The filter string specifies that the display name of the allowed value
1124
+ # associated with the lifecycle attribute of the Version is `Preview
1125
+ # Display Name`.
1126
+ # * `lifecycle.enum_values.values.id: preview-id AND create_time <
1127
+ # \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
1128
+ # The id of the allowed value associated with the lifecycle attribute of
1129
+ # the Version is _preview-id_ and it was created before _2021-08-15
1130
+ # 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
1131
+ # * `compliance.enum_values.values.id: gdpr-id OR
1132
+ # compliance.enum_values.values.id: pci-dss-id`
1133
+ # - The id of the allowed value associated with the compliance attribute is
1134
+ # _gdpr-id_ or _pci-dss-id_.
1135
+ # @param page_size [::Integer]
1136
+ # Optional. The maximum number of versions to return. The service may return
1137
+ # fewer than this value. If unspecified, at most 50 versions will be
1138
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
1139
+ # 1000.
1140
+ # @param page_token [::String]
1141
+ # Optional. A page token, received from a previous `ListVersions` call.
1142
+ # Provide this to retrieve the subsequent page.
1143
+ #
1144
+ # When paginating, all other parameters (except page_size) provided to
1145
+ # `ListVersions` must match the call that provided the page token.
1146
+ #
1147
+ # @yield [response, operation] Access the result along with the RPC operation
1148
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Version>]
1149
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1150
+ #
1151
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Version>]
1152
+ #
1153
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1154
+ #
1155
+ # @example Basic example
1156
+ # require "google/cloud/api_hub/v1"
1157
+ #
1158
+ # # Create a client object. The client can be reused for multiple calls.
1159
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1160
+ #
1161
+ # # Create a request. To set request fields, pass in keyword arguments.
1162
+ # request = Google::Cloud::ApiHub::V1::ListVersionsRequest.new
1163
+ #
1164
+ # # Call the list_versions method.
1165
+ # result = client.list_versions request
1166
+ #
1167
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1168
+ # # over elements, and API calls will be issued to fetch pages as needed.
1169
+ # result.each do |item|
1170
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Version.
1171
+ # p item
1172
+ # end
1173
+ #
1174
+ def list_versions request, options = nil
1175
+ raise ::ArgumentError, "request must be provided" if request.nil?
1176
+
1177
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListVersionsRequest
1178
+
1179
+ # Converts hash and nil to an options object
1180
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1181
+
1182
+ # Customize the options with defaults
1183
+ metadata = @config.rpcs.list_versions.metadata.to_h
1184
+
1185
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1186
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1187
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1188
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1189
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1190
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1191
+
1192
+ header_params = {}
1193
+ if request.parent
1194
+ header_params["parent"] = request.parent
1195
+ end
1196
+
1197
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1198
+ metadata[:"x-goog-request-params"] ||= request_params_header
1199
+
1200
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
1201
+ metadata: metadata,
1202
+ retry_policy: @config.rpcs.list_versions.retry_policy
1203
+
1204
+ options.apply_defaults timeout: @config.timeout,
1205
+ metadata: @config.metadata,
1206
+ retry_policy: @config.retry_policy
1207
+
1208
+ @api_hub_stub.call_rpc :list_versions, request, options: options do |response, operation|
1209
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_versions, request, response, operation, options
1210
+ yield response, operation if block_given?
1211
+ return response
1212
+ end
1213
+ rescue ::GRPC::BadStatus => e
1214
+ raise ::Google::Cloud::Error.from_error(e)
1215
+ end
1216
+
1217
+ ##
1218
+ # Update API version. The following fields in the
1219
+ # {::Google::Cloud::ApiHub::V1::Version version} can be updated currently:
1220
+ #
1221
+ # * {::Google::Cloud::ApiHub::V1::Version#display_name display_name}
1222
+ # * {::Google::Cloud::ApiHub::V1::Version#description description}
1223
+ # * {::Google::Cloud::ApiHub::V1::Version#documentation documentation}
1224
+ # * {::Google::Cloud::ApiHub::V1::Version#deployments deployments}
1225
+ # * {::Google::Cloud::ApiHub::V1::Version#lifecycle lifecycle}
1226
+ # * {::Google::Cloud::ApiHub::V1::Version#compliance compliance}
1227
+ # * {::Google::Cloud::ApiHub::V1::Version#accreditation accreditation}
1228
+ # * {::Google::Cloud::ApiHub::V1::Version#attributes attributes}
1229
+ #
1230
+ # The
1231
+ # {::Google::Cloud::ApiHub::V1::UpdateVersionRequest#update_mask update_mask}
1232
+ # should be used to specify the fields being updated.
1233
+ #
1234
+ # @overload update_version(request, options = nil)
1235
+ # Pass arguments to `update_version` via a request object, either of type
1236
+ # {::Google::Cloud::ApiHub::V1::UpdateVersionRequest} or an equivalent Hash.
1237
+ #
1238
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateVersionRequest, ::Hash]
1239
+ # A request object representing the call parameters. Required. To specify no
1240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1241
+ # @param options [::Gapic::CallOptions, ::Hash]
1242
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1243
+ #
1244
+ # @overload update_version(version: nil, update_mask: nil)
1245
+ # Pass arguments to `update_version` via keyword arguments. Note that at
1246
+ # least one keyword argument is required. To specify no parameters, or to keep all
1247
+ # the default parameter values, pass an empty Hash as a request object (see above).
1248
+ #
1249
+ # @param version [::Google::Cloud::ApiHub::V1::Version, ::Hash]
1250
+ # Required. The API version to update.
1251
+ #
1252
+ # The version's `name` field is used to identify the API version to update.
1253
+ # Format:
1254
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1255
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1256
+ # Required. The list of fields to update.
1257
+ #
1258
+ # @yield [response, operation] Access the result along with the RPC operation
1259
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Version]
1260
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1261
+ #
1262
+ # @return [::Google::Cloud::ApiHub::V1::Version]
1263
+ #
1264
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1265
+ #
1266
+ # @example Basic example
1267
+ # require "google/cloud/api_hub/v1"
1268
+ #
1269
+ # # Create a client object. The client can be reused for multiple calls.
1270
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1271
+ #
1272
+ # # Create a request. To set request fields, pass in keyword arguments.
1273
+ # request = Google::Cloud::ApiHub::V1::UpdateVersionRequest.new
1274
+ #
1275
+ # # Call the update_version method.
1276
+ # result = client.update_version request
1277
+ #
1278
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Version.
1279
+ # p result
1280
+ #
1281
+ def update_version request, options = nil
1282
+ raise ::ArgumentError, "request must be provided" if request.nil?
1283
+
1284
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateVersionRequest
1285
+
1286
+ # Converts hash and nil to an options object
1287
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1288
+
1289
+ # Customize the options with defaults
1290
+ metadata = @config.rpcs.update_version.metadata.to_h
1291
+
1292
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1293
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1294
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1295
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1296
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1297
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1298
+
1299
+ header_params = {}
1300
+ if request.version&.name
1301
+ header_params["version.name"] = request.version.name
1302
+ end
1303
+
1304
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1305
+ metadata[:"x-goog-request-params"] ||= request_params_header
1306
+
1307
+ options.apply_defaults timeout: @config.rpcs.update_version.timeout,
1308
+ metadata: metadata,
1309
+ retry_policy: @config.rpcs.update_version.retry_policy
1310
+
1311
+ options.apply_defaults timeout: @config.timeout,
1312
+ metadata: @config.metadata,
1313
+ retry_policy: @config.retry_policy
1314
+
1315
+ @api_hub_stub.call_rpc :update_version, request, options: options do |response, operation|
1316
+ yield response, operation if block_given?
1317
+ return response
1318
+ end
1319
+ rescue ::GRPC::BadStatus => e
1320
+ raise ::Google::Cloud::Error.from_error(e)
1321
+ end
1322
+
1323
+ ##
1324
+ # Delete an API version. Version can only be deleted if all underlying specs,
1325
+ # operations, definitions and linked deployments are deleted.
1326
+ #
1327
+ # @overload delete_version(request, options = nil)
1328
+ # Pass arguments to `delete_version` via a request object, either of type
1329
+ # {::Google::Cloud::ApiHub::V1::DeleteVersionRequest} or an equivalent Hash.
1330
+ #
1331
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteVersionRequest, ::Hash]
1332
+ # A request object representing the call parameters. Required. To specify no
1333
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1334
+ # @param options [::Gapic::CallOptions, ::Hash]
1335
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1336
+ #
1337
+ # @overload delete_version(name: nil, force: nil)
1338
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
1339
+ # least one keyword argument is required. To specify no parameters, or to keep all
1340
+ # the default parameter values, pass an empty Hash as a request object (see above).
1341
+ #
1342
+ # @param name [::String]
1343
+ # Required. The name of the version to delete.
1344
+ # Format:
1345
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1346
+ # @param force [::Boolean]
1347
+ # Optional. If set to true, any specs from this version will also be deleted.
1348
+ # Otherwise, the request will only work if the version has no specs.
1349
+ #
1350
+ # @yield [response, operation] Access the result along with the RPC operation
1351
+ # @yieldparam response [::Google::Protobuf::Empty]
1352
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1353
+ #
1354
+ # @return [::Google::Protobuf::Empty]
1355
+ #
1356
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1357
+ #
1358
+ # @example Basic example
1359
+ # require "google/cloud/api_hub/v1"
1360
+ #
1361
+ # # Create a client object. The client can be reused for multiple calls.
1362
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1363
+ #
1364
+ # # Create a request. To set request fields, pass in keyword arguments.
1365
+ # request = Google::Cloud::ApiHub::V1::DeleteVersionRequest.new
1366
+ #
1367
+ # # Call the delete_version method.
1368
+ # result = client.delete_version request
1369
+ #
1370
+ # # The returned object is of type Google::Protobuf::Empty.
1371
+ # p result
1372
+ #
1373
+ def delete_version request, options = nil
1374
+ raise ::ArgumentError, "request must be provided" if request.nil?
1375
+
1376
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteVersionRequest
1377
+
1378
+ # Converts hash and nil to an options object
1379
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1380
+
1381
+ # Customize the options with defaults
1382
+ metadata = @config.rpcs.delete_version.metadata.to_h
1383
+
1384
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1385
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1386
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1387
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1388
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1389
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1390
+
1391
+ header_params = {}
1392
+ if request.name
1393
+ header_params["name"] = request.name
1394
+ end
1395
+
1396
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1397
+ metadata[:"x-goog-request-params"] ||= request_params_header
1398
+
1399
+ options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
1400
+ metadata: metadata,
1401
+ retry_policy: @config.rpcs.delete_version.retry_policy
1402
+
1403
+ options.apply_defaults timeout: @config.timeout,
1404
+ metadata: @config.metadata,
1405
+ retry_policy: @config.retry_policy
1406
+
1407
+ @api_hub_stub.call_rpc :delete_version, request, options: options do |response, operation|
1408
+ yield response, operation if block_given?
1409
+ return response
1410
+ end
1411
+ rescue ::GRPC::BadStatus => e
1412
+ raise ::Google::Cloud::Error.from_error(e)
1413
+ end
1414
+
1415
+ ##
1416
+ # Add a spec to an API version in the API hub.
1417
+ # Multiple specs can be added to an API version.
1418
+ # Note, while adding a spec, at least one of `contents` or `source_uri` must
1419
+ # be provided. If `contents` is provided, then `spec_type` must also be
1420
+ # provided.
1421
+ #
1422
+ # On adding a spec with contents to the version, the operations present in it
1423
+ # will be added to the version.Note that the file contents in the spec should
1424
+ # be of the same type as defined in the
1425
+ # `projects/{project}/locations/{location}/attributes/system-spec-type`
1426
+ # attribute associated with spec resource. Note that specs of various types
1427
+ # can be uploaded, however parsing of details is supported for OpenAPI spec
1428
+ # currently.
1429
+ #
1430
+ # In order to access the information parsed from the spec, use the
1431
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client#get_spec GetSpec} method.
1432
+ # In order to access the raw contents for a particular spec, use the
1433
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client#get_spec_contents GetSpecContents} method.
1434
+ # In order to access the operations parsed from the spec, use the
1435
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client#list_api_operations ListAPIOperations}
1436
+ # method.
1437
+ #
1438
+ # @overload create_spec(request, options = nil)
1439
+ # Pass arguments to `create_spec` via a request object, either of type
1440
+ # {::Google::Cloud::ApiHub::V1::CreateSpecRequest} or an equivalent Hash.
1441
+ #
1442
+ # @param request [::Google::Cloud::ApiHub::V1::CreateSpecRequest, ::Hash]
1443
+ # A request object representing the call parameters. Required. To specify no
1444
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1445
+ # @param options [::Gapic::CallOptions, ::Hash]
1446
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1447
+ #
1448
+ # @overload create_spec(parent: nil, spec_id: nil, spec: nil)
1449
+ # Pass arguments to `create_spec` via keyword arguments. Note that at
1450
+ # least one keyword argument is required. To specify no parameters, or to keep all
1451
+ # the default parameter values, pass an empty Hash as a request object (see above).
1452
+ #
1453
+ # @param parent [::String]
1454
+ # Required. The parent resource for Spec.
1455
+ # Format:
1456
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1457
+ # @param spec_id [::String]
1458
+ # Optional. The ID to use for the spec, which will become the final component
1459
+ # of the spec's resource name. This field is optional.
1460
+ #
1461
+ # * If provided, the same will be used. The service will throw an error if
1462
+ # the specified id is already used by another spec in the API
1463
+ # resource.
1464
+ # * If not provided, a system generated id will be used.
1465
+ #
1466
+ # This value should be 4-500 characters, and valid characters
1467
+ # are /[a-z][A-Z][0-9]-_/.
1468
+ # @param spec [::Google::Cloud::ApiHub::V1::Spec, ::Hash]
1469
+ # Required. The spec to create.
1470
+ #
1471
+ # @yield [response, operation] Access the result along with the RPC operation
1472
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Spec]
1473
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1474
+ #
1475
+ # @return [::Google::Cloud::ApiHub::V1::Spec]
1476
+ #
1477
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1478
+ #
1479
+ # @example Basic example
1480
+ # require "google/cloud/api_hub/v1"
1481
+ #
1482
+ # # Create a client object. The client can be reused for multiple calls.
1483
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1484
+ #
1485
+ # # Create a request. To set request fields, pass in keyword arguments.
1486
+ # request = Google::Cloud::ApiHub::V1::CreateSpecRequest.new
1487
+ #
1488
+ # # Call the create_spec method.
1489
+ # result = client.create_spec request
1490
+ #
1491
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Spec.
1492
+ # p result
1493
+ #
1494
+ def create_spec request, options = nil
1495
+ raise ::ArgumentError, "request must be provided" if request.nil?
1496
+
1497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateSpecRequest
1498
+
1499
+ # Converts hash and nil to an options object
1500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1501
+
1502
+ # Customize the options with defaults
1503
+ metadata = @config.rpcs.create_spec.metadata.to_h
1504
+
1505
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1506
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1508
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1509
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1510
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1511
+
1512
+ header_params = {}
1513
+ if request.parent
1514
+ header_params["parent"] = request.parent
1515
+ end
1516
+
1517
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1518
+ metadata[:"x-goog-request-params"] ||= request_params_header
1519
+
1520
+ options.apply_defaults timeout: @config.rpcs.create_spec.timeout,
1521
+ metadata: metadata,
1522
+ retry_policy: @config.rpcs.create_spec.retry_policy
1523
+
1524
+ options.apply_defaults timeout: @config.timeout,
1525
+ metadata: @config.metadata,
1526
+ retry_policy: @config.retry_policy
1527
+
1528
+ @api_hub_stub.call_rpc :create_spec, request, options: options do |response, operation|
1529
+ yield response, operation if block_given?
1530
+ return response
1531
+ end
1532
+ rescue ::GRPC::BadStatus => e
1533
+ raise ::Google::Cloud::Error.from_error(e)
1534
+ end
1535
+
1536
+ ##
1537
+ # Get details about the information parsed from a spec.
1538
+ # Note that this method does not return the raw spec contents.
1539
+ # Use {::Google::Cloud::ApiHub::V1::ApiHub::Client#get_spec_contents GetSpecContents} method
1540
+ # to retrieve the same.
1541
+ #
1542
+ # @overload get_spec(request, options = nil)
1543
+ # Pass arguments to `get_spec` via a request object, either of type
1544
+ # {::Google::Cloud::ApiHub::V1::GetSpecRequest} or an equivalent Hash.
1545
+ #
1546
+ # @param request [::Google::Cloud::ApiHub::V1::GetSpecRequest, ::Hash]
1547
+ # A request object representing the call parameters. Required. To specify no
1548
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1549
+ # @param options [::Gapic::CallOptions, ::Hash]
1550
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1551
+ #
1552
+ # @overload get_spec(name: nil)
1553
+ # Pass arguments to `get_spec` via keyword arguments. Note that at
1554
+ # least one keyword argument is required. To specify no parameters, or to keep all
1555
+ # the default parameter values, pass an empty Hash as a request object (see above).
1556
+ #
1557
+ # @param name [::String]
1558
+ # Required. The name of the spec to retrieve.
1559
+ # Format:
1560
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1561
+ #
1562
+ # @yield [response, operation] Access the result along with the RPC operation
1563
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Spec]
1564
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1565
+ #
1566
+ # @return [::Google::Cloud::ApiHub::V1::Spec]
1567
+ #
1568
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1569
+ #
1570
+ # @example Basic example
1571
+ # require "google/cloud/api_hub/v1"
1572
+ #
1573
+ # # Create a client object. The client can be reused for multiple calls.
1574
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1575
+ #
1576
+ # # Create a request. To set request fields, pass in keyword arguments.
1577
+ # request = Google::Cloud::ApiHub::V1::GetSpecRequest.new
1578
+ #
1579
+ # # Call the get_spec method.
1580
+ # result = client.get_spec request
1581
+ #
1582
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Spec.
1583
+ # p result
1584
+ #
1585
+ def get_spec request, options = nil
1586
+ raise ::ArgumentError, "request must be provided" if request.nil?
1587
+
1588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetSpecRequest
1589
+
1590
+ # Converts hash and nil to an options object
1591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1592
+
1593
+ # Customize the options with defaults
1594
+ metadata = @config.rpcs.get_spec.metadata.to_h
1595
+
1596
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1599
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1600
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1601
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1602
+
1603
+ header_params = {}
1604
+ if request.name
1605
+ header_params["name"] = request.name
1606
+ end
1607
+
1608
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1609
+ metadata[:"x-goog-request-params"] ||= request_params_header
1610
+
1611
+ options.apply_defaults timeout: @config.rpcs.get_spec.timeout,
1612
+ metadata: metadata,
1613
+ retry_policy: @config.rpcs.get_spec.retry_policy
1614
+
1615
+ options.apply_defaults timeout: @config.timeout,
1616
+ metadata: @config.metadata,
1617
+ retry_policy: @config.retry_policy
1618
+
1619
+ @api_hub_stub.call_rpc :get_spec, request, options: options do |response, operation|
1620
+ yield response, operation if block_given?
1621
+ return response
1622
+ end
1623
+ rescue ::GRPC::BadStatus => e
1624
+ raise ::Google::Cloud::Error.from_error(e)
1625
+ end
1626
+
1627
+ ##
1628
+ # Get spec contents.
1629
+ #
1630
+ # @overload get_spec_contents(request, options = nil)
1631
+ # Pass arguments to `get_spec_contents` via a request object, either of type
1632
+ # {::Google::Cloud::ApiHub::V1::GetSpecContentsRequest} or an equivalent Hash.
1633
+ #
1634
+ # @param request [::Google::Cloud::ApiHub::V1::GetSpecContentsRequest, ::Hash]
1635
+ # A request object representing the call parameters. Required. To specify no
1636
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1637
+ # @param options [::Gapic::CallOptions, ::Hash]
1638
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1639
+ #
1640
+ # @overload get_spec_contents(name: nil)
1641
+ # Pass arguments to `get_spec_contents` via keyword arguments. Note that at
1642
+ # least one keyword argument is required. To specify no parameters, or to keep all
1643
+ # the default parameter values, pass an empty Hash as a request object (see above).
1644
+ #
1645
+ # @param name [::String]
1646
+ # Required. The name of the spec whose contents need to be retrieved.
1647
+ # Format:
1648
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1649
+ #
1650
+ # @yield [response, operation] Access the result along with the RPC operation
1651
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::SpecContents]
1652
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1653
+ #
1654
+ # @return [::Google::Cloud::ApiHub::V1::SpecContents]
1655
+ #
1656
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1657
+ #
1658
+ # @example Basic example
1659
+ # require "google/cloud/api_hub/v1"
1660
+ #
1661
+ # # Create a client object. The client can be reused for multiple calls.
1662
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1663
+ #
1664
+ # # Create a request. To set request fields, pass in keyword arguments.
1665
+ # request = Google::Cloud::ApiHub::V1::GetSpecContentsRequest.new
1666
+ #
1667
+ # # Call the get_spec_contents method.
1668
+ # result = client.get_spec_contents request
1669
+ #
1670
+ # # The returned object is of type Google::Cloud::ApiHub::V1::SpecContents.
1671
+ # p result
1672
+ #
1673
+ def get_spec_contents request, options = nil
1674
+ raise ::ArgumentError, "request must be provided" if request.nil?
1675
+
1676
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetSpecContentsRequest
1677
+
1678
+ # Converts hash and nil to an options object
1679
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1680
+
1681
+ # Customize the options with defaults
1682
+ metadata = @config.rpcs.get_spec_contents.metadata.to_h
1683
+
1684
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1685
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1686
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1687
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1688
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1689
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1690
+
1691
+ header_params = {}
1692
+ if request.name
1693
+ header_params["name"] = request.name
1694
+ end
1695
+
1696
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1697
+ metadata[:"x-goog-request-params"] ||= request_params_header
1698
+
1699
+ options.apply_defaults timeout: @config.rpcs.get_spec_contents.timeout,
1700
+ metadata: metadata,
1701
+ retry_policy: @config.rpcs.get_spec_contents.retry_policy
1702
+
1703
+ options.apply_defaults timeout: @config.timeout,
1704
+ metadata: @config.metadata,
1705
+ retry_policy: @config.retry_policy
1706
+
1707
+ @api_hub_stub.call_rpc :get_spec_contents, request, options: options do |response, operation|
1708
+ yield response, operation if block_given?
1709
+ return response
1710
+ end
1711
+ rescue ::GRPC::BadStatus => e
1712
+ raise ::Google::Cloud::Error.from_error(e)
1713
+ end
1714
+
1715
+ ##
1716
+ # List specs corresponding to a particular API resource.
1717
+ #
1718
+ # @overload list_specs(request, options = nil)
1719
+ # Pass arguments to `list_specs` via a request object, either of type
1720
+ # {::Google::Cloud::ApiHub::V1::ListSpecsRequest} or an equivalent Hash.
1721
+ #
1722
+ # @param request [::Google::Cloud::ApiHub::V1::ListSpecsRequest, ::Hash]
1723
+ # A request object representing the call parameters. Required. To specify no
1724
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1725
+ # @param options [::Gapic::CallOptions, ::Hash]
1726
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1727
+ #
1728
+ # @overload list_specs(parent: nil, filter: nil, page_size: nil, page_token: nil)
1729
+ # Pass arguments to `list_specs` via keyword arguments. Note that at
1730
+ # least one keyword argument is required. To specify no parameters, or to keep all
1731
+ # the default parameter values, pass an empty Hash as a request object (see above).
1732
+ #
1733
+ # @param parent [::String]
1734
+ # Required. The parent, which owns this collection of specs.
1735
+ # Format:
1736
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1737
+ # @param filter [::String]
1738
+ # Optional. An expression that filters the list of Specs.
1739
+ #
1740
+ # A filter expression consists of a field name, a comparison
1741
+ # operator, and a value for filtering. The value must be a string. The
1742
+ # comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
1743
+ # case sensitive.
1744
+ #
1745
+ # The following fields in the `Spec` are eligible for filtering:
1746
+ #
1747
+ # * `display_name` - The display name of the Spec. Allowed comparison
1748
+ # operators: `=`.
1749
+ # * `create_time` - The time at which the Spec was created. The
1750
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
1751
+ # format. Allowed comparison operators: `>` and `<`.
1752
+ # * `spec_type.enum_values.values.id` - The allowed value id of the
1753
+ # spec_type attribute associated with the Spec. Allowed comparison
1754
+ # operators: `:`.
1755
+ # * `spec_type.enum_values.values.display_name` - The allowed value display
1756
+ # name of the spec_type attribute associated with the Spec. Allowed
1757
+ # comparison operators: `:`.
1758
+ # * `lint_response.json_values.values` - The json value of the
1759
+ # lint_response attribute associated with the Spec. Allowed comparison
1760
+ # operators: `:`.
1761
+ # * `mime_type` - The MIME type of the Spec. Allowed comparison
1762
+ # operators: `=`.
1763
+ #
1764
+ # Expressions are combined with either `AND` logic operator or `OR` logical
1765
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
1766
+ # operator can be used throughout the filter string and both the operators
1767
+ # cannot be used together. No other logical operators are
1768
+ # supported. At most three filter fields are allowed in the filter
1769
+ # string and if provided more than that then `INVALID_ARGUMENT` error is
1770
+ # returned by the API.
1771
+ #
1772
+ # Here are a few examples:
1773
+ #
1774
+ # * `spec_type.enum_values.values.id: rest-id` - The filter
1775
+ # string specifies that the id of the allowed value associated with the
1776
+ # spec_type attribute is _rest-id_.
1777
+ # * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
1778
+ # The filter string specifies that the display name of the allowed value
1779
+ # associated with the spec_type attribute is `Rest Display Name`.
1780
+ # * `spec_type.enum_values.values.id: grpc-id AND create_time <
1781
+ # \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
1782
+ # The id of the allowed value associated with the spec_type attribute is
1783
+ # _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
1784
+ # after _2021-08-10 12:00:00 UTC_.
1785
+ # * `spec_type.enum_values.values.id: rest-id OR
1786
+ # spec_type.enum_values.values.id: grpc-id`
1787
+ # - The id of the allowed value associated with the spec_type attribute is
1788
+ # _rest-id_ or _grpc-id_.
1789
+ # @param page_size [::Integer]
1790
+ # Optional. The maximum number of specs to return. The service may return
1791
+ # fewer than this value. If unspecified, at most 50 specs will be
1792
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
1793
+ # 1000.
1794
+ # @param page_token [::String]
1795
+ # Optional. A page token, received from a previous `ListSpecs` call.
1796
+ # Provide this to retrieve the subsequent page.
1797
+ #
1798
+ # When paginating, all other parameters provided to `ListSpecs` must
1799
+ # match the call that provided the page token.
1800
+ #
1801
+ # @yield [response, operation] Access the result along with the RPC operation
1802
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Spec>]
1803
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1804
+ #
1805
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Spec>]
1806
+ #
1807
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1808
+ #
1809
+ # @example Basic example
1810
+ # require "google/cloud/api_hub/v1"
1811
+ #
1812
+ # # Create a client object. The client can be reused for multiple calls.
1813
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1814
+ #
1815
+ # # Create a request. To set request fields, pass in keyword arguments.
1816
+ # request = Google::Cloud::ApiHub::V1::ListSpecsRequest.new
1817
+ #
1818
+ # # Call the list_specs method.
1819
+ # result = client.list_specs request
1820
+ #
1821
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1822
+ # # over elements, and API calls will be issued to fetch pages as needed.
1823
+ # result.each do |item|
1824
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Spec.
1825
+ # p item
1826
+ # end
1827
+ #
1828
+ def list_specs request, options = nil
1829
+ raise ::ArgumentError, "request must be provided" if request.nil?
1830
+
1831
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListSpecsRequest
1832
+
1833
+ # Converts hash and nil to an options object
1834
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1835
+
1836
+ # Customize the options with defaults
1837
+ metadata = @config.rpcs.list_specs.metadata.to_h
1838
+
1839
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1840
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1841
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1842
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1843
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1844
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1845
+
1846
+ header_params = {}
1847
+ if request.parent
1848
+ header_params["parent"] = request.parent
1849
+ end
1850
+
1851
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1852
+ metadata[:"x-goog-request-params"] ||= request_params_header
1853
+
1854
+ options.apply_defaults timeout: @config.rpcs.list_specs.timeout,
1855
+ metadata: metadata,
1856
+ retry_policy: @config.rpcs.list_specs.retry_policy
1857
+
1858
+ options.apply_defaults timeout: @config.timeout,
1859
+ metadata: @config.metadata,
1860
+ retry_policy: @config.retry_policy
1861
+
1862
+ @api_hub_stub.call_rpc :list_specs, request, options: options do |response, operation|
1863
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_specs, request, response, operation, options
1864
+ yield response, operation if block_given?
1865
+ return response
1866
+ end
1867
+ rescue ::GRPC::BadStatus => e
1868
+ raise ::Google::Cloud::Error.from_error(e)
1869
+ end
1870
+
1871
+ ##
1872
+ # Update spec. The following fields in the
1873
+ # {::Google::Cloud::ApiHub::V1::Spec spec} can be updated:
1874
+ #
1875
+ # * {::Google::Cloud::ApiHub::V1::Spec#display_name display_name}
1876
+ # * {::Google::Cloud::ApiHub::V1::Spec#source_uri source_uri}
1877
+ # * {::Google::Cloud::ApiHub::V1::Spec#lint_response lint_response}
1878
+ # * {::Google::Cloud::ApiHub::V1::Spec#attributes attributes}
1879
+ # * {::Google::Cloud::ApiHub::V1::Spec#contents contents}
1880
+ # * {::Google::Cloud::ApiHub::V1::Spec#spec_type spec_type}
1881
+ #
1882
+ # In case of an OAS spec, updating spec contents can lead to:
1883
+ # 1. Creation, deletion and update of operations.
1884
+ # 2. Creation, deletion and update of definitions.
1885
+ # 3. Update of other info parsed out from the new spec.
1886
+ #
1887
+ # In case of contents or source_uri being present in update mask, spec_type
1888
+ # must also be present. Also, spec_type can not be present in update mask if
1889
+ # contents or source_uri is not present.
1890
+ #
1891
+ # The
1892
+ # {::Google::Cloud::ApiHub::V1::UpdateSpecRequest#update_mask update_mask}
1893
+ # should be used to specify the fields being updated.
1894
+ #
1895
+ # @overload update_spec(request, options = nil)
1896
+ # Pass arguments to `update_spec` via a request object, either of type
1897
+ # {::Google::Cloud::ApiHub::V1::UpdateSpecRequest} or an equivalent Hash.
1898
+ #
1899
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateSpecRequest, ::Hash]
1900
+ # A request object representing the call parameters. Required. To specify no
1901
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1902
+ # @param options [::Gapic::CallOptions, ::Hash]
1903
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1904
+ #
1905
+ # @overload update_spec(spec: nil, update_mask: nil)
1906
+ # Pass arguments to `update_spec` via keyword arguments. Note that at
1907
+ # least one keyword argument is required. To specify no parameters, or to keep all
1908
+ # the default parameter values, pass an empty Hash as a request object (see above).
1909
+ #
1910
+ # @param spec [::Google::Cloud::ApiHub::V1::Spec, ::Hash]
1911
+ # Required. The spec to update.
1912
+ #
1913
+ # The spec's `name` field is used to identify the spec to
1914
+ # update. Format:
1915
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1916
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1917
+ # Required. The list of fields to update.
1918
+ #
1919
+ # @yield [response, operation] Access the result along with the RPC operation
1920
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Spec]
1921
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1922
+ #
1923
+ # @return [::Google::Cloud::ApiHub::V1::Spec]
1924
+ #
1925
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1926
+ #
1927
+ # @example Basic example
1928
+ # require "google/cloud/api_hub/v1"
1929
+ #
1930
+ # # Create a client object. The client can be reused for multiple calls.
1931
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
1932
+ #
1933
+ # # Create a request. To set request fields, pass in keyword arguments.
1934
+ # request = Google::Cloud::ApiHub::V1::UpdateSpecRequest.new
1935
+ #
1936
+ # # Call the update_spec method.
1937
+ # result = client.update_spec request
1938
+ #
1939
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Spec.
1940
+ # p result
1941
+ #
1942
+ def update_spec request, options = nil
1943
+ raise ::ArgumentError, "request must be provided" if request.nil?
1944
+
1945
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateSpecRequest
1946
+
1947
+ # Converts hash and nil to an options object
1948
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1949
+
1950
+ # Customize the options with defaults
1951
+ metadata = @config.rpcs.update_spec.metadata.to_h
1952
+
1953
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1954
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1955
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1956
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
1957
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1958
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1959
+
1960
+ header_params = {}
1961
+ if request.spec&.name
1962
+ header_params["spec.name"] = request.spec.name
1963
+ end
1964
+
1965
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1966
+ metadata[:"x-goog-request-params"] ||= request_params_header
1967
+
1968
+ options.apply_defaults timeout: @config.rpcs.update_spec.timeout,
1969
+ metadata: metadata,
1970
+ retry_policy: @config.rpcs.update_spec.retry_policy
1971
+
1972
+ options.apply_defaults timeout: @config.timeout,
1973
+ metadata: @config.metadata,
1974
+ retry_policy: @config.retry_policy
1975
+
1976
+ @api_hub_stub.call_rpc :update_spec, request, options: options do |response, operation|
1977
+ yield response, operation if block_given?
1978
+ return response
1979
+ end
1980
+ rescue ::GRPC::BadStatus => e
1981
+ raise ::Google::Cloud::Error.from_error(e)
1982
+ end
1983
+
1984
+ ##
1985
+ # Delete a spec.
1986
+ # Deleting a spec will also delete the associated operations from the
1987
+ # version.
1988
+ #
1989
+ # @overload delete_spec(request, options = nil)
1990
+ # Pass arguments to `delete_spec` via a request object, either of type
1991
+ # {::Google::Cloud::ApiHub::V1::DeleteSpecRequest} or an equivalent Hash.
1992
+ #
1993
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteSpecRequest, ::Hash]
1994
+ # A request object representing the call parameters. Required. To specify no
1995
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1996
+ # @param options [::Gapic::CallOptions, ::Hash]
1997
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1998
+ #
1999
+ # @overload delete_spec(name: nil)
2000
+ # Pass arguments to `delete_spec` via keyword arguments. Note that at
2001
+ # least one keyword argument is required. To specify no parameters, or to keep all
2002
+ # the default parameter values, pass an empty Hash as a request object (see above).
2003
+ #
2004
+ # @param name [::String]
2005
+ # Required. The name of the spec to delete.
2006
+ # Format:
2007
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
2008
+ #
2009
+ # @yield [response, operation] Access the result along with the RPC operation
2010
+ # @yieldparam response [::Google::Protobuf::Empty]
2011
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2012
+ #
2013
+ # @return [::Google::Protobuf::Empty]
2014
+ #
2015
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2016
+ #
2017
+ # @example Basic example
2018
+ # require "google/cloud/api_hub/v1"
2019
+ #
2020
+ # # Create a client object. The client can be reused for multiple calls.
2021
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2022
+ #
2023
+ # # Create a request. To set request fields, pass in keyword arguments.
2024
+ # request = Google::Cloud::ApiHub::V1::DeleteSpecRequest.new
2025
+ #
2026
+ # # Call the delete_spec method.
2027
+ # result = client.delete_spec request
2028
+ #
2029
+ # # The returned object is of type Google::Protobuf::Empty.
2030
+ # p result
2031
+ #
2032
+ def delete_spec request, options = nil
2033
+ raise ::ArgumentError, "request must be provided" if request.nil?
2034
+
2035
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteSpecRequest
2036
+
2037
+ # Converts hash and nil to an options object
2038
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2039
+
2040
+ # Customize the options with defaults
2041
+ metadata = @config.rpcs.delete_spec.metadata.to_h
2042
+
2043
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2044
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2045
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2046
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2047
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2048
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2049
+
2050
+ header_params = {}
2051
+ if request.name
2052
+ header_params["name"] = request.name
2053
+ end
2054
+
2055
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2056
+ metadata[:"x-goog-request-params"] ||= request_params_header
2057
+
2058
+ options.apply_defaults timeout: @config.rpcs.delete_spec.timeout,
2059
+ metadata: metadata,
2060
+ retry_policy: @config.rpcs.delete_spec.retry_policy
2061
+
2062
+ options.apply_defaults timeout: @config.timeout,
2063
+ metadata: @config.metadata,
2064
+ retry_policy: @config.retry_policy
2065
+
2066
+ @api_hub_stub.call_rpc :delete_spec, request, options: options do |response, operation|
2067
+ yield response, operation if block_given?
2068
+ return response
2069
+ end
2070
+ rescue ::GRPC::BadStatus => e
2071
+ raise ::Google::Cloud::Error.from_error(e)
2072
+ end
2073
+
2074
+ ##
2075
+ # Get details about a particular operation in API version.
2076
+ #
2077
+ # @overload get_api_operation(request, options = nil)
2078
+ # Pass arguments to `get_api_operation` via a request object, either of type
2079
+ # {::Google::Cloud::ApiHub::V1::GetApiOperationRequest} or an equivalent Hash.
2080
+ #
2081
+ # @param request [::Google::Cloud::ApiHub::V1::GetApiOperationRequest, ::Hash]
2082
+ # A request object representing the call parameters. Required. To specify no
2083
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2084
+ # @param options [::Gapic::CallOptions, ::Hash]
2085
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2086
+ #
2087
+ # @overload get_api_operation(name: nil)
2088
+ # Pass arguments to `get_api_operation` via keyword arguments. Note that at
2089
+ # least one keyword argument is required. To specify no parameters, or to keep all
2090
+ # the default parameter values, pass an empty Hash as a request object (see above).
2091
+ #
2092
+ # @param name [::String]
2093
+ # Required. The name of the operation to retrieve.
2094
+ # Format:
2095
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
2096
+ #
2097
+ # @yield [response, operation] Access the result along with the RPC operation
2098
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::ApiOperation]
2099
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2100
+ #
2101
+ # @return [::Google::Cloud::ApiHub::V1::ApiOperation]
2102
+ #
2103
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2104
+ #
2105
+ # @example Basic example
2106
+ # require "google/cloud/api_hub/v1"
2107
+ #
2108
+ # # Create a client object. The client can be reused for multiple calls.
2109
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2110
+ #
2111
+ # # Create a request. To set request fields, pass in keyword arguments.
2112
+ # request = Google::Cloud::ApiHub::V1::GetApiOperationRequest.new
2113
+ #
2114
+ # # Call the get_api_operation method.
2115
+ # result = client.get_api_operation request
2116
+ #
2117
+ # # The returned object is of type Google::Cloud::ApiHub::V1::ApiOperation.
2118
+ # p result
2119
+ #
2120
+ def get_api_operation request, options = nil
2121
+ raise ::ArgumentError, "request must be provided" if request.nil?
2122
+
2123
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetApiOperationRequest
2124
+
2125
+ # Converts hash and nil to an options object
2126
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2127
+
2128
+ # Customize the options with defaults
2129
+ metadata = @config.rpcs.get_api_operation.metadata.to_h
2130
+
2131
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2132
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2133
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2134
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2135
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2136
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2137
+
2138
+ header_params = {}
2139
+ if request.name
2140
+ header_params["name"] = request.name
2141
+ end
2142
+
2143
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2144
+ metadata[:"x-goog-request-params"] ||= request_params_header
2145
+
2146
+ options.apply_defaults timeout: @config.rpcs.get_api_operation.timeout,
2147
+ metadata: metadata,
2148
+ retry_policy: @config.rpcs.get_api_operation.retry_policy
2149
+
2150
+ options.apply_defaults timeout: @config.timeout,
2151
+ metadata: @config.metadata,
2152
+ retry_policy: @config.retry_policy
2153
+
2154
+ @api_hub_stub.call_rpc :get_api_operation, request, options: options do |response, operation|
2155
+ yield response, operation if block_given?
2156
+ return response
2157
+ end
2158
+ rescue ::GRPC::BadStatus => e
2159
+ raise ::Google::Cloud::Error.from_error(e)
2160
+ end
2161
+
2162
+ ##
2163
+ # List operations in an API version.
2164
+ #
2165
+ # @overload list_api_operations(request, options = nil)
2166
+ # Pass arguments to `list_api_operations` via a request object, either of type
2167
+ # {::Google::Cloud::ApiHub::V1::ListApiOperationsRequest} or an equivalent Hash.
2168
+ #
2169
+ # @param request [::Google::Cloud::ApiHub::V1::ListApiOperationsRequest, ::Hash]
2170
+ # A request object representing the call parameters. Required. To specify no
2171
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2172
+ # @param options [::Gapic::CallOptions, ::Hash]
2173
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2174
+ #
2175
+ # @overload list_api_operations(parent: nil, filter: nil, page_size: nil, page_token: nil)
2176
+ # Pass arguments to `list_api_operations` via keyword arguments. Note that at
2177
+ # least one keyword argument is required. To specify no parameters, or to keep all
2178
+ # the default parameter values, pass an empty Hash as a request object (see above).
2179
+ #
2180
+ # @param parent [::String]
2181
+ # Required. The parent which owns this collection of operations i.e., the API
2182
+ # version. Format:
2183
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
2184
+ # @param filter [::String]
2185
+ # Optional. An expression that filters the list of ApiOperations.
2186
+ #
2187
+ # A filter expression consists of a field name, a comparison
2188
+ # operator, and a value for filtering. The value must be a string or a
2189
+ # boolean. The comparison operator must be one of: `<`, `>` or
2190
+ # `=`. Filters are not case sensitive.
2191
+ #
2192
+ # The following fields in the `ApiOperation` are eligible for filtering:
2193
+ # * `name` - The ApiOperation resource name. Allowed comparison
2194
+ # operators:
2195
+ # `=`.
2196
+ # * `details.http_operation.path.path` - The http operation's complete path
2197
+ # relative to server endpoint. Allowed comparison operators: `=`.
2198
+ # * `details.http_operation.method` - The http operation method type.
2199
+ # Allowed comparison operators: `=`.
2200
+ # * `details.deprecated` - Indicates if the ApiOperation is deprecated.
2201
+ # Allowed values are True / False indicating the deprycation status of the
2202
+ # ApiOperation. Allowed comparison operators: `=`.
2203
+ # * `create_time` - The time at which the ApiOperation was created. The
2204
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
2205
+ # format. Allowed comparison operators: `>` and `<`.
2206
+ #
2207
+ # Expressions are combined with either `AND` logic operator or `OR` logical
2208
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
2209
+ # operator can be used throughout the filter string and both the operators
2210
+ # cannot be used together. No other logical operators are supported. At most
2211
+ # three filter fields are allowed in the filter string and if provided
2212
+ # more than that then `INVALID_ARGUMENT` error is returned by the API.
2213
+ #
2214
+ # Here are a few examples:
2215
+ #
2216
+ # * `details.deprecated = True` - The ApiOperation is deprecated.
2217
+ # * `details.http_operation.method = GET AND create_time <
2218
+ # \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
2219
+ # The method of the http operation of the ApiOperation is _GET_ and the
2220
+ # spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
2221
+ # 12:00:00 UTC_.
2222
+ # * `details.http_operation.method = GET OR details.http_operation.method =
2223
+ # POST`. - The http operation of the method of ApiOperation is _GET_ or
2224
+ # _POST_.
2225
+ # @param page_size [::Integer]
2226
+ # Optional. The maximum number of operations to return. The service may
2227
+ # return fewer than this value. If unspecified, at most 50 operations will be
2228
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
2229
+ # 1000.
2230
+ # @param page_token [::String]
2231
+ # Optional. A page token, received from a previous `ListApiOperations` call.
2232
+ # Provide this to retrieve the subsequent page.
2233
+ #
2234
+ # When paginating, all other parameters (except page_size) provided to
2235
+ # `ListApiOperations` must match the call that provided the page token.
2236
+ #
2237
+ # @yield [response, operation] Access the result along with the RPC operation
2238
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::ApiOperation>]
2239
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2240
+ #
2241
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::ApiOperation>]
2242
+ #
2243
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2244
+ #
2245
+ # @example Basic example
2246
+ # require "google/cloud/api_hub/v1"
2247
+ #
2248
+ # # Create a client object. The client can be reused for multiple calls.
2249
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2250
+ #
2251
+ # # Create a request. To set request fields, pass in keyword arguments.
2252
+ # request = Google::Cloud::ApiHub::V1::ListApiOperationsRequest.new
2253
+ #
2254
+ # # Call the list_api_operations method.
2255
+ # result = client.list_api_operations request
2256
+ #
2257
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2258
+ # # over elements, and API calls will be issued to fetch pages as needed.
2259
+ # result.each do |item|
2260
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::ApiOperation.
2261
+ # p item
2262
+ # end
2263
+ #
2264
+ def list_api_operations request, options = nil
2265
+ raise ::ArgumentError, "request must be provided" if request.nil?
2266
+
2267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListApiOperationsRequest
2268
+
2269
+ # Converts hash and nil to an options object
2270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2271
+
2272
+ # Customize the options with defaults
2273
+ metadata = @config.rpcs.list_api_operations.metadata.to_h
2274
+
2275
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2276
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2278
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2279
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2280
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2281
+
2282
+ header_params = {}
2283
+ if request.parent
2284
+ header_params["parent"] = request.parent
2285
+ end
2286
+
2287
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2288
+ metadata[:"x-goog-request-params"] ||= request_params_header
2289
+
2290
+ options.apply_defaults timeout: @config.rpcs.list_api_operations.timeout,
2291
+ metadata: metadata,
2292
+ retry_policy: @config.rpcs.list_api_operations.retry_policy
2293
+
2294
+ options.apply_defaults timeout: @config.timeout,
2295
+ metadata: @config.metadata,
2296
+ retry_policy: @config.retry_policy
2297
+
2298
+ @api_hub_stub.call_rpc :list_api_operations, request, options: options do |response, operation|
2299
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_api_operations, request, response, operation, options
2300
+ yield response, operation if block_given?
2301
+ return response
2302
+ end
2303
+ rescue ::GRPC::BadStatus => e
2304
+ raise ::Google::Cloud::Error.from_error(e)
2305
+ end
2306
+
2307
+ ##
2308
+ # Get details about a definition in an API version.
2309
+ #
2310
+ # @overload get_definition(request, options = nil)
2311
+ # Pass arguments to `get_definition` via a request object, either of type
2312
+ # {::Google::Cloud::ApiHub::V1::GetDefinitionRequest} or an equivalent Hash.
2313
+ #
2314
+ # @param request [::Google::Cloud::ApiHub::V1::GetDefinitionRequest, ::Hash]
2315
+ # A request object representing the call parameters. Required. To specify no
2316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2317
+ # @param options [::Gapic::CallOptions, ::Hash]
2318
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2319
+ #
2320
+ # @overload get_definition(name: nil)
2321
+ # Pass arguments to `get_definition` via keyword arguments. Note that at
2322
+ # least one keyword argument is required. To specify no parameters, or to keep all
2323
+ # the default parameter values, pass an empty Hash as a request object (see above).
2324
+ #
2325
+ # @param name [::String]
2326
+ # Required. The name of the definition to retrieve.
2327
+ # Format:
2328
+ # `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
2329
+ #
2330
+ # @yield [response, operation] Access the result along with the RPC operation
2331
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Definition]
2332
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2333
+ #
2334
+ # @return [::Google::Cloud::ApiHub::V1::Definition]
2335
+ #
2336
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2337
+ #
2338
+ # @example Basic example
2339
+ # require "google/cloud/api_hub/v1"
2340
+ #
2341
+ # # Create a client object. The client can be reused for multiple calls.
2342
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2343
+ #
2344
+ # # Create a request. To set request fields, pass in keyword arguments.
2345
+ # request = Google::Cloud::ApiHub::V1::GetDefinitionRequest.new
2346
+ #
2347
+ # # Call the get_definition method.
2348
+ # result = client.get_definition request
2349
+ #
2350
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Definition.
2351
+ # p result
2352
+ #
2353
+ def get_definition request, options = nil
2354
+ raise ::ArgumentError, "request must be provided" if request.nil?
2355
+
2356
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetDefinitionRequest
2357
+
2358
+ # Converts hash and nil to an options object
2359
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2360
+
2361
+ # Customize the options with defaults
2362
+ metadata = @config.rpcs.get_definition.metadata.to_h
2363
+
2364
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2365
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2366
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2367
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2368
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2369
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2370
+
2371
+ header_params = {}
2372
+ if request.name
2373
+ header_params["name"] = request.name
2374
+ end
2375
+
2376
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2377
+ metadata[:"x-goog-request-params"] ||= request_params_header
2378
+
2379
+ options.apply_defaults timeout: @config.rpcs.get_definition.timeout,
2380
+ metadata: metadata,
2381
+ retry_policy: @config.rpcs.get_definition.retry_policy
2382
+
2383
+ options.apply_defaults timeout: @config.timeout,
2384
+ metadata: @config.metadata,
2385
+ retry_policy: @config.retry_policy
2386
+
2387
+ @api_hub_stub.call_rpc :get_definition, request, options: options do |response, operation|
2388
+ yield response, operation if block_given?
2389
+ return response
2390
+ end
2391
+ rescue ::GRPC::BadStatus => e
2392
+ raise ::Google::Cloud::Error.from_error(e)
2393
+ end
2394
+
2395
+ ##
2396
+ # Create a deployment resource in the API hub.
2397
+ # Once a deployment resource is created, it can be associated with API
2398
+ # versions.
2399
+ #
2400
+ # @overload create_deployment(request, options = nil)
2401
+ # Pass arguments to `create_deployment` via a request object, either of type
2402
+ # {::Google::Cloud::ApiHub::V1::CreateDeploymentRequest} or an equivalent Hash.
2403
+ #
2404
+ # @param request [::Google::Cloud::ApiHub::V1::CreateDeploymentRequest, ::Hash]
2405
+ # A request object representing the call parameters. Required. To specify no
2406
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2407
+ # @param options [::Gapic::CallOptions, ::Hash]
2408
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2409
+ #
2410
+ # @overload create_deployment(parent: nil, deployment_id: nil, deployment: nil)
2411
+ # Pass arguments to `create_deployment` via keyword arguments. Note that at
2412
+ # least one keyword argument is required. To specify no parameters, or to keep all
2413
+ # the default parameter values, pass an empty Hash as a request object (see above).
2414
+ #
2415
+ # @param parent [::String]
2416
+ # Required. The parent resource for the deployment resource.
2417
+ # Format: `projects/{project}/locations/{location}`
2418
+ # @param deployment_id [::String]
2419
+ # Optional. The ID to use for the deployment resource, which will become the
2420
+ # final component of the deployment's resource name. This field is optional.
2421
+ #
2422
+ # * If provided, the same will be used. The service will throw an error if
2423
+ # the specified id is already used by another deployment resource in the API
2424
+ # hub.
2425
+ # * If not provided, a system generated id will be used.
2426
+ #
2427
+ # This value should be 4-500 characters, and valid characters
2428
+ # are /[a-z][A-Z][0-9]-_/.
2429
+ # @param deployment [::Google::Cloud::ApiHub::V1::Deployment, ::Hash]
2430
+ # Required. The deployment resource to create.
2431
+ #
2432
+ # @yield [response, operation] Access the result along with the RPC operation
2433
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Deployment]
2434
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2435
+ #
2436
+ # @return [::Google::Cloud::ApiHub::V1::Deployment]
2437
+ #
2438
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2439
+ #
2440
+ # @example Basic example
2441
+ # require "google/cloud/api_hub/v1"
2442
+ #
2443
+ # # Create a client object. The client can be reused for multiple calls.
2444
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2445
+ #
2446
+ # # Create a request. To set request fields, pass in keyword arguments.
2447
+ # request = Google::Cloud::ApiHub::V1::CreateDeploymentRequest.new
2448
+ #
2449
+ # # Call the create_deployment method.
2450
+ # result = client.create_deployment request
2451
+ #
2452
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Deployment.
2453
+ # p result
2454
+ #
2455
+ def create_deployment request, options = nil
2456
+ raise ::ArgumentError, "request must be provided" if request.nil?
2457
+
2458
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateDeploymentRequest
2459
+
2460
+ # Converts hash and nil to an options object
2461
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2462
+
2463
+ # Customize the options with defaults
2464
+ metadata = @config.rpcs.create_deployment.metadata.to_h
2465
+
2466
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2467
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2468
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2469
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2470
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2471
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2472
+
2473
+ header_params = {}
2474
+ if request.parent
2475
+ header_params["parent"] = request.parent
2476
+ end
2477
+
2478
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2479
+ metadata[:"x-goog-request-params"] ||= request_params_header
2480
+
2481
+ options.apply_defaults timeout: @config.rpcs.create_deployment.timeout,
2482
+ metadata: metadata,
2483
+ retry_policy: @config.rpcs.create_deployment.retry_policy
2484
+
2485
+ options.apply_defaults timeout: @config.timeout,
2486
+ metadata: @config.metadata,
2487
+ retry_policy: @config.retry_policy
2488
+
2489
+ @api_hub_stub.call_rpc :create_deployment, request, options: options do |response, operation|
2490
+ yield response, operation if block_given?
2491
+ return response
2492
+ end
2493
+ rescue ::GRPC::BadStatus => e
2494
+ raise ::Google::Cloud::Error.from_error(e)
2495
+ end
2496
+
2497
+ ##
2498
+ # Get details about a deployment and the API versions linked to it.
2499
+ #
2500
+ # @overload get_deployment(request, options = nil)
2501
+ # Pass arguments to `get_deployment` via a request object, either of type
2502
+ # {::Google::Cloud::ApiHub::V1::GetDeploymentRequest} or an equivalent Hash.
2503
+ #
2504
+ # @param request [::Google::Cloud::ApiHub::V1::GetDeploymentRequest, ::Hash]
2505
+ # A request object representing the call parameters. Required. To specify no
2506
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2507
+ # @param options [::Gapic::CallOptions, ::Hash]
2508
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2509
+ #
2510
+ # @overload get_deployment(name: nil)
2511
+ # Pass arguments to `get_deployment` via keyword arguments. Note that at
2512
+ # least one keyword argument is required. To specify no parameters, or to keep all
2513
+ # the default parameter values, pass an empty Hash as a request object (see above).
2514
+ #
2515
+ # @param name [::String]
2516
+ # Required. The name of the deployment resource to retrieve.
2517
+ # Format: `projects/{project}/locations/{location}/deployments/{deployment}`
2518
+ #
2519
+ # @yield [response, operation] Access the result along with the RPC operation
2520
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Deployment]
2521
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2522
+ #
2523
+ # @return [::Google::Cloud::ApiHub::V1::Deployment]
2524
+ #
2525
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2526
+ #
2527
+ # @example Basic example
2528
+ # require "google/cloud/api_hub/v1"
2529
+ #
2530
+ # # Create a client object. The client can be reused for multiple calls.
2531
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2532
+ #
2533
+ # # Create a request. To set request fields, pass in keyword arguments.
2534
+ # request = Google::Cloud::ApiHub::V1::GetDeploymentRequest.new
2535
+ #
2536
+ # # Call the get_deployment method.
2537
+ # result = client.get_deployment request
2538
+ #
2539
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Deployment.
2540
+ # p result
2541
+ #
2542
+ def get_deployment request, options = nil
2543
+ raise ::ArgumentError, "request must be provided" if request.nil?
2544
+
2545
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetDeploymentRequest
2546
+
2547
+ # Converts hash and nil to an options object
2548
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2549
+
2550
+ # Customize the options with defaults
2551
+ metadata = @config.rpcs.get_deployment.metadata.to_h
2552
+
2553
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2554
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2555
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2556
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2557
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2558
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2559
+
2560
+ header_params = {}
2561
+ if request.name
2562
+ header_params["name"] = request.name
2563
+ end
2564
+
2565
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2566
+ metadata[:"x-goog-request-params"] ||= request_params_header
2567
+
2568
+ options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
2569
+ metadata: metadata,
2570
+ retry_policy: @config.rpcs.get_deployment.retry_policy
2571
+
2572
+ options.apply_defaults timeout: @config.timeout,
2573
+ metadata: @config.metadata,
2574
+ retry_policy: @config.retry_policy
2575
+
2576
+ @api_hub_stub.call_rpc :get_deployment, request, options: options do |response, operation|
2577
+ yield response, operation if block_given?
2578
+ return response
2579
+ end
2580
+ rescue ::GRPC::BadStatus => e
2581
+ raise ::Google::Cloud::Error.from_error(e)
2582
+ end
2583
+
2584
+ ##
2585
+ # List deployment resources in the API hub.
2586
+ #
2587
+ # @overload list_deployments(request, options = nil)
2588
+ # Pass arguments to `list_deployments` via a request object, either of type
2589
+ # {::Google::Cloud::ApiHub::V1::ListDeploymentsRequest} or an equivalent Hash.
2590
+ #
2591
+ # @param request [::Google::Cloud::ApiHub::V1::ListDeploymentsRequest, ::Hash]
2592
+ # A request object representing the call parameters. Required. To specify no
2593
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2594
+ # @param options [::Gapic::CallOptions, ::Hash]
2595
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2596
+ #
2597
+ # @overload list_deployments(parent: nil, filter: nil, page_size: nil, page_token: nil)
2598
+ # Pass arguments to `list_deployments` via keyword arguments. Note that at
2599
+ # least one keyword argument is required. To specify no parameters, or to keep all
2600
+ # the default parameter values, pass an empty Hash as a request object (see above).
2601
+ #
2602
+ # @param parent [::String]
2603
+ # Required. The parent, which owns this collection of deployment resources.
2604
+ # Format: `projects/{project}/locations/{location}`
2605
+ # @param filter [::String]
2606
+ # Optional. An expression that filters the list of Deployments.
2607
+ #
2608
+ # A filter expression consists of a field name, a comparison
2609
+ # operator, and a value for filtering. The value must be a string. The
2610
+ # comparison operator must be one of: `<`, `>` or
2611
+ # `=`. Filters are not case sensitive.
2612
+ #
2613
+ # The following fields in the `Deployments` are eligible for filtering:
2614
+ #
2615
+ # * `display_name` - The display name of the Deployment. Allowed
2616
+ # comparison operators: `=`.
2617
+ # * `create_time` - The time at which the Deployment was created. The
2618
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
2619
+ # format. Allowed comparison operators: `>` and `<`.
2620
+ # * `resource_uri` - A URI to the deployment resource. Allowed
2621
+ # comparison operators: `=`.
2622
+ # * `api_versions` - The API versions linked to this deployment. Allowed
2623
+ # comparison operators: `:`.
2624
+ # * `deployment_type.enum_values.values.id` - The allowed value id of the
2625
+ # deployment_type attribute associated with the Deployment. Allowed
2626
+ # comparison operators: `:`.
2627
+ # * `deployment_type.enum_values.values.display_name` - The allowed value
2628
+ # display name of the deployment_type attribute associated with the
2629
+ # Deployment. Allowed comparison operators: `:`.
2630
+ # * `slo.string_values.values` -The allowed string value of the slo
2631
+ # attribute associated with the deployment. Allowed comparison
2632
+ # operators: `:`.
2633
+ # * `environment.enum_values.values.id` - The allowed value id of the
2634
+ # environment attribute associated with the deployment. Allowed
2635
+ # comparison operators: `:`.
2636
+ # * `environment.enum_values.values.display_name` - The allowed value
2637
+ # display name of the environment attribute associated with the deployment.
2638
+ # Allowed comparison operators: `:`.
2639
+ #
2640
+ # Expressions are combined with either `AND` logic operator or `OR` logical
2641
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
2642
+ # operator can be used throughout the filter string and both the operators
2643
+ # cannot be used together. No other logical operators are supported. At most
2644
+ # three filter fields are allowed in the filter string and if provided
2645
+ # more than that then `INVALID_ARGUMENT` error is returned by the API.
2646
+ #
2647
+ # Here are a few examples:
2648
+ #
2649
+ # * `environment.enum_values.values.id: staging-id` - The allowed value id
2650
+ # of the environment attribute associated with the Deployment is
2651
+ # _staging-id_.
2652
+ # * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
2653
+ # The allowed value display name of the environment attribute associated
2654
+ # with the Deployment is `Staging Deployment`.
2655
+ # * `environment.enum_values.values.id: production-id AND create_time <
2656
+ # \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
2657
+ # The allowed value id of the environment attribute associated with the
2658
+ # Deployment is _production-id_ and Deployment was created before
2659
+ # _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
2660
+ # * `environment.enum_values.values.id: production-id OR
2661
+ # slo.string_values.values: \"99.99%\"`
2662
+ # - The allowed value id of the environment attribute Deployment is
2663
+ # _production-id_ or string value of the slo attribute is _99.99%_.
2664
+ # @param page_size [::Integer]
2665
+ # Optional. The maximum number of deployment resources to return. The service
2666
+ # may return fewer than this value. If unspecified, at most 50 deployments
2667
+ # will be returned. The maximum value is 1000; values above 1000 will be
2668
+ # coerced to 1000.
2669
+ # @param page_token [::String]
2670
+ # Optional. A page token, received from a previous `ListDeployments` call.
2671
+ # Provide this to retrieve the subsequent page.
2672
+ #
2673
+ # When paginating, all other parameters (except page_size) provided to
2674
+ # `ListDeployments` must match the call that provided the page token.
2675
+ #
2676
+ # @yield [response, operation] Access the result along with the RPC operation
2677
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Deployment>]
2678
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2679
+ #
2680
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Deployment>]
2681
+ #
2682
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2683
+ #
2684
+ # @example Basic example
2685
+ # require "google/cloud/api_hub/v1"
2686
+ #
2687
+ # # Create a client object. The client can be reused for multiple calls.
2688
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2689
+ #
2690
+ # # Create a request. To set request fields, pass in keyword arguments.
2691
+ # request = Google::Cloud::ApiHub::V1::ListDeploymentsRequest.new
2692
+ #
2693
+ # # Call the list_deployments method.
2694
+ # result = client.list_deployments request
2695
+ #
2696
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2697
+ # # over elements, and API calls will be issued to fetch pages as needed.
2698
+ # result.each do |item|
2699
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Deployment.
2700
+ # p item
2701
+ # end
2702
+ #
2703
+ def list_deployments request, options = nil
2704
+ raise ::ArgumentError, "request must be provided" if request.nil?
2705
+
2706
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListDeploymentsRequest
2707
+
2708
+ # Converts hash and nil to an options object
2709
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2710
+
2711
+ # Customize the options with defaults
2712
+ metadata = @config.rpcs.list_deployments.metadata.to_h
2713
+
2714
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2715
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2716
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2717
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2718
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2719
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2720
+
2721
+ header_params = {}
2722
+ if request.parent
2723
+ header_params["parent"] = request.parent
2724
+ end
2725
+
2726
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2727
+ metadata[:"x-goog-request-params"] ||= request_params_header
2728
+
2729
+ options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
2730
+ metadata: metadata,
2731
+ retry_policy: @config.rpcs.list_deployments.retry_policy
2732
+
2733
+ options.apply_defaults timeout: @config.timeout,
2734
+ metadata: @config.metadata,
2735
+ retry_policy: @config.retry_policy
2736
+
2737
+ @api_hub_stub.call_rpc :list_deployments, request, options: options do |response, operation|
2738
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_deployments, request, response, operation, options
2739
+ yield response, operation if block_given?
2740
+ return response
2741
+ end
2742
+ rescue ::GRPC::BadStatus => e
2743
+ raise ::Google::Cloud::Error.from_error(e)
2744
+ end
2745
+
2746
+ ##
2747
+ # Update a deployment resource in the API hub. The following fields in the
2748
+ # {::Google::Cloud::ApiHub::V1::Deployment deployment resource} can be
2749
+ # updated:
2750
+ #
2751
+ # * {::Google::Cloud::ApiHub::V1::Deployment#display_name display_name}
2752
+ # * {::Google::Cloud::ApiHub::V1::Deployment#description description}
2753
+ # * {::Google::Cloud::ApiHub::V1::Deployment#documentation documentation}
2754
+ # * {::Google::Cloud::ApiHub::V1::Deployment#deployment_type deployment_type}
2755
+ # * {::Google::Cloud::ApiHub::V1::Deployment#resource_uri resource_uri}
2756
+ # * {::Google::Cloud::ApiHub::V1::Deployment#endpoints endpoints}
2757
+ # * {::Google::Cloud::ApiHub::V1::Deployment#slo slo}
2758
+ # * {::Google::Cloud::ApiHub::V1::Deployment#environment environment}
2759
+ # * {::Google::Cloud::ApiHub::V1::Deployment#attributes attributes}
2760
+ #
2761
+ # The
2762
+ # {::Google::Cloud::ApiHub::V1::UpdateDeploymentRequest#update_mask update_mask}
2763
+ # should be used to specify the fields being updated.
2764
+ #
2765
+ # @overload update_deployment(request, options = nil)
2766
+ # Pass arguments to `update_deployment` via a request object, either of type
2767
+ # {::Google::Cloud::ApiHub::V1::UpdateDeploymentRequest} or an equivalent Hash.
2768
+ #
2769
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateDeploymentRequest, ::Hash]
2770
+ # A request object representing the call parameters. Required. To specify no
2771
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2772
+ # @param options [::Gapic::CallOptions, ::Hash]
2773
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2774
+ #
2775
+ # @overload update_deployment(deployment: nil, update_mask: nil)
2776
+ # Pass arguments to `update_deployment` via keyword arguments. Note that at
2777
+ # least one keyword argument is required. To specify no parameters, or to keep all
2778
+ # the default parameter values, pass an empty Hash as a request object (see above).
2779
+ #
2780
+ # @param deployment [::Google::Cloud::ApiHub::V1::Deployment, ::Hash]
2781
+ # Required. The deployment resource to update.
2782
+ #
2783
+ # The deployment resource's `name` field is used to identify the deployment
2784
+ # resource to update.
2785
+ # Format: `projects/{project}/locations/{location}/deployments/{deployment}`
2786
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2787
+ # Required. The list of fields to update.
2788
+ #
2789
+ # @yield [response, operation] Access the result along with the RPC operation
2790
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Deployment]
2791
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2792
+ #
2793
+ # @return [::Google::Cloud::ApiHub::V1::Deployment]
2794
+ #
2795
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2796
+ #
2797
+ # @example Basic example
2798
+ # require "google/cloud/api_hub/v1"
2799
+ #
2800
+ # # Create a client object. The client can be reused for multiple calls.
2801
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2802
+ #
2803
+ # # Create a request. To set request fields, pass in keyword arguments.
2804
+ # request = Google::Cloud::ApiHub::V1::UpdateDeploymentRequest.new
2805
+ #
2806
+ # # Call the update_deployment method.
2807
+ # result = client.update_deployment request
2808
+ #
2809
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Deployment.
2810
+ # p result
2811
+ #
2812
+ def update_deployment request, options = nil
2813
+ raise ::ArgumentError, "request must be provided" if request.nil?
2814
+
2815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateDeploymentRequest
2816
+
2817
+ # Converts hash and nil to an options object
2818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2819
+
2820
+ # Customize the options with defaults
2821
+ metadata = @config.rpcs.update_deployment.metadata.to_h
2822
+
2823
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2824
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2826
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2827
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2828
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2829
+
2830
+ header_params = {}
2831
+ if request.deployment&.name
2832
+ header_params["deployment.name"] = request.deployment.name
2833
+ end
2834
+
2835
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2836
+ metadata[:"x-goog-request-params"] ||= request_params_header
2837
+
2838
+ options.apply_defaults timeout: @config.rpcs.update_deployment.timeout,
2839
+ metadata: metadata,
2840
+ retry_policy: @config.rpcs.update_deployment.retry_policy
2841
+
2842
+ options.apply_defaults timeout: @config.timeout,
2843
+ metadata: @config.metadata,
2844
+ retry_policy: @config.retry_policy
2845
+
2846
+ @api_hub_stub.call_rpc :update_deployment, request, options: options do |response, operation|
2847
+ yield response, operation if block_given?
2848
+ return response
2849
+ end
2850
+ rescue ::GRPC::BadStatus => e
2851
+ raise ::Google::Cloud::Error.from_error(e)
2852
+ end
2853
+
2854
+ ##
2855
+ # Delete a deployment resource in the API hub.
2856
+ #
2857
+ # @overload delete_deployment(request, options = nil)
2858
+ # Pass arguments to `delete_deployment` via a request object, either of type
2859
+ # {::Google::Cloud::ApiHub::V1::DeleteDeploymentRequest} or an equivalent Hash.
2860
+ #
2861
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteDeploymentRequest, ::Hash]
2862
+ # A request object representing the call parameters. Required. To specify no
2863
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2864
+ # @param options [::Gapic::CallOptions, ::Hash]
2865
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2866
+ #
2867
+ # @overload delete_deployment(name: nil)
2868
+ # Pass arguments to `delete_deployment` via keyword arguments. Note that at
2869
+ # least one keyword argument is required. To specify no parameters, or to keep all
2870
+ # the default parameter values, pass an empty Hash as a request object (see above).
2871
+ #
2872
+ # @param name [::String]
2873
+ # Required. The name of the deployment resource to delete.
2874
+ # Format: `projects/{project}/locations/{location}/deployments/{deployment}`
2875
+ #
2876
+ # @yield [response, operation] Access the result along with the RPC operation
2877
+ # @yieldparam response [::Google::Protobuf::Empty]
2878
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2879
+ #
2880
+ # @return [::Google::Protobuf::Empty]
2881
+ #
2882
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2883
+ #
2884
+ # @example Basic example
2885
+ # require "google/cloud/api_hub/v1"
2886
+ #
2887
+ # # Create a client object. The client can be reused for multiple calls.
2888
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2889
+ #
2890
+ # # Create a request. To set request fields, pass in keyword arguments.
2891
+ # request = Google::Cloud::ApiHub::V1::DeleteDeploymentRequest.new
2892
+ #
2893
+ # # Call the delete_deployment method.
2894
+ # result = client.delete_deployment request
2895
+ #
2896
+ # # The returned object is of type Google::Protobuf::Empty.
2897
+ # p result
2898
+ #
2899
+ def delete_deployment request, options = nil
2900
+ raise ::ArgumentError, "request must be provided" if request.nil?
2901
+
2902
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteDeploymentRequest
2903
+
2904
+ # Converts hash and nil to an options object
2905
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2906
+
2907
+ # Customize the options with defaults
2908
+ metadata = @config.rpcs.delete_deployment.metadata.to_h
2909
+
2910
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2911
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2912
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2913
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
2914
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2915
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2916
+
2917
+ header_params = {}
2918
+ if request.name
2919
+ header_params["name"] = request.name
2920
+ end
2921
+
2922
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2923
+ metadata[:"x-goog-request-params"] ||= request_params_header
2924
+
2925
+ options.apply_defaults timeout: @config.rpcs.delete_deployment.timeout,
2926
+ metadata: metadata,
2927
+ retry_policy: @config.rpcs.delete_deployment.retry_policy
2928
+
2929
+ options.apply_defaults timeout: @config.timeout,
2930
+ metadata: @config.metadata,
2931
+ retry_policy: @config.retry_policy
2932
+
2933
+ @api_hub_stub.call_rpc :delete_deployment, request, options: options do |response, operation|
2934
+ yield response, operation if block_given?
2935
+ return response
2936
+ end
2937
+ rescue ::GRPC::BadStatus => e
2938
+ raise ::Google::Cloud::Error.from_error(e)
2939
+ end
2940
+
2941
+ ##
2942
+ # Create a user defined attribute.
2943
+ #
2944
+ # Certain pre defined attributes are already created by the API hub. These
2945
+ # attributes will have type as `SYSTEM_DEFINED` and can be listed via
2946
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client#list_attributes ListAttributes} method.
2947
+ # Allowed values for the same can be updated via
2948
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client#update_attribute UpdateAttribute} method.
2949
+ #
2950
+ # @overload create_attribute(request, options = nil)
2951
+ # Pass arguments to `create_attribute` via a request object, either of type
2952
+ # {::Google::Cloud::ApiHub::V1::CreateAttributeRequest} or an equivalent Hash.
2953
+ #
2954
+ # @param request [::Google::Cloud::ApiHub::V1::CreateAttributeRequest, ::Hash]
2955
+ # A request object representing the call parameters. Required. To specify no
2956
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2957
+ # @param options [::Gapic::CallOptions, ::Hash]
2958
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2959
+ #
2960
+ # @overload create_attribute(parent: nil, attribute_id: nil, attribute: nil)
2961
+ # Pass arguments to `create_attribute` via keyword arguments. Note that at
2962
+ # least one keyword argument is required. To specify no parameters, or to keep all
2963
+ # the default parameter values, pass an empty Hash as a request object (see above).
2964
+ #
2965
+ # @param parent [::String]
2966
+ # Required. The parent resource for Attribute.
2967
+ # Format: `projects/{project}/locations/{location}`
2968
+ # @param attribute_id [::String]
2969
+ # Optional. The ID to use for the attribute, which will become the final
2970
+ # component of the attribute's resource name. This field is optional.
2971
+ #
2972
+ # * If provided, the same will be used. The service will throw an error if
2973
+ # the specified id is already used by another attribute resource in the API
2974
+ # hub.
2975
+ # * If not provided, a system generated id will be used.
2976
+ #
2977
+ # This value should be 4-500 characters, and valid characters
2978
+ # are /[a-z][A-Z][0-9]-_/.
2979
+ # @param attribute [::Google::Cloud::ApiHub::V1::Attribute, ::Hash]
2980
+ # Required. The attribute to create.
2981
+ #
2982
+ # @yield [response, operation] Access the result along with the RPC operation
2983
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Attribute]
2984
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2985
+ #
2986
+ # @return [::Google::Cloud::ApiHub::V1::Attribute]
2987
+ #
2988
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2989
+ #
2990
+ # @example Basic example
2991
+ # require "google/cloud/api_hub/v1"
2992
+ #
2993
+ # # Create a client object. The client can be reused for multiple calls.
2994
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
2995
+ #
2996
+ # # Create a request. To set request fields, pass in keyword arguments.
2997
+ # request = Google::Cloud::ApiHub::V1::CreateAttributeRequest.new
2998
+ #
2999
+ # # Call the create_attribute method.
3000
+ # result = client.create_attribute request
3001
+ #
3002
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Attribute.
3003
+ # p result
3004
+ #
3005
+ def create_attribute request, options = nil
3006
+ raise ::ArgumentError, "request must be provided" if request.nil?
3007
+
3008
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateAttributeRequest
3009
+
3010
+ # Converts hash and nil to an options object
3011
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3012
+
3013
+ # Customize the options with defaults
3014
+ metadata = @config.rpcs.create_attribute.metadata.to_h
3015
+
3016
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3017
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3018
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3019
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3020
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3021
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3022
+
3023
+ header_params = {}
3024
+ if request.parent
3025
+ header_params["parent"] = request.parent
3026
+ end
3027
+
3028
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3029
+ metadata[:"x-goog-request-params"] ||= request_params_header
3030
+
3031
+ options.apply_defaults timeout: @config.rpcs.create_attribute.timeout,
3032
+ metadata: metadata,
3033
+ retry_policy: @config.rpcs.create_attribute.retry_policy
3034
+
3035
+ options.apply_defaults timeout: @config.timeout,
3036
+ metadata: @config.metadata,
3037
+ retry_policy: @config.retry_policy
3038
+
3039
+ @api_hub_stub.call_rpc :create_attribute, request, options: options do |response, operation|
3040
+ yield response, operation if block_given?
3041
+ return response
3042
+ end
3043
+ rescue ::GRPC::BadStatus => e
3044
+ raise ::Google::Cloud::Error.from_error(e)
3045
+ end
3046
+
3047
+ ##
3048
+ # Get details about the attribute.
3049
+ #
3050
+ # @overload get_attribute(request, options = nil)
3051
+ # Pass arguments to `get_attribute` via a request object, either of type
3052
+ # {::Google::Cloud::ApiHub::V1::GetAttributeRequest} or an equivalent Hash.
3053
+ #
3054
+ # @param request [::Google::Cloud::ApiHub::V1::GetAttributeRequest, ::Hash]
3055
+ # A request object representing the call parameters. Required. To specify no
3056
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3057
+ # @param options [::Gapic::CallOptions, ::Hash]
3058
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3059
+ #
3060
+ # @overload get_attribute(name: nil)
3061
+ # Pass arguments to `get_attribute` via keyword arguments. Note that at
3062
+ # least one keyword argument is required. To specify no parameters, or to keep all
3063
+ # the default parameter values, pass an empty Hash as a request object (see above).
3064
+ #
3065
+ # @param name [::String]
3066
+ # Required. The name of the attribute to retrieve.
3067
+ # Format:
3068
+ # `projects/{project}/locations/{location}/attributes/{attribute}`
3069
+ #
3070
+ # @yield [response, operation] Access the result along with the RPC operation
3071
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Attribute]
3072
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3073
+ #
3074
+ # @return [::Google::Cloud::ApiHub::V1::Attribute]
3075
+ #
3076
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3077
+ #
3078
+ # @example Basic example
3079
+ # require "google/cloud/api_hub/v1"
3080
+ #
3081
+ # # Create a client object. The client can be reused for multiple calls.
3082
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3083
+ #
3084
+ # # Create a request. To set request fields, pass in keyword arguments.
3085
+ # request = Google::Cloud::ApiHub::V1::GetAttributeRequest.new
3086
+ #
3087
+ # # Call the get_attribute method.
3088
+ # result = client.get_attribute request
3089
+ #
3090
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Attribute.
3091
+ # p result
3092
+ #
3093
+ def get_attribute request, options = nil
3094
+ raise ::ArgumentError, "request must be provided" if request.nil?
3095
+
3096
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetAttributeRequest
3097
+
3098
+ # Converts hash and nil to an options object
3099
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3100
+
3101
+ # Customize the options with defaults
3102
+ metadata = @config.rpcs.get_attribute.metadata.to_h
3103
+
3104
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3105
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3106
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3107
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3108
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3109
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3110
+
3111
+ header_params = {}
3112
+ if request.name
3113
+ header_params["name"] = request.name
3114
+ end
3115
+
3116
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3117
+ metadata[:"x-goog-request-params"] ||= request_params_header
3118
+
3119
+ options.apply_defaults timeout: @config.rpcs.get_attribute.timeout,
3120
+ metadata: metadata,
3121
+ retry_policy: @config.rpcs.get_attribute.retry_policy
3122
+
3123
+ options.apply_defaults timeout: @config.timeout,
3124
+ metadata: @config.metadata,
3125
+ retry_policy: @config.retry_policy
3126
+
3127
+ @api_hub_stub.call_rpc :get_attribute, request, options: options do |response, operation|
3128
+ yield response, operation if block_given?
3129
+ return response
3130
+ end
3131
+ rescue ::GRPC::BadStatus => e
3132
+ raise ::Google::Cloud::Error.from_error(e)
3133
+ end
3134
+
3135
+ ##
3136
+ # Update the attribute. The following fields in the
3137
+ # {::Google::Cloud::ApiHub::V1::Attribute Attribute resource} can be updated:
3138
+ #
3139
+ # * {::Google::Cloud::ApiHub::V1::Attribute#display_name display_name}
3140
+ # The display name can be updated for user defined attributes only.
3141
+ # * {::Google::Cloud::ApiHub::V1::Attribute#description description}
3142
+ # The description can be updated for user defined attributes only.
3143
+ # * {::Google::Cloud::ApiHub::V1::Attribute#allowed_values allowed_values}
3144
+ # To update the list of allowed values, clients need to use the fetched list
3145
+ # of allowed values and add or remove values to or from the same list.
3146
+ # The mutable allowed values can be updated for both user defined and System
3147
+ # defined attributes. The immutable allowed values cannot be updated or
3148
+ # deleted. The updated list of allowed values cannot be empty. If an allowed
3149
+ # value that is already used by some resource's attribute is deleted, then
3150
+ # the association between the resource and the attribute value will also be
3151
+ # deleted.
3152
+ # * {::Google::Cloud::ApiHub::V1::Attribute#cardinality cardinality}
3153
+ # The cardinality can be updated for user defined attributes only.
3154
+ # Cardinality can only be increased during an update.
3155
+ #
3156
+ # The
3157
+ # {::Google::Cloud::ApiHub::V1::UpdateAttributeRequest#update_mask update_mask}
3158
+ # should be used to specify the fields being updated.
3159
+ #
3160
+ # @overload update_attribute(request, options = nil)
3161
+ # Pass arguments to `update_attribute` via a request object, either of type
3162
+ # {::Google::Cloud::ApiHub::V1::UpdateAttributeRequest} or an equivalent Hash.
3163
+ #
3164
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateAttributeRequest, ::Hash]
3165
+ # A request object representing the call parameters. Required. To specify no
3166
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3167
+ # @param options [::Gapic::CallOptions, ::Hash]
3168
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3169
+ #
3170
+ # @overload update_attribute(attribute: nil, update_mask: nil)
3171
+ # Pass arguments to `update_attribute` via keyword arguments. Note that at
3172
+ # least one keyword argument is required. To specify no parameters, or to keep all
3173
+ # the default parameter values, pass an empty Hash as a request object (see above).
3174
+ #
3175
+ # @param attribute [::Google::Cloud::ApiHub::V1::Attribute, ::Hash]
3176
+ # Required. The attribute to update.
3177
+ #
3178
+ # The attribute's `name` field is used to identify the attribute to update.
3179
+ # Format:
3180
+ # `projects/{project}/locations/{location}/attributes/{attribute}`
3181
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3182
+ # Required. The list of fields to update.
3183
+ #
3184
+ # @yield [response, operation] Access the result along with the RPC operation
3185
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::Attribute]
3186
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3187
+ #
3188
+ # @return [::Google::Cloud::ApiHub::V1::Attribute]
3189
+ #
3190
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3191
+ #
3192
+ # @example Basic example
3193
+ # require "google/cloud/api_hub/v1"
3194
+ #
3195
+ # # Create a client object. The client can be reused for multiple calls.
3196
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3197
+ #
3198
+ # # Create a request. To set request fields, pass in keyword arguments.
3199
+ # request = Google::Cloud::ApiHub::V1::UpdateAttributeRequest.new
3200
+ #
3201
+ # # Call the update_attribute method.
3202
+ # result = client.update_attribute request
3203
+ #
3204
+ # # The returned object is of type Google::Cloud::ApiHub::V1::Attribute.
3205
+ # p result
3206
+ #
3207
+ def update_attribute request, options = nil
3208
+ raise ::ArgumentError, "request must be provided" if request.nil?
3209
+
3210
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateAttributeRequest
3211
+
3212
+ # Converts hash and nil to an options object
3213
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3214
+
3215
+ # Customize the options with defaults
3216
+ metadata = @config.rpcs.update_attribute.metadata.to_h
3217
+
3218
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3219
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3220
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3221
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3222
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3223
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3224
+
3225
+ header_params = {}
3226
+ if request.attribute&.name
3227
+ header_params["attribute.name"] = request.attribute.name
3228
+ end
3229
+
3230
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3231
+ metadata[:"x-goog-request-params"] ||= request_params_header
3232
+
3233
+ options.apply_defaults timeout: @config.rpcs.update_attribute.timeout,
3234
+ metadata: metadata,
3235
+ retry_policy: @config.rpcs.update_attribute.retry_policy
3236
+
3237
+ options.apply_defaults timeout: @config.timeout,
3238
+ metadata: @config.metadata,
3239
+ retry_policy: @config.retry_policy
3240
+
3241
+ @api_hub_stub.call_rpc :update_attribute, request, options: options do |response, operation|
3242
+ yield response, operation if block_given?
3243
+ return response
3244
+ end
3245
+ rescue ::GRPC::BadStatus => e
3246
+ raise ::Google::Cloud::Error.from_error(e)
3247
+ end
3248
+
3249
+ ##
3250
+ # Delete an attribute.
3251
+ #
3252
+ # Note: System defined attributes cannot be deleted. All
3253
+ # associations of the attribute being deleted with any API hub resource will
3254
+ # also get deleted.
3255
+ #
3256
+ # @overload delete_attribute(request, options = nil)
3257
+ # Pass arguments to `delete_attribute` via a request object, either of type
3258
+ # {::Google::Cloud::ApiHub::V1::DeleteAttributeRequest} or an equivalent Hash.
3259
+ #
3260
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteAttributeRequest, ::Hash]
3261
+ # A request object representing the call parameters. Required. To specify no
3262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3263
+ # @param options [::Gapic::CallOptions, ::Hash]
3264
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3265
+ #
3266
+ # @overload delete_attribute(name: nil)
3267
+ # Pass arguments to `delete_attribute` via keyword arguments. Note that at
3268
+ # least one keyword argument is required. To specify no parameters, or to keep all
3269
+ # the default parameter values, pass an empty Hash as a request object (see above).
3270
+ #
3271
+ # @param name [::String]
3272
+ # Required. The name of the attribute to delete.
3273
+ # Format:
3274
+ # `projects/{project}/locations/{location}/attributes/{attribute}`
3275
+ #
3276
+ # @yield [response, operation] Access the result along with the RPC operation
3277
+ # @yieldparam response [::Google::Protobuf::Empty]
3278
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3279
+ #
3280
+ # @return [::Google::Protobuf::Empty]
3281
+ #
3282
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3283
+ #
3284
+ # @example Basic example
3285
+ # require "google/cloud/api_hub/v1"
3286
+ #
3287
+ # # Create a client object. The client can be reused for multiple calls.
3288
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3289
+ #
3290
+ # # Create a request. To set request fields, pass in keyword arguments.
3291
+ # request = Google::Cloud::ApiHub::V1::DeleteAttributeRequest.new
3292
+ #
3293
+ # # Call the delete_attribute method.
3294
+ # result = client.delete_attribute request
3295
+ #
3296
+ # # The returned object is of type Google::Protobuf::Empty.
3297
+ # p result
3298
+ #
3299
+ def delete_attribute request, options = nil
3300
+ raise ::ArgumentError, "request must be provided" if request.nil?
3301
+
3302
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteAttributeRequest
3303
+
3304
+ # Converts hash and nil to an options object
3305
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3306
+
3307
+ # Customize the options with defaults
3308
+ metadata = @config.rpcs.delete_attribute.metadata.to_h
3309
+
3310
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3311
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3312
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3313
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3314
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3315
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3316
+
3317
+ header_params = {}
3318
+ if request.name
3319
+ header_params["name"] = request.name
3320
+ end
3321
+
3322
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3323
+ metadata[:"x-goog-request-params"] ||= request_params_header
3324
+
3325
+ options.apply_defaults timeout: @config.rpcs.delete_attribute.timeout,
3326
+ metadata: metadata,
3327
+ retry_policy: @config.rpcs.delete_attribute.retry_policy
3328
+
3329
+ options.apply_defaults timeout: @config.timeout,
3330
+ metadata: @config.metadata,
3331
+ retry_policy: @config.retry_policy
3332
+
3333
+ @api_hub_stub.call_rpc :delete_attribute, request, options: options do |response, operation|
3334
+ yield response, operation if block_given?
3335
+ return response
3336
+ end
3337
+ rescue ::GRPC::BadStatus => e
3338
+ raise ::Google::Cloud::Error.from_error(e)
3339
+ end
3340
+
3341
+ ##
3342
+ # List all attributes.
3343
+ #
3344
+ # @overload list_attributes(request, options = nil)
3345
+ # Pass arguments to `list_attributes` via a request object, either of type
3346
+ # {::Google::Cloud::ApiHub::V1::ListAttributesRequest} or an equivalent Hash.
3347
+ #
3348
+ # @param request [::Google::Cloud::ApiHub::V1::ListAttributesRequest, ::Hash]
3349
+ # A request object representing the call parameters. Required. To specify no
3350
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3351
+ # @param options [::Gapic::CallOptions, ::Hash]
3352
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3353
+ #
3354
+ # @overload list_attributes(parent: nil, filter: nil, page_size: nil, page_token: nil)
3355
+ # Pass arguments to `list_attributes` via keyword arguments. Note that at
3356
+ # least one keyword argument is required. To specify no parameters, or to keep all
3357
+ # the default parameter values, pass an empty Hash as a request object (see above).
3358
+ #
3359
+ # @param parent [::String]
3360
+ # Required. The parent resource for Attribute.
3361
+ # Format: `projects/{project}/locations/{location}`
3362
+ # @param filter [::String]
3363
+ # Optional. An expression that filters the list of Attributes.
3364
+ #
3365
+ # A filter expression consists of a field name, a comparison
3366
+ # operator, and a value for filtering. The value must be a string or a
3367
+ # boolean. The comparison operator must be one of: `<`, `>` or
3368
+ # `=`. Filters are not case sensitive.
3369
+ #
3370
+ # The following fields in the `Attribute` are eligible for filtering:
3371
+ #
3372
+ # * `display_name` - The display name of the Attribute. Allowed
3373
+ # comparison operators: `=`.
3374
+ # * `definition_type` - The definition type of the attribute. Allowed
3375
+ # comparison operators: `=`.
3376
+ # * `scope` - The scope of the attribute. Allowed comparison operators:
3377
+ # `=`.
3378
+ # * `data_type` - The type of the data of the attribute. Allowed
3379
+ # comparison operators: `=`.
3380
+ # * `mandatory` - Denotes whether the attribute is mandatory or not.
3381
+ # Allowed comparison operators: `=`.
3382
+ # * `create_time` - The time at which the Attribute was created. The
3383
+ # value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339]
3384
+ # format. Allowed comparison operators: `>` and `<`.
3385
+ #
3386
+ # Expressions are combined with either `AND` logic operator or `OR` logical
3387
+ # operator but not both of them together i.e. only one of the `AND` or `OR`
3388
+ # operator can be used throughout the filter string and both the operators
3389
+ # cannot be used together. No other logical operators are
3390
+ # supported. At most three filter fields are allowed in the filter
3391
+ # string and if provided more than that then `INVALID_ARGUMENT` error is
3392
+ # returned by the API.
3393
+ #
3394
+ # Here are a few examples:
3395
+ #
3396
+ # * `display_name = production` - - The display name of the attribute is
3397
+ # _production_.
3398
+ # * `(display_name = production) AND (create_time <
3399
+ # \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
3400
+ # The display name of the attribute is _production_ and the attribute was
3401
+ # created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
3402
+ # UTC_.
3403
+ # * `display_name = production OR scope = api` -
3404
+ # The attribute where the display name is _production_ or the scope is
3405
+ # _api_.
3406
+ # @param page_size [::Integer]
3407
+ # Optional. The maximum number of attribute resources to return. The service
3408
+ # may return fewer than this value. If unspecified, at most 50 attributes
3409
+ # will be returned. The maximum value is 1000; values above 1000 will be
3410
+ # coerced to 1000.
3411
+ # @param page_token [::String]
3412
+ # Optional. A page token, received from a previous `ListAttributes` call.
3413
+ # Provide this to retrieve the subsequent page.
3414
+ #
3415
+ # When paginating, all other parameters provided to `ListAttributes` must
3416
+ # match the call that provided the page token.
3417
+ #
3418
+ # @yield [response, operation] Access the result along with the RPC operation
3419
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Attribute>]
3420
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3421
+ #
3422
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::Attribute>]
3423
+ #
3424
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3425
+ #
3426
+ # @example Basic example
3427
+ # require "google/cloud/api_hub/v1"
3428
+ #
3429
+ # # Create a client object. The client can be reused for multiple calls.
3430
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3431
+ #
3432
+ # # Create a request. To set request fields, pass in keyword arguments.
3433
+ # request = Google::Cloud::ApiHub::V1::ListAttributesRequest.new
3434
+ #
3435
+ # # Call the list_attributes method.
3436
+ # result = client.list_attributes request
3437
+ #
3438
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3439
+ # # over elements, and API calls will be issued to fetch pages as needed.
3440
+ # result.each do |item|
3441
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::Attribute.
3442
+ # p item
3443
+ # end
3444
+ #
3445
+ def list_attributes request, options = nil
3446
+ raise ::ArgumentError, "request must be provided" if request.nil?
3447
+
3448
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListAttributesRequest
3449
+
3450
+ # Converts hash and nil to an options object
3451
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3452
+
3453
+ # Customize the options with defaults
3454
+ metadata = @config.rpcs.list_attributes.metadata.to_h
3455
+
3456
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3457
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3458
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3459
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3460
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3461
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3462
+
3463
+ header_params = {}
3464
+ if request.parent
3465
+ header_params["parent"] = request.parent
3466
+ end
3467
+
3468
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3469
+ metadata[:"x-goog-request-params"] ||= request_params_header
3470
+
3471
+ options.apply_defaults timeout: @config.rpcs.list_attributes.timeout,
3472
+ metadata: metadata,
3473
+ retry_policy: @config.rpcs.list_attributes.retry_policy
3474
+
3475
+ options.apply_defaults timeout: @config.timeout,
3476
+ metadata: @config.metadata,
3477
+ retry_policy: @config.retry_policy
3478
+
3479
+ @api_hub_stub.call_rpc :list_attributes, request, options: options do |response, operation|
3480
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_attributes, request, response, operation, options
3481
+ yield response, operation if block_given?
3482
+ return response
3483
+ end
3484
+ rescue ::GRPC::BadStatus => e
3485
+ raise ::Google::Cloud::Error.from_error(e)
3486
+ end
3487
+
3488
+ ##
3489
+ # Search across API-Hub resources.
3490
+ #
3491
+ # @overload search_resources(request, options = nil)
3492
+ # Pass arguments to `search_resources` via a request object, either of type
3493
+ # {::Google::Cloud::ApiHub::V1::SearchResourcesRequest} or an equivalent Hash.
3494
+ #
3495
+ # @param request [::Google::Cloud::ApiHub::V1::SearchResourcesRequest, ::Hash]
3496
+ # A request object representing the call parameters. Required. To specify no
3497
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3498
+ # @param options [::Gapic::CallOptions, ::Hash]
3499
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3500
+ #
3501
+ # @overload search_resources(location: nil, query: nil, filter: nil, page_size: nil, page_token: nil)
3502
+ # Pass arguments to `search_resources` via keyword arguments. Note that at
3503
+ # least one keyword argument is required. To specify no parameters, or to keep all
3504
+ # the default parameter values, pass an empty Hash as a request object (see above).
3505
+ #
3506
+ # @param location [::String]
3507
+ # Required. The resource name of the location which will be of the type
3508
+ # `projects/{project_id}/locations/{location_id}`. This field is used to
3509
+ # identify the instance of API-Hub in which resources should be searched.
3510
+ # @param query [::String]
3511
+ # Required. The free text search query. This query can contain keywords which
3512
+ # could be related to any detail of the API-Hub resources such display names,
3513
+ # descriptions, attributes etc.
3514
+ # @param filter [::String]
3515
+ # Optional. An expression that filters the list of search results.
3516
+ #
3517
+ # A filter expression consists of a field name, a comparison operator,
3518
+ # and a value for filtering. The value must be a string, a number, or a
3519
+ # boolean. The comparison operator must be `=`. Filters are not case
3520
+ # sensitive.
3521
+ #
3522
+ # The following field names are eligible for filtering:
3523
+ # * `resource_type` - The type of resource in the search results.
3524
+ # Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
3525
+ # `Definition`, `Spec` or `Version`. This field can only be specified once
3526
+ # in the filter.
3527
+ #
3528
+ # Here are is an example:
3529
+ #
3530
+ # * `resource_type = Api` - The resource_type is _Api_.
3531
+ # @param page_size [::Integer]
3532
+ # Optional. The maximum number of search results to return. The service may
3533
+ # return fewer than this value. If unspecified at most 10 search results will
3534
+ # be returned. If value is negative then `INVALID_ARGUMENT` error is
3535
+ # returned. The maximum value is 25; values above 25 will be coerced to 25.
3536
+ # While paginating, you can specify a new page size parameter for each page
3537
+ # of search results to be listed.
3538
+ # @param page_token [::String]
3539
+ # Optional. A page token, received from a previous
3540
+ # [SearchResources][SearchResources]
3541
+ # call. Specify this parameter to retrieve the next page of transactions.
3542
+ #
3543
+ # When paginating, you must specify the `page_token` parameter and all the
3544
+ # other parameters except
3545
+ # {::Google::Cloud::ApiHub::V1::SearchResourcesRequest#page_size page_size}
3546
+ # should be specified with the same value which was used in the previous
3547
+ # call. If the other fields are set with a different value than the previous
3548
+ # call then `INVALID_ARGUMENT` error is returned.
3549
+ #
3550
+ # @yield [response, operation] Access the result along with the RPC operation
3551
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::SearchResult>]
3552
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3553
+ #
3554
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::SearchResult>]
3555
+ #
3556
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3557
+ #
3558
+ # @example Basic example
3559
+ # require "google/cloud/api_hub/v1"
3560
+ #
3561
+ # # Create a client object. The client can be reused for multiple calls.
3562
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3563
+ #
3564
+ # # Create a request. To set request fields, pass in keyword arguments.
3565
+ # request = Google::Cloud::ApiHub::V1::SearchResourcesRequest.new
3566
+ #
3567
+ # # Call the search_resources method.
3568
+ # result = client.search_resources request
3569
+ #
3570
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3571
+ # # over elements, and API calls will be issued to fetch pages as needed.
3572
+ # result.each do |item|
3573
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::SearchResult.
3574
+ # p item
3575
+ # end
3576
+ #
3577
+ def search_resources request, options = nil
3578
+ raise ::ArgumentError, "request must be provided" if request.nil?
3579
+
3580
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::SearchResourcesRequest
3581
+
3582
+ # Converts hash and nil to an options object
3583
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3584
+
3585
+ # Customize the options with defaults
3586
+ metadata = @config.rpcs.search_resources.metadata.to_h
3587
+
3588
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3589
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3590
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3591
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3592
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3593
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3594
+
3595
+ header_params = {}
3596
+ if request.location
3597
+ header_params["location"] = request.location
3598
+ end
3599
+
3600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3601
+ metadata[:"x-goog-request-params"] ||= request_params_header
3602
+
3603
+ options.apply_defaults timeout: @config.rpcs.search_resources.timeout,
3604
+ metadata: metadata,
3605
+ retry_policy: @config.rpcs.search_resources.retry_policy
3606
+
3607
+ options.apply_defaults timeout: @config.timeout,
3608
+ metadata: @config.metadata,
3609
+ retry_policy: @config.retry_policy
3610
+
3611
+ @api_hub_stub.call_rpc :search_resources, request, options: options do |response, operation|
3612
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :search_resources, request, response, operation, options
3613
+ yield response, operation if block_given?
3614
+ return response
3615
+ end
3616
+ rescue ::GRPC::BadStatus => e
3617
+ raise ::Google::Cloud::Error.from_error(e)
3618
+ end
3619
+
3620
+ ##
3621
+ # Create an External API resource in the API hub.
3622
+ #
3623
+ # @overload create_external_api(request, options = nil)
3624
+ # Pass arguments to `create_external_api` via a request object, either of type
3625
+ # {::Google::Cloud::ApiHub::V1::CreateExternalApiRequest} or an equivalent Hash.
3626
+ #
3627
+ # @param request [::Google::Cloud::ApiHub::V1::CreateExternalApiRequest, ::Hash]
3628
+ # A request object representing the call parameters. Required. To specify no
3629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3630
+ # @param options [::Gapic::CallOptions, ::Hash]
3631
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3632
+ #
3633
+ # @overload create_external_api(parent: nil, external_api_id: nil, external_api: nil)
3634
+ # Pass arguments to `create_external_api` via keyword arguments. Note that at
3635
+ # least one keyword argument is required. To specify no parameters, or to keep all
3636
+ # the default parameter values, pass an empty Hash as a request object (see above).
3637
+ #
3638
+ # @param parent [::String]
3639
+ # Required. The parent resource for the External API resource.
3640
+ # Format: `projects/{project}/locations/{location}`
3641
+ # @param external_api_id [::String]
3642
+ # Optional. The ID to use for the External API resource, which will become
3643
+ # the final component of the External API's resource name. This field is
3644
+ # optional.
3645
+ #
3646
+ # * If provided, the same will be used. The service will throw an error if
3647
+ # the specified id is already used by another External API resource in the
3648
+ # API hub.
3649
+ # * If not provided, a system generated id will be used.
3650
+ #
3651
+ # This value should be 4-500 characters, and valid characters
3652
+ # are /[a-z][A-Z][0-9]-_/.
3653
+ # @param external_api [::Google::Cloud::ApiHub::V1::ExternalApi, ::Hash]
3654
+ # Required. The External API resource to create.
3655
+ #
3656
+ # @yield [response, operation] Access the result along with the RPC operation
3657
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::ExternalApi]
3658
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3659
+ #
3660
+ # @return [::Google::Cloud::ApiHub::V1::ExternalApi]
3661
+ #
3662
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3663
+ #
3664
+ # @example Basic example
3665
+ # require "google/cloud/api_hub/v1"
3666
+ #
3667
+ # # Create a client object. The client can be reused for multiple calls.
3668
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3669
+ #
3670
+ # # Create a request. To set request fields, pass in keyword arguments.
3671
+ # request = Google::Cloud::ApiHub::V1::CreateExternalApiRequest.new
3672
+ #
3673
+ # # Call the create_external_api method.
3674
+ # result = client.create_external_api request
3675
+ #
3676
+ # # The returned object is of type Google::Cloud::ApiHub::V1::ExternalApi.
3677
+ # p result
3678
+ #
3679
+ def create_external_api request, options = nil
3680
+ raise ::ArgumentError, "request must be provided" if request.nil?
3681
+
3682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateExternalApiRequest
3683
+
3684
+ # Converts hash and nil to an options object
3685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3686
+
3687
+ # Customize the options with defaults
3688
+ metadata = @config.rpcs.create_external_api.metadata.to_h
3689
+
3690
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3691
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3693
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3694
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3695
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3696
+
3697
+ header_params = {}
3698
+ if request.parent
3699
+ header_params["parent"] = request.parent
3700
+ end
3701
+
3702
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3703
+ metadata[:"x-goog-request-params"] ||= request_params_header
3704
+
3705
+ options.apply_defaults timeout: @config.rpcs.create_external_api.timeout,
3706
+ metadata: metadata,
3707
+ retry_policy: @config.rpcs.create_external_api.retry_policy
3708
+
3709
+ options.apply_defaults timeout: @config.timeout,
3710
+ metadata: @config.metadata,
3711
+ retry_policy: @config.retry_policy
3712
+
3713
+ @api_hub_stub.call_rpc :create_external_api, request, options: options do |response, operation|
3714
+ yield response, operation if block_given?
3715
+ return response
3716
+ end
3717
+ rescue ::GRPC::BadStatus => e
3718
+ raise ::Google::Cloud::Error.from_error(e)
3719
+ end
3720
+
3721
+ ##
3722
+ # Get details about an External API resource in the API hub.
3723
+ #
3724
+ # @overload get_external_api(request, options = nil)
3725
+ # Pass arguments to `get_external_api` via a request object, either of type
3726
+ # {::Google::Cloud::ApiHub::V1::GetExternalApiRequest} or an equivalent Hash.
3727
+ #
3728
+ # @param request [::Google::Cloud::ApiHub::V1::GetExternalApiRequest, ::Hash]
3729
+ # A request object representing the call parameters. Required. To specify no
3730
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3731
+ # @param options [::Gapic::CallOptions, ::Hash]
3732
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3733
+ #
3734
+ # @overload get_external_api(name: nil)
3735
+ # Pass arguments to `get_external_api` via keyword arguments. Note that at
3736
+ # least one keyword argument is required. To specify no parameters, or to keep all
3737
+ # the default parameter values, pass an empty Hash as a request object (see above).
3738
+ #
3739
+ # @param name [::String]
3740
+ # Required. The name of the External API resource to retrieve.
3741
+ # Format:
3742
+ # `projects/{project}/locations/{location}/externalApis/{externalApi}`
3743
+ #
3744
+ # @yield [response, operation] Access the result along with the RPC operation
3745
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::ExternalApi]
3746
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3747
+ #
3748
+ # @return [::Google::Cloud::ApiHub::V1::ExternalApi]
3749
+ #
3750
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3751
+ #
3752
+ # @example Basic example
3753
+ # require "google/cloud/api_hub/v1"
3754
+ #
3755
+ # # Create a client object. The client can be reused for multiple calls.
3756
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3757
+ #
3758
+ # # Create a request. To set request fields, pass in keyword arguments.
3759
+ # request = Google::Cloud::ApiHub::V1::GetExternalApiRequest.new
3760
+ #
3761
+ # # Call the get_external_api method.
3762
+ # result = client.get_external_api request
3763
+ #
3764
+ # # The returned object is of type Google::Cloud::ApiHub::V1::ExternalApi.
3765
+ # p result
3766
+ #
3767
+ def get_external_api request, options = nil
3768
+ raise ::ArgumentError, "request must be provided" if request.nil?
3769
+
3770
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetExternalApiRequest
3771
+
3772
+ # Converts hash and nil to an options object
3773
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3774
+
3775
+ # Customize the options with defaults
3776
+ metadata = @config.rpcs.get_external_api.metadata.to_h
3777
+
3778
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3779
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3780
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3781
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3782
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3783
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3784
+
3785
+ header_params = {}
3786
+ if request.name
3787
+ header_params["name"] = request.name
3788
+ end
3789
+
3790
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3791
+ metadata[:"x-goog-request-params"] ||= request_params_header
3792
+
3793
+ options.apply_defaults timeout: @config.rpcs.get_external_api.timeout,
3794
+ metadata: metadata,
3795
+ retry_policy: @config.rpcs.get_external_api.retry_policy
3796
+
3797
+ options.apply_defaults timeout: @config.timeout,
3798
+ metadata: @config.metadata,
3799
+ retry_policy: @config.retry_policy
3800
+
3801
+ @api_hub_stub.call_rpc :get_external_api, request, options: options do |response, operation|
3802
+ yield response, operation if block_given?
3803
+ return response
3804
+ end
3805
+ rescue ::GRPC::BadStatus => e
3806
+ raise ::Google::Cloud::Error.from_error(e)
3807
+ end
3808
+
3809
+ ##
3810
+ # Update an External API resource in the API hub. The following fields can be
3811
+ # updated:
3812
+ #
3813
+ # * {::Google::Cloud::ApiHub::V1::ExternalApi#display_name display_name}
3814
+ # * {::Google::Cloud::ApiHub::V1::ExternalApi#description description}
3815
+ # * {::Google::Cloud::ApiHub::V1::ExternalApi#documentation documentation}
3816
+ # * {::Google::Cloud::ApiHub::V1::ExternalApi#endpoints endpoints}
3817
+ # * {::Google::Cloud::ApiHub::V1::ExternalApi#paths paths}
3818
+ #
3819
+ # The
3820
+ # {::Google::Cloud::ApiHub::V1::UpdateExternalApiRequest#update_mask update_mask}
3821
+ # should be used to specify the fields being updated.
3822
+ #
3823
+ # @overload update_external_api(request, options = nil)
3824
+ # Pass arguments to `update_external_api` via a request object, either of type
3825
+ # {::Google::Cloud::ApiHub::V1::UpdateExternalApiRequest} or an equivalent Hash.
3826
+ #
3827
+ # @param request [::Google::Cloud::ApiHub::V1::UpdateExternalApiRequest, ::Hash]
3828
+ # A request object representing the call parameters. Required. To specify no
3829
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3830
+ # @param options [::Gapic::CallOptions, ::Hash]
3831
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3832
+ #
3833
+ # @overload update_external_api(external_api: nil, update_mask: nil)
3834
+ # Pass arguments to `update_external_api` via keyword arguments. Note that at
3835
+ # least one keyword argument is required. To specify no parameters, or to keep all
3836
+ # the default parameter values, pass an empty Hash as a request object (see above).
3837
+ #
3838
+ # @param external_api [::Google::Cloud::ApiHub::V1::ExternalApi, ::Hash]
3839
+ # Required. The External API resource to update.
3840
+ #
3841
+ # The External API resource's `name` field is used to identify the External
3842
+ # API resource to update. Format:
3843
+ # `projects/{project}/locations/{location}/externalApis/{externalApi}`
3844
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3845
+ # Required. The list of fields to update.
3846
+ #
3847
+ # @yield [response, operation] Access the result along with the RPC operation
3848
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::ExternalApi]
3849
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3850
+ #
3851
+ # @return [::Google::Cloud::ApiHub::V1::ExternalApi]
3852
+ #
3853
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3854
+ #
3855
+ # @example Basic example
3856
+ # require "google/cloud/api_hub/v1"
3857
+ #
3858
+ # # Create a client object. The client can be reused for multiple calls.
3859
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3860
+ #
3861
+ # # Create a request. To set request fields, pass in keyword arguments.
3862
+ # request = Google::Cloud::ApiHub::V1::UpdateExternalApiRequest.new
3863
+ #
3864
+ # # Call the update_external_api method.
3865
+ # result = client.update_external_api request
3866
+ #
3867
+ # # The returned object is of type Google::Cloud::ApiHub::V1::ExternalApi.
3868
+ # p result
3869
+ #
3870
+ def update_external_api request, options = nil
3871
+ raise ::ArgumentError, "request must be provided" if request.nil?
3872
+
3873
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdateExternalApiRequest
3874
+
3875
+ # Converts hash and nil to an options object
3876
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3877
+
3878
+ # Customize the options with defaults
3879
+ metadata = @config.rpcs.update_external_api.metadata.to_h
3880
+
3881
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3882
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3883
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3884
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3885
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3886
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3887
+
3888
+ header_params = {}
3889
+ if request.external_api&.name
3890
+ header_params["external_api.name"] = request.external_api.name
3891
+ end
3892
+
3893
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3894
+ metadata[:"x-goog-request-params"] ||= request_params_header
3895
+
3896
+ options.apply_defaults timeout: @config.rpcs.update_external_api.timeout,
3897
+ metadata: metadata,
3898
+ retry_policy: @config.rpcs.update_external_api.retry_policy
3899
+
3900
+ options.apply_defaults timeout: @config.timeout,
3901
+ metadata: @config.metadata,
3902
+ retry_policy: @config.retry_policy
3903
+
3904
+ @api_hub_stub.call_rpc :update_external_api, request, options: options do |response, operation|
3905
+ yield response, operation if block_given?
3906
+ return response
3907
+ end
3908
+ rescue ::GRPC::BadStatus => e
3909
+ raise ::Google::Cloud::Error.from_error(e)
3910
+ end
3911
+
3912
+ ##
3913
+ # Delete an External API resource in the API hub.
3914
+ #
3915
+ # @overload delete_external_api(request, options = nil)
3916
+ # Pass arguments to `delete_external_api` via a request object, either of type
3917
+ # {::Google::Cloud::ApiHub::V1::DeleteExternalApiRequest} or an equivalent Hash.
3918
+ #
3919
+ # @param request [::Google::Cloud::ApiHub::V1::DeleteExternalApiRequest, ::Hash]
3920
+ # A request object representing the call parameters. Required. To specify no
3921
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3922
+ # @param options [::Gapic::CallOptions, ::Hash]
3923
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3924
+ #
3925
+ # @overload delete_external_api(name: nil)
3926
+ # Pass arguments to `delete_external_api` via keyword arguments. Note that at
3927
+ # least one keyword argument is required. To specify no parameters, or to keep all
3928
+ # the default parameter values, pass an empty Hash as a request object (see above).
3929
+ #
3930
+ # @param name [::String]
3931
+ # Required. The name of the External API resource to delete.
3932
+ # Format:
3933
+ # `projects/{project}/locations/{location}/externalApis/{externalApi}`
3934
+ #
3935
+ # @yield [response, operation] Access the result along with the RPC operation
3936
+ # @yieldparam response [::Google::Protobuf::Empty]
3937
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3938
+ #
3939
+ # @return [::Google::Protobuf::Empty]
3940
+ #
3941
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3942
+ #
3943
+ # @example Basic example
3944
+ # require "google/cloud/api_hub/v1"
3945
+ #
3946
+ # # Create a client object. The client can be reused for multiple calls.
3947
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
3948
+ #
3949
+ # # Create a request. To set request fields, pass in keyword arguments.
3950
+ # request = Google::Cloud::ApiHub::V1::DeleteExternalApiRequest.new
3951
+ #
3952
+ # # Call the delete_external_api method.
3953
+ # result = client.delete_external_api request
3954
+ #
3955
+ # # The returned object is of type Google::Protobuf::Empty.
3956
+ # p result
3957
+ #
3958
+ def delete_external_api request, options = nil
3959
+ raise ::ArgumentError, "request must be provided" if request.nil?
3960
+
3961
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeleteExternalApiRequest
3962
+
3963
+ # Converts hash and nil to an options object
3964
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3965
+
3966
+ # Customize the options with defaults
3967
+ metadata = @config.rpcs.delete_external_api.metadata.to_h
3968
+
3969
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3970
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3971
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3972
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
3973
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3974
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3975
+
3976
+ header_params = {}
3977
+ if request.name
3978
+ header_params["name"] = request.name
3979
+ end
3980
+
3981
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3982
+ metadata[:"x-goog-request-params"] ||= request_params_header
3983
+
3984
+ options.apply_defaults timeout: @config.rpcs.delete_external_api.timeout,
3985
+ metadata: metadata,
3986
+ retry_policy: @config.rpcs.delete_external_api.retry_policy
3987
+
3988
+ options.apply_defaults timeout: @config.timeout,
3989
+ metadata: @config.metadata,
3990
+ retry_policy: @config.retry_policy
3991
+
3992
+ @api_hub_stub.call_rpc :delete_external_api, request, options: options do |response, operation|
3993
+ yield response, operation if block_given?
3994
+ return response
3995
+ end
3996
+ rescue ::GRPC::BadStatus => e
3997
+ raise ::Google::Cloud::Error.from_error(e)
3998
+ end
3999
+
4000
+ ##
4001
+ # List External API resources in the API hub.
4002
+ #
4003
+ # @overload list_external_apis(request, options = nil)
4004
+ # Pass arguments to `list_external_apis` via a request object, either of type
4005
+ # {::Google::Cloud::ApiHub::V1::ListExternalApisRequest} or an equivalent Hash.
4006
+ #
4007
+ # @param request [::Google::Cloud::ApiHub::V1::ListExternalApisRequest, ::Hash]
4008
+ # A request object representing the call parameters. Required. To specify no
4009
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4010
+ # @param options [::Gapic::CallOptions, ::Hash]
4011
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4012
+ #
4013
+ # @overload list_external_apis(parent: nil, page_size: nil, page_token: nil)
4014
+ # Pass arguments to `list_external_apis` via keyword arguments. Note that at
4015
+ # least one keyword argument is required. To specify no parameters, or to keep all
4016
+ # the default parameter values, pass an empty Hash as a request object (see above).
4017
+ #
4018
+ # @param parent [::String]
4019
+ # Required. The parent, which owns this collection of External API resources.
4020
+ # Format: `projects/{project}/locations/{location}`
4021
+ # @param page_size [::Integer]
4022
+ # Optional. The maximum number of External API resources to return. The
4023
+ # service may return fewer than this value. If unspecified, at most 50
4024
+ # ExternalApis will be returned. The maximum value is 1000; values above 1000
4025
+ # will be coerced to 1000.
4026
+ # @param page_token [::String]
4027
+ # Optional. A page token, received from a previous `ListExternalApis` call.
4028
+ # Provide this to retrieve the subsequent page.
4029
+ #
4030
+ # When paginating, all other parameters (except page_size) provided to
4031
+ # `ListExternalApis` must match the call that provided the page token.
4032
+ #
4033
+ # @yield [response, operation] Access the result along with the RPC operation
4034
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::ExternalApi>]
4035
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4036
+ #
4037
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::ExternalApi>]
4038
+ #
4039
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4040
+ #
4041
+ # @example Basic example
4042
+ # require "google/cloud/api_hub/v1"
4043
+ #
4044
+ # # Create a client object. The client can be reused for multiple calls.
4045
+ # client = Google::Cloud::ApiHub::V1::ApiHub::Client.new
4046
+ #
4047
+ # # Create a request. To set request fields, pass in keyword arguments.
4048
+ # request = Google::Cloud::ApiHub::V1::ListExternalApisRequest.new
4049
+ #
4050
+ # # Call the list_external_apis method.
4051
+ # result = client.list_external_apis request
4052
+ #
4053
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
4054
+ # # over elements, and API calls will be issued to fetch pages as needed.
4055
+ # result.each do |item|
4056
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::ExternalApi.
4057
+ # p item
4058
+ # end
4059
+ #
4060
+ def list_external_apis request, options = nil
4061
+ raise ::ArgumentError, "request must be provided" if request.nil?
4062
+
4063
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListExternalApisRequest
4064
+
4065
+ # Converts hash and nil to an options object
4066
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4067
+
4068
+ # Customize the options with defaults
4069
+ metadata = @config.rpcs.list_external_apis.metadata.to_h
4070
+
4071
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4072
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4073
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4074
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
4075
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4076
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4077
+
4078
+ header_params = {}
4079
+ if request.parent
4080
+ header_params["parent"] = request.parent
4081
+ end
4082
+
4083
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4084
+ metadata[:"x-goog-request-params"] ||= request_params_header
4085
+
4086
+ options.apply_defaults timeout: @config.rpcs.list_external_apis.timeout,
4087
+ metadata: metadata,
4088
+ retry_policy: @config.rpcs.list_external_apis.retry_policy
4089
+
4090
+ options.apply_defaults timeout: @config.timeout,
4091
+ metadata: @config.metadata,
4092
+ retry_policy: @config.retry_policy
4093
+
4094
+ @api_hub_stub.call_rpc :list_external_apis, request, options: options do |response, operation|
4095
+ response = ::Gapic::PagedEnumerable.new @api_hub_stub, :list_external_apis, request, response, operation, options
4096
+ yield response, operation if block_given?
4097
+ return response
4098
+ end
4099
+ rescue ::GRPC::BadStatus => e
4100
+ raise ::Google::Cloud::Error.from_error(e)
4101
+ end
4102
+
4103
+ ##
4104
+ # Configuration class for the ApiHub API.
4105
+ #
4106
+ # This class represents the configuration for ApiHub,
4107
+ # providing control over timeouts, retry behavior, logging, transport
4108
+ # parameters, and other low-level controls. Certain parameters can also be
4109
+ # applied individually to specific RPCs. See
4110
+ # {::Google::Cloud::ApiHub::V1::ApiHub::Client::Configuration::Rpcs}
4111
+ # for a list of RPCs that can be configured independently.
4112
+ #
4113
+ # Configuration can be applied globally to all clients, or to a single client
4114
+ # on construction.
4115
+ #
4116
+ # @example
4117
+ #
4118
+ # # Modify the global config, setting the timeout for
4119
+ # # create_api to 20 seconds,
4120
+ # # and all remaining timeouts to 10 seconds.
4121
+ # ::Google::Cloud::ApiHub::V1::ApiHub::Client.configure do |config|
4122
+ # config.timeout = 10.0
4123
+ # config.rpcs.create_api.timeout = 20.0
4124
+ # end
4125
+ #
4126
+ # # Apply the above configuration only to a new client.
4127
+ # client = ::Google::Cloud::ApiHub::V1::ApiHub::Client.new do |config|
4128
+ # config.timeout = 10.0
4129
+ # config.rpcs.create_api.timeout = 20.0
4130
+ # end
4131
+ #
4132
+ # @!attribute [rw] endpoint
4133
+ # A custom service endpoint, as a hostname or hostname:port. The default is
4134
+ # nil, indicating to use the default endpoint in the current universe domain.
4135
+ # @return [::String,nil]
4136
+ # @!attribute [rw] credentials
4137
+ # Credentials to send with calls. You may provide any of the following types:
4138
+ # * (`String`) The path to a service account key file in JSON format
4139
+ # * (`Hash`) A service account key as a Hash
4140
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
4141
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4142
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
4143
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
4144
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
4145
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
4146
+ # * (`nil`) indicating no credentials
4147
+ # @return [::Object]
4148
+ # @!attribute [rw] scope
4149
+ # The OAuth scopes
4150
+ # @return [::Array<::String>]
4151
+ # @!attribute [rw] lib_name
4152
+ # The library name as recorded in instrumentation and logging
4153
+ # @return [::String]
4154
+ # @!attribute [rw] lib_version
4155
+ # The library version as recorded in instrumentation and logging
4156
+ # @return [::String]
4157
+ # @!attribute [rw] channel_args
4158
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
4159
+ # `GRPC::Core::Channel` object is provided as the credential.
4160
+ # @return [::Hash]
4161
+ # @!attribute [rw] interceptors
4162
+ # An array of interceptors that are run before calls are executed.
4163
+ # @return [::Array<::GRPC::ClientInterceptor>]
4164
+ # @!attribute [rw] timeout
4165
+ # The call timeout in seconds.
4166
+ # @return [::Numeric]
4167
+ # @!attribute [rw] metadata
4168
+ # Additional gRPC headers to be sent with the call.
4169
+ # @return [::Hash{::Symbol=>::String}]
4170
+ # @!attribute [rw] retry_policy
4171
+ # The retry policy. The value is a hash with the following keys:
4172
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4173
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4174
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4175
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4176
+ # trigger a retry.
4177
+ # @return [::Hash]
4178
+ # @!attribute [rw] quota_project
4179
+ # A separate project against which to charge quota.
4180
+ # @return [::String]
4181
+ # @!attribute [rw] universe_domain
4182
+ # The universe domain within which to make requests. This determines the
4183
+ # default endpoint URL. The default value of nil uses the environment
4184
+ # universe (usually the default "googleapis.com" universe).
4185
+ # @return [::String,nil]
4186
+ #
4187
+ class Configuration
4188
+ extend ::Gapic::Config
4189
+
4190
+ # @private
4191
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4192
+ DEFAULT_ENDPOINT = "apihub.googleapis.com"
4193
+
4194
+ config_attr :endpoint, nil, ::String, nil
4195
+ config_attr :credentials, nil do |value|
4196
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
4197
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
4198
+ allowed.any? { |klass| klass === value }
4199
+ end
4200
+ config_attr :scope, nil, ::String, ::Array, nil
4201
+ config_attr :lib_name, nil, ::String, nil
4202
+ config_attr :lib_version, nil, ::String, nil
4203
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
4204
+ config_attr :interceptors, nil, ::Array, nil
4205
+ config_attr :timeout, nil, ::Numeric, nil
4206
+ config_attr :metadata, nil, ::Hash, nil
4207
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4208
+ config_attr :quota_project, nil, ::String, nil
4209
+ config_attr :universe_domain, nil, ::String, nil
4210
+
4211
+ # @private
4212
+ def initialize parent_config = nil
4213
+ @parent_config = parent_config unless parent_config.nil?
4214
+
4215
+ yield self if block_given?
4216
+ end
4217
+
4218
+ ##
4219
+ # Configurations for individual RPCs
4220
+ # @return [Rpcs]
4221
+ #
4222
+ def rpcs
4223
+ @rpcs ||= begin
4224
+ parent_rpcs = nil
4225
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
4226
+ Rpcs.new parent_rpcs
4227
+ end
4228
+ end
4229
+
4230
+ ##
4231
+ # Configuration for the channel pool
4232
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
4233
+ #
4234
+ def channel_pool
4235
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
4236
+ end
4237
+
4238
+ ##
4239
+ # Configuration RPC class for the ApiHub API.
4240
+ #
4241
+ # Includes fields providing the configuration for each RPC in this service.
4242
+ # Each configuration object is of type `Gapic::Config::Method` and includes
4243
+ # the following configuration fields:
4244
+ #
4245
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
4246
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
4247
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
4248
+ # include the following keys:
4249
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4250
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4251
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4252
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4253
+ # trigger a retry.
4254
+ #
4255
+ class Rpcs
4256
+ ##
4257
+ # RPC-specific configuration for `create_api`
4258
+ # @return [::Gapic::Config::Method]
4259
+ #
4260
+ attr_reader :create_api
4261
+ ##
4262
+ # RPC-specific configuration for `get_api`
4263
+ # @return [::Gapic::Config::Method]
4264
+ #
4265
+ attr_reader :get_api
4266
+ ##
4267
+ # RPC-specific configuration for `list_apis`
4268
+ # @return [::Gapic::Config::Method]
4269
+ #
4270
+ attr_reader :list_apis
4271
+ ##
4272
+ # RPC-specific configuration for `update_api`
4273
+ # @return [::Gapic::Config::Method]
4274
+ #
4275
+ attr_reader :update_api
4276
+ ##
4277
+ # RPC-specific configuration for `delete_api`
4278
+ # @return [::Gapic::Config::Method]
4279
+ #
4280
+ attr_reader :delete_api
4281
+ ##
4282
+ # RPC-specific configuration for `create_version`
4283
+ # @return [::Gapic::Config::Method]
4284
+ #
4285
+ attr_reader :create_version
4286
+ ##
4287
+ # RPC-specific configuration for `get_version`
4288
+ # @return [::Gapic::Config::Method]
4289
+ #
4290
+ attr_reader :get_version
4291
+ ##
4292
+ # RPC-specific configuration for `list_versions`
4293
+ # @return [::Gapic::Config::Method]
4294
+ #
4295
+ attr_reader :list_versions
4296
+ ##
4297
+ # RPC-specific configuration for `update_version`
4298
+ # @return [::Gapic::Config::Method]
4299
+ #
4300
+ attr_reader :update_version
4301
+ ##
4302
+ # RPC-specific configuration for `delete_version`
4303
+ # @return [::Gapic::Config::Method]
4304
+ #
4305
+ attr_reader :delete_version
4306
+ ##
4307
+ # RPC-specific configuration for `create_spec`
4308
+ # @return [::Gapic::Config::Method]
4309
+ #
4310
+ attr_reader :create_spec
4311
+ ##
4312
+ # RPC-specific configuration for `get_spec`
4313
+ # @return [::Gapic::Config::Method]
4314
+ #
4315
+ attr_reader :get_spec
4316
+ ##
4317
+ # RPC-specific configuration for `get_spec_contents`
4318
+ # @return [::Gapic::Config::Method]
4319
+ #
4320
+ attr_reader :get_spec_contents
4321
+ ##
4322
+ # RPC-specific configuration for `list_specs`
4323
+ # @return [::Gapic::Config::Method]
4324
+ #
4325
+ attr_reader :list_specs
4326
+ ##
4327
+ # RPC-specific configuration for `update_spec`
4328
+ # @return [::Gapic::Config::Method]
4329
+ #
4330
+ attr_reader :update_spec
4331
+ ##
4332
+ # RPC-specific configuration for `delete_spec`
4333
+ # @return [::Gapic::Config::Method]
4334
+ #
4335
+ attr_reader :delete_spec
4336
+ ##
4337
+ # RPC-specific configuration for `get_api_operation`
4338
+ # @return [::Gapic::Config::Method]
4339
+ #
4340
+ attr_reader :get_api_operation
4341
+ ##
4342
+ # RPC-specific configuration for `list_api_operations`
4343
+ # @return [::Gapic::Config::Method]
4344
+ #
4345
+ attr_reader :list_api_operations
4346
+ ##
4347
+ # RPC-specific configuration for `get_definition`
4348
+ # @return [::Gapic::Config::Method]
4349
+ #
4350
+ attr_reader :get_definition
4351
+ ##
4352
+ # RPC-specific configuration for `create_deployment`
4353
+ # @return [::Gapic::Config::Method]
4354
+ #
4355
+ attr_reader :create_deployment
4356
+ ##
4357
+ # RPC-specific configuration for `get_deployment`
4358
+ # @return [::Gapic::Config::Method]
4359
+ #
4360
+ attr_reader :get_deployment
4361
+ ##
4362
+ # RPC-specific configuration for `list_deployments`
4363
+ # @return [::Gapic::Config::Method]
4364
+ #
4365
+ attr_reader :list_deployments
4366
+ ##
4367
+ # RPC-specific configuration for `update_deployment`
4368
+ # @return [::Gapic::Config::Method]
4369
+ #
4370
+ attr_reader :update_deployment
4371
+ ##
4372
+ # RPC-specific configuration for `delete_deployment`
4373
+ # @return [::Gapic::Config::Method]
4374
+ #
4375
+ attr_reader :delete_deployment
4376
+ ##
4377
+ # RPC-specific configuration for `create_attribute`
4378
+ # @return [::Gapic::Config::Method]
4379
+ #
4380
+ attr_reader :create_attribute
4381
+ ##
4382
+ # RPC-specific configuration for `get_attribute`
4383
+ # @return [::Gapic::Config::Method]
4384
+ #
4385
+ attr_reader :get_attribute
4386
+ ##
4387
+ # RPC-specific configuration for `update_attribute`
4388
+ # @return [::Gapic::Config::Method]
4389
+ #
4390
+ attr_reader :update_attribute
4391
+ ##
4392
+ # RPC-specific configuration for `delete_attribute`
4393
+ # @return [::Gapic::Config::Method]
4394
+ #
4395
+ attr_reader :delete_attribute
4396
+ ##
4397
+ # RPC-specific configuration for `list_attributes`
4398
+ # @return [::Gapic::Config::Method]
4399
+ #
4400
+ attr_reader :list_attributes
4401
+ ##
4402
+ # RPC-specific configuration for `search_resources`
4403
+ # @return [::Gapic::Config::Method]
4404
+ #
4405
+ attr_reader :search_resources
4406
+ ##
4407
+ # RPC-specific configuration for `create_external_api`
4408
+ # @return [::Gapic::Config::Method]
4409
+ #
4410
+ attr_reader :create_external_api
4411
+ ##
4412
+ # RPC-specific configuration for `get_external_api`
4413
+ # @return [::Gapic::Config::Method]
4414
+ #
4415
+ attr_reader :get_external_api
4416
+ ##
4417
+ # RPC-specific configuration for `update_external_api`
4418
+ # @return [::Gapic::Config::Method]
4419
+ #
4420
+ attr_reader :update_external_api
4421
+ ##
4422
+ # RPC-specific configuration for `delete_external_api`
4423
+ # @return [::Gapic::Config::Method]
4424
+ #
4425
+ attr_reader :delete_external_api
4426
+ ##
4427
+ # RPC-specific configuration for `list_external_apis`
4428
+ # @return [::Gapic::Config::Method]
4429
+ #
4430
+ attr_reader :list_external_apis
4431
+
4432
+ # @private
4433
+ def initialize parent_rpcs = nil
4434
+ create_api_config = parent_rpcs.create_api if parent_rpcs.respond_to? :create_api
4435
+ @create_api = ::Gapic::Config::Method.new create_api_config
4436
+ get_api_config = parent_rpcs.get_api if parent_rpcs.respond_to? :get_api
4437
+ @get_api = ::Gapic::Config::Method.new get_api_config
4438
+ list_apis_config = parent_rpcs.list_apis if parent_rpcs.respond_to? :list_apis
4439
+ @list_apis = ::Gapic::Config::Method.new list_apis_config
4440
+ update_api_config = parent_rpcs.update_api if parent_rpcs.respond_to? :update_api
4441
+ @update_api = ::Gapic::Config::Method.new update_api_config
4442
+ delete_api_config = parent_rpcs.delete_api if parent_rpcs.respond_to? :delete_api
4443
+ @delete_api = ::Gapic::Config::Method.new delete_api_config
4444
+ create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version
4445
+ @create_version = ::Gapic::Config::Method.new create_version_config
4446
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
4447
+ @get_version = ::Gapic::Config::Method.new get_version_config
4448
+ list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
4449
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
4450
+ update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version
4451
+ @update_version = ::Gapic::Config::Method.new update_version_config
4452
+ delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
4453
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
4454
+ create_spec_config = parent_rpcs.create_spec if parent_rpcs.respond_to? :create_spec
4455
+ @create_spec = ::Gapic::Config::Method.new create_spec_config
4456
+ get_spec_config = parent_rpcs.get_spec if parent_rpcs.respond_to? :get_spec
4457
+ @get_spec = ::Gapic::Config::Method.new get_spec_config
4458
+ get_spec_contents_config = parent_rpcs.get_spec_contents if parent_rpcs.respond_to? :get_spec_contents
4459
+ @get_spec_contents = ::Gapic::Config::Method.new get_spec_contents_config
4460
+ list_specs_config = parent_rpcs.list_specs if parent_rpcs.respond_to? :list_specs
4461
+ @list_specs = ::Gapic::Config::Method.new list_specs_config
4462
+ update_spec_config = parent_rpcs.update_spec if parent_rpcs.respond_to? :update_spec
4463
+ @update_spec = ::Gapic::Config::Method.new update_spec_config
4464
+ delete_spec_config = parent_rpcs.delete_spec if parent_rpcs.respond_to? :delete_spec
4465
+ @delete_spec = ::Gapic::Config::Method.new delete_spec_config
4466
+ get_api_operation_config = parent_rpcs.get_api_operation if parent_rpcs.respond_to? :get_api_operation
4467
+ @get_api_operation = ::Gapic::Config::Method.new get_api_operation_config
4468
+ list_api_operations_config = parent_rpcs.list_api_operations if parent_rpcs.respond_to? :list_api_operations
4469
+ @list_api_operations = ::Gapic::Config::Method.new list_api_operations_config
4470
+ get_definition_config = parent_rpcs.get_definition if parent_rpcs.respond_to? :get_definition
4471
+ @get_definition = ::Gapic::Config::Method.new get_definition_config
4472
+ create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment
4473
+ @create_deployment = ::Gapic::Config::Method.new create_deployment_config
4474
+ get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
4475
+ @get_deployment = ::Gapic::Config::Method.new get_deployment_config
4476
+ list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
4477
+ @list_deployments = ::Gapic::Config::Method.new list_deployments_config
4478
+ update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment
4479
+ @update_deployment = ::Gapic::Config::Method.new update_deployment_config
4480
+ delete_deployment_config = parent_rpcs.delete_deployment if parent_rpcs.respond_to? :delete_deployment
4481
+ @delete_deployment = ::Gapic::Config::Method.new delete_deployment_config
4482
+ create_attribute_config = parent_rpcs.create_attribute if parent_rpcs.respond_to? :create_attribute
4483
+ @create_attribute = ::Gapic::Config::Method.new create_attribute_config
4484
+ get_attribute_config = parent_rpcs.get_attribute if parent_rpcs.respond_to? :get_attribute
4485
+ @get_attribute = ::Gapic::Config::Method.new get_attribute_config
4486
+ update_attribute_config = parent_rpcs.update_attribute if parent_rpcs.respond_to? :update_attribute
4487
+ @update_attribute = ::Gapic::Config::Method.new update_attribute_config
4488
+ delete_attribute_config = parent_rpcs.delete_attribute if parent_rpcs.respond_to? :delete_attribute
4489
+ @delete_attribute = ::Gapic::Config::Method.new delete_attribute_config
4490
+ list_attributes_config = parent_rpcs.list_attributes if parent_rpcs.respond_to? :list_attributes
4491
+ @list_attributes = ::Gapic::Config::Method.new list_attributes_config
4492
+ search_resources_config = parent_rpcs.search_resources if parent_rpcs.respond_to? :search_resources
4493
+ @search_resources = ::Gapic::Config::Method.new search_resources_config
4494
+ create_external_api_config = parent_rpcs.create_external_api if parent_rpcs.respond_to? :create_external_api
4495
+ @create_external_api = ::Gapic::Config::Method.new create_external_api_config
4496
+ get_external_api_config = parent_rpcs.get_external_api if parent_rpcs.respond_to? :get_external_api
4497
+ @get_external_api = ::Gapic::Config::Method.new get_external_api_config
4498
+ update_external_api_config = parent_rpcs.update_external_api if parent_rpcs.respond_to? :update_external_api
4499
+ @update_external_api = ::Gapic::Config::Method.new update_external_api_config
4500
+ delete_external_api_config = parent_rpcs.delete_external_api if parent_rpcs.respond_to? :delete_external_api
4501
+ @delete_external_api = ::Gapic::Config::Method.new delete_external_api_config
4502
+ list_external_apis_config = parent_rpcs.list_external_apis if parent_rpcs.respond_to? :list_external_apis
4503
+ @list_external_apis = ::Gapic::Config::Method.new list_external_apis_config
4504
+
4505
+ yield self if block_given?
4506
+ end
4507
+ end
4508
+ end
4509
+ end
4510
+ end
4511
+ end
4512
+ end
4513
+ end
4514
+ end