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

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