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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/api_hub/v1/api_hub/client.rb +4514 -0
  6. data/lib/google/cloud/api_hub/v1/api_hub/credentials.rb +47 -0
  7. data/lib/google/cloud/api_hub/v1/api_hub/paths.rb +216 -0
  8. data/lib/google/cloud/api_hub/v1/api_hub/rest/client.rb +4251 -0
  9. data/lib/google/cloud/api_hub/v1/api_hub/rest/service_stub.rb +2147 -0
  10. data/lib/google/cloud/api_hub/v1/api_hub/rest.rb +53 -0
  11. data/lib/google/cloud/api_hub/v1/api_hub.rb +55 -0
  12. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/client.rb +906 -0
  13. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/credentials.rb +47 -0
  14. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/paths.rb +88 -0
  15. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/client.rb +853 -0
  16. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest/service_stub.rb +366 -0
  17. data/lib/google/cloud/api_hub/v1/api_hub_dependencies/rest.rb +54 -0
  18. data/lib/google/cloud/api_hub/v1/api_hub_dependencies.rb +56 -0
  19. data/lib/google/cloud/api_hub/v1/api_hub_plugin/client.rb +640 -0
  20. data/lib/google/cloud/api_hub/v1/api_hub_plugin/credentials.rb +47 -0
  21. data/lib/google/cloud/api_hub/v1/api_hub_plugin/paths.rb +52 -0
  22. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb +601 -0
  23. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest/service_stub.rb +248 -0
  24. data/lib/google/cloud/api_hub/v1/api_hub_plugin/rest.rb +53 -0
  25. data/lib/google/cloud/api_hub/v1/api_hub_plugin.rb +55 -0
  26. data/lib/google/cloud/api_hub/v1/bindings_override.rb +102 -0
  27. data/lib/google/cloud/api_hub/v1/host_project_registration_service/client.rb +689 -0
  28. data/lib/google/cloud/api_hub/v1/host_project_registration_service/credentials.rb +47 -0
  29. data/lib/google/cloud/api_hub/v1/host_project_registration_service/paths.rb +83 -0
  30. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/client.rb +650 -0
  31. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest/service_stub.rb +247 -0
  32. data/lib/google/cloud/api_hub/v1/host_project_registration_service/rest.rb +53 -0
  33. data/lib/google/cloud/api_hub/v1/host_project_registration_service.rb +55 -0
  34. data/lib/google/cloud/api_hub/v1/linting_service/client.rb +744 -0
  35. data/lib/google/cloud/api_hub/v1/linting_service/credentials.rb +47 -0
  36. data/lib/google/cloud/api_hub/v1/linting_service/paths.rb +75 -0
  37. data/lib/google/cloud/api_hub/v1/linting_service/rest/client.rb +698 -0
  38. data/lib/google/cloud/api_hub/v1/linting_service/rest/service_stub.rb +307 -0
  39. data/lib/google/cloud/api_hub/v1/linting_service/rest.rb +53 -0
  40. data/lib/google/cloud/api_hub/v1/linting_service.rb +55 -0
  41. data/lib/google/cloud/api_hub/v1/provisioning/client.rb +676 -0
  42. data/lib/google/cloud/api_hub/v1/provisioning/credentials.rb +47 -0
  43. data/lib/google/cloud/api_hub/v1/provisioning/operations.rb +809 -0
  44. data/lib/google/cloud/api_hub/v1/provisioning/paths.rb +69 -0
  45. data/lib/google/cloud/api_hub/v1/provisioning/rest/client.rb +637 -0
  46. data/lib/google/cloud/api_hub/v1/provisioning/rest/operations.rb +902 -0
  47. data/lib/google/cloud/api_hub/v1/provisioning/rest/service_stub.rb +247 -0
  48. data/lib/google/cloud/api_hub/v1/provisioning/rest.rb +54 -0
  49. data/lib/google/cloud/api_hub/v1/provisioning.rb +56 -0
  50. data/lib/google/cloud/api_hub/v1/rest.rb +44 -0
  51. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/client.rb +885 -0
  52. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/credentials.rb +47 -0
  53. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/paths.rb +83 -0
  54. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/client.rb +832 -0
  55. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest/service_stub.rb +365 -0
  56. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service/rest.rb +53 -0
  57. data/lib/google/cloud/api_hub/v1/runtime_project_attachment_service.rb +55 -0
  58. data/lib/google/cloud/api_hub/v1/version.rb +7 -2
  59. data/lib/google/cloud/api_hub/v1.rb +51 -0
  60. data/lib/google/cloud/apihub/v1/apihub_service_pb.rb +102 -0
  61. data/lib/google/cloud/apihub/v1/apihub_service_services_pb.rb +288 -0
  62. data/lib/google/cloud/apihub/v1/common_fields_pb.rb +92 -0
  63. data/lib/google/cloud/apihub/v1/host_project_registration_service_pb.rb +53 -0
  64. data/lib/google/cloud/apihub/v1/host_project_registration_service_services_pb.rb +53 -0
  65. data/lib/google/cloud/apihub/v1/linting_service_pb.rb +56 -0
  66. data/lib/google/cloud/apihub/v1/linting_service_services_pb.rb +53 -0
  67. data/lib/google/cloud/apihub/v1/plugin_service_pb.rb +53 -0
  68. data/lib/google/cloud/apihub/v1/plugin_service_services_pb.rb +51 -0
  69. data/lib/google/cloud/apihub/v1/provisioning_service_pb.rb +53 -0
  70. data/lib/google/cloud/apihub/v1/provisioning_service_services_pb.rb +50 -0
  71. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_pb.rb +57 -0
  72. data/lib/google/cloud/apihub/v1/runtime_project_attachment_service_services_pb.rb +55 -0
  73. data/lib/google-cloud-api_hub-v1.rb +21 -0
  74. data/proto_docs/README.md +4 -0
  75. data/proto_docs/google/api/client.rb +420 -0
  76. data/proto_docs/google/api/field_behavior.rb +85 -0
  77. data/proto_docs/google/api/launch_stage.rb +71 -0
  78. data/proto_docs/google/api/resource.rb +227 -0
  79. data/proto_docs/google/cloud/apihub/v1/apihub_service.rb +1317 -0
  80. data/proto_docs/google/cloud/apihub/v1/common_fields.rb +1296 -0
  81. data/proto_docs/google/cloud/apihub/v1/host_project_registration_service.rb +146 -0
  82. data/proto_docs/google/cloud/apihub/v1/linting_service.rb +103 -0
  83. data/proto_docs/google/cloud/apihub/v1/plugin_service.rb +104 -0
  84. data/proto_docs/google/cloud/apihub/v1/provisioning_service.rb +87 -0
  85. data/proto_docs/google/cloud/apihub/v1/runtime_project_attachment_service.rb +182 -0
  86. data/proto_docs/google/longrunning/operations.rb +164 -0
  87. data/proto_docs/google/protobuf/any.rb +145 -0
  88. data/proto_docs/google/protobuf/duration.rb +98 -0
  89. data/proto_docs/google/protobuf/empty.rb +34 -0
  90. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  91. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  92. data/proto_docs/google/rpc/status.rb +48 -0
  93. metadata +155 -10
@@ -0,0 +1,689 @@
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/host_project_registration_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ApiHub
26
+ module V1
27
+ module HostProjectRegistrationService
28
+ ##
29
+ # Client for the HostProjectRegistrationService service.
30
+ #
31
+ # This service is used for managing the host project registrations.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "apihub.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :host_project_registration_service_stub
44
+
45
+ ##
46
+ # Configure the HostProjectRegistrationService Client class.
47
+ #
48
+ # See {::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all HostProjectRegistrationService clients
54
+ # ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "ApiHub", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.create_host_project_registration.timeout = 60.0
75
+
76
+ default_config.rpcs.get_host_project_registration.timeout = 60.0
77
+ default_config.rpcs.get_host_project_registration.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.list_host_project_registrations.timeout = 60.0
82
+ default_config.rpcs.list_host_project_registrations.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config
87
+ end
88
+ yield @configure if block_given?
89
+ @configure
90
+ end
91
+
92
+ ##
93
+ # Configure the HostProjectRegistrationService Client instance.
94
+ #
95
+ # The configuration is set to the derived mode, meaning that values can be changed,
96
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
97
+ # should be made on {Client.configure}.
98
+ #
99
+ # See {::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client::Configuration}
100
+ # for a description of the configuration fields.
101
+ #
102
+ # @yield [config] Configure the Client client.
103
+ # @yieldparam config [Client::Configuration]
104
+ #
105
+ # @return [Client::Configuration]
106
+ #
107
+ def configure
108
+ yield @config if block_given?
109
+ @config
110
+ end
111
+
112
+ ##
113
+ # The effective universe domain
114
+ #
115
+ # @return [String]
116
+ #
117
+ def universe_domain
118
+ @host_project_registration_service_stub.universe_domain
119
+ end
120
+
121
+ ##
122
+ # Create a new HostProjectRegistrationService client object.
123
+ #
124
+ # @example
125
+ #
126
+ # # Create a client using the default configuration
127
+ # client = ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new
128
+ #
129
+ # # Create a client using a custom configuration
130
+ # client = ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new do |config|
131
+ # config.timeout = 10.0
132
+ # end
133
+ #
134
+ # @yield [config] Configure the HostProjectRegistrationService client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ def initialize
138
+ # These require statements are intentionally placed here to initialize
139
+ # the gRPC module only when it's required.
140
+ # See https://github.com/googleapis/toolkit/issues/446
141
+ require "gapic/grpc"
142
+ require "google/cloud/apihub/v1/host_project_registration_service_services_pb"
143
+
144
+ # Create the configuration object
145
+ @config = Configuration.new Client.configure
146
+
147
+ # Yield the configuration if needed
148
+ yield @config if block_given?
149
+
150
+ # Create credentials
151
+ credentials = @config.credentials
152
+ # Use self-signed JWT if the endpoint is unchanged from default,
153
+ # but only if the default endpoint does not have a region prefix.
154
+ enable_self_signed_jwt = @config.endpoint.nil? ||
155
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
156
+ !@config.endpoint.split(".").first.include?("-"))
157
+ credentials ||= Credentials.default scope: @config.scope,
158
+ enable_self_signed_jwt: enable_self_signed_jwt
159
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
160
+ credentials = Credentials.new credentials, scope: @config.scope
161
+ end
162
+ @quota_project_id = @config.quota_project
163
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
164
+
165
+ @host_project_registration_service_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool
174
+ )
175
+
176
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
177
+ config.credentials = credentials
178
+ config.quota_project = @quota_project_id
179
+ config.endpoint = @host_project_registration_service_stub.endpoint
180
+ config.universe_domain = @host_project_registration_service_stub.universe_domain
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Create a host project registration.
195
+ # A Google cloud project can be registered as a host project if it is not
196
+ # attached as a runtime project to another host project.
197
+ # A project can be registered as a host project only once. Subsequent
198
+ # register calls for the same project will fail.
199
+ #
200
+ # @overload create_host_project_registration(request, options = nil)
201
+ # Pass arguments to `create_host_project_registration` via a request object, either of type
202
+ # {::Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest} or an equivalent Hash.
203
+ #
204
+ # @param request [::Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest, ::Hash]
205
+ # A request object representing the call parameters. Required. To specify no
206
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
207
+ # @param options [::Gapic::CallOptions, ::Hash]
208
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
209
+ #
210
+ # @overload create_host_project_registration(parent: nil, host_project_registration_id: nil, host_project_registration: nil)
211
+ # Pass arguments to `create_host_project_registration` via keyword arguments. Note that at
212
+ # least one keyword argument is required. To specify no parameters, or to keep all
213
+ # the default parameter values, pass an empty Hash as a request object (see above).
214
+ #
215
+ # @param parent [::String]
216
+ # Required. The parent resource for the host project.
217
+ # Format: `projects/{project}/locations/{location}`
218
+ # @param host_project_registration_id [::String]
219
+ # Required. The ID to use for the Host Project Registration, which will
220
+ # become the final component of the host project registration's resource
221
+ # name. The ID must be the same as the Google cloud project specified in the
222
+ # host_project_registration.gcp_project field.
223
+ # @param host_project_registration [::Google::Cloud::ApiHub::V1::HostProjectRegistration, ::Hash]
224
+ # Required. The host project registration to register.
225
+ #
226
+ # @yield [response, operation] Access the result along with the RPC operation
227
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::HostProjectRegistration]
228
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
229
+ #
230
+ # @return [::Google::Cloud::ApiHub::V1::HostProjectRegistration]
231
+ #
232
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
233
+ #
234
+ # @example Basic example
235
+ # require "google/cloud/api_hub/v1"
236
+ #
237
+ # # Create a client object. The client can be reused for multiple calls.
238
+ # client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new
239
+ #
240
+ # # Create a request. To set request fields, pass in keyword arguments.
241
+ # request = Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest.new
242
+ #
243
+ # # Call the create_host_project_registration method.
244
+ # result = client.create_host_project_registration request
245
+ #
246
+ # # The returned object is of type Google::Cloud::ApiHub::V1::HostProjectRegistration.
247
+ # p result
248
+ #
249
+ def create_host_project_registration request, options = nil
250
+ raise ::ArgumentError, "request must be provided" if request.nil?
251
+
252
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest
253
+
254
+ # Converts hash and nil to an options object
255
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
256
+
257
+ # Customize the options with defaults
258
+ metadata = @config.rpcs.create_host_project_registration.metadata.to_h
259
+
260
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
261
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
262
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
263
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
264
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
265
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
266
+
267
+ header_params = {}
268
+ if request.parent
269
+ header_params["parent"] = request.parent
270
+ end
271
+
272
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
273
+ metadata[:"x-goog-request-params"] ||= request_params_header
274
+
275
+ options.apply_defaults timeout: @config.rpcs.create_host_project_registration.timeout,
276
+ metadata: metadata,
277
+ retry_policy: @config.rpcs.create_host_project_registration.retry_policy
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
281
+ retry_policy: @config.retry_policy
282
+
283
+ @host_project_registration_service_stub.call_rpc :create_host_project_registration, request, options: options do |response, operation|
284
+ yield response, operation if block_given?
285
+ return response
286
+ end
287
+ rescue ::GRPC::BadStatus => e
288
+ raise ::Google::Cloud::Error.from_error(e)
289
+ end
290
+
291
+ ##
292
+ # Get a host project registration.
293
+ #
294
+ # @overload get_host_project_registration(request, options = nil)
295
+ # Pass arguments to `get_host_project_registration` via a request object, either of type
296
+ # {::Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [::Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest, ::Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [::Gapic::CallOptions, ::Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
303
+ #
304
+ # @overload get_host_project_registration(name: nil)
305
+ # Pass arguments to `get_host_project_registration` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param name [::String]
310
+ # Required. Host project registration resource name.
311
+ # projects/\\{project}/locations/\\{location}/hostProjectRegistrations/\\{host_project_registration_id}
312
+ #
313
+ # @yield [response, operation] Access the result along with the RPC operation
314
+ # @yieldparam response [::Google::Cloud::ApiHub::V1::HostProjectRegistration]
315
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
316
+ #
317
+ # @return [::Google::Cloud::ApiHub::V1::HostProjectRegistration]
318
+ #
319
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
320
+ #
321
+ # @example Basic example
322
+ # require "google/cloud/api_hub/v1"
323
+ #
324
+ # # Create a client object. The client can be reused for multiple calls.
325
+ # client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new
326
+ #
327
+ # # Create a request. To set request fields, pass in keyword arguments.
328
+ # request = Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest.new
329
+ #
330
+ # # Call the get_host_project_registration method.
331
+ # result = client.get_host_project_registration request
332
+ #
333
+ # # The returned object is of type Google::Cloud::ApiHub::V1::HostProjectRegistration.
334
+ # p result
335
+ #
336
+ def get_host_project_registration request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ metadata = @config.rpcs.get_host_project_registration.metadata.to_h
346
+
347
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
348
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
351
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ header_params = {}
355
+ if request.name
356
+ header_params["name"] = request.name
357
+ end
358
+
359
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
360
+ metadata[:"x-goog-request-params"] ||= request_params_header
361
+
362
+ options.apply_defaults timeout: @config.rpcs.get_host_project_registration.timeout,
363
+ metadata: metadata,
364
+ retry_policy: @config.rpcs.get_host_project_registration.retry_policy
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
368
+ retry_policy: @config.retry_policy
369
+
370
+ @host_project_registration_service_stub.call_rpc :get_host_project_registration, request, options: options do |response, operation|
371
+ yield response, operation if block_given?
372
+ return response
373
+ end
374
+ rescue ::GRPC::BadStatus => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Lists host project registrations.
380
+ #
381
+ # @overload list_host_project_registrations(request, options = nil)
382
+ # Pass arguments to `list_host_project_registrations` via a request object, either of type
383
+ # {::Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest} or an equivalent Hash.
384
+ #
385
+ # @param request [::Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest, ::Hash]
386
+ # A request object representing the call parameters. Required. To specify no
387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
388
+ # @param options [::Gapic::CallOptions, ::Hash]
389
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
390
+ #
391
+ # @overload list_host_project_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
392
+ # Pass arguments to `list_host_project_registrations` via keyword arguments. Note that at
393
+ # least one keyword argument is required. To specify no parameters, or to keep all
394
+ # the default parameter values, pass an empty Hash as a request object (see above).
395
+ #
396
+ # @param parent [::String]
397
+ # Required. The parent, which owns this collection of host projects.
398
+ # Format: `projects/*/locations/*`
399
+ # @param page_size [::Integer]
400
+ # Optional. The maximum number of host project registrations to return. The
401
+ # service may return fewer than this value. If unspecified, at most 50 host
402
+ # project registrations will be returned. The maximum value is 1000; values
403
+ # above 1000 will be coerced to 1000.
404
+ # @param page_token [::String]
405
+ # Optional. A page token, received from a previous
406
+ # `ListHostProjectRegistrations` call. Provide this to retrieve the
407
+ # subsequent page.
408
+ #
409
+ # When paginating, all other parameters (except page_size) provided to
410
+ # `ListHostProjectRegistrations` must match the call that provided the page
411
+ # token.
412
+ # @param filter [::String]
413
+ # Optional. An expression that filters the list of HostProjectRegistrations.
414
+ #
415
+ # A filter expression consists of a field name, a comparison
416
+ # operator, and a value for filtering. The value must be a string. All
417
+ # standard operators as documented at https://google.aip.dev/160 are
418
+ # supported.
419
+ #
420
+ # The following fields in the `HostProjectRegistration` are eligible for
421
+ # filtering:
422
+ #
423
+ # * `name` - The name of the HostProjectRegistration.
424
+ # * `create_time` - The time at which the HostProjectRegistration was
425
+ # created. The value should be in the
426
+ # (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
427
+ # * `gcp_project` - The Google cloud project associated with the
428
+ # HostProjectRegistration.
429
+ # @param order_by [::String]
430
+ # Optional. Hint for how to order the results.
431
+ #
432
+ # @yield [response, operation] Access the result along with the RPC operation
433
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>]
434
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
435
+ #
436
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>]
437
+ #
438
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
439
+ #
440
+ # @example Basic example
441
+ # require "google/cloud/api_hub/v1"
442
+ #
443
+ # # Create a client object. The client can be reused for multiple calls.
444
+ # client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new
445
+ #
446
+ # # Create a request. To set request fields, pass in keyword arguments.
447
+ # request = Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest.new
448
+ #
449
+ # # Call the list_host_project_registrations method.
450
+ # result = client.list_host_project_registrations request
451
+ #
452
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
453
+ # # over elements, and API calls will be issued to fetch pages as needed.
454
+ # result.each do |item|
455
+ # # Each element is of type ::Google::Cloud::ApiHub::V1::HostProjectRegistration.
456
+ # p item
457
+ # end
458
+ #
459
+ def list_host_project_registrations request, options = nil
460
+ raise ::ArgumentError, "request must be provided" if request.nil?
461
+
462
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest
463
+
464
+ # Converts hash and nil to an options object
465
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
466
+
467
+ # Customize the options with defaults
468
+ metadata = @config.rpcs.list_host_project_registrations.metadata.to_h
469
+
470
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
471
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
472
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
473
+ gapic_version: ::Google::Cloud::ApiHub::V1::VERSION
474
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
475
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
476
+
477
+ header_params = {}
478
+ if request.parent
479
+ header_params["parent"] = request.parent
480
+ end
481
+
482
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
483
+ metadata[:"x-goog-request-params"] ||= request_params_header
484
+
485
+ options.apply_defaults timeout: @config.rpcs.list_host_project_registrations.timeout,
486
+ metadata: metadata,
487
+ retry_policy: @config.rpcs.list_host_project_registrations.retry_policy
488
+
489
+ options.apply_defaults timeout: @config.timeout,
490
+ metadata: @config.metadata,
491
+ retry_policy: @config.retry_policy
492
+
493
+ @host_project_registration_service_stub.call_rpc :list_host_project_registrations, request, options: options do |response, operation|
494
+ response = ::Gapic::PagedEnumerable.new @host_project_registration_service_stub, :list_host_project_registrations, request, response, operation, options
495
+ yield response, operation if block_given?
496
+ return response
497
+ end
498
+ rescue ::GRPC::BadStatus => e
499
+ raise ::Google::Cloud::Error.from_error(e)
500
+ end
501
+
502
+ ##
503
+ # Configuration class for the HostProjectRegistrationService API.
504
+ #
505
+ # This class represents the configuration for HostProjectRegistrationService,
506
+ # providing control over timeouts, retry behavior, logging, transport
507
+ # parameters, and other low-level controls. Certain parameters can also be
508
+ # applied individually to specific RPCs. See
509
+ # {::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client::Configuration::Rpcs}
510
+ # for a list of RPCs that can be configured independently.
511
+ #
512
+ # Configuration can be applied globally to all clients, or to a single client
513
+ # on construction.
514
+ #
515
+ # @example
516
+ #
517
+ # # Modify the global config, setting the timeout for
518
+ # # create_host_project_registration to 20 seconds,
519
+ # # and all remaining timeouts to 10 seconds.
520
+ # ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.configure do |config|
521
+ # config.timeout = 10.0
522
+ # config.rpcs.create_host_project_registration.timeout = 20.0
523
+ # end
524
+ #
525
+ # # Apply the above configuration only to a new client.
526
+ # client = ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new do |config|
527
+ # config.timeout = 10.0
528
+ # config.rpcs.create_host_project_registration.timeout = 20.0
529
+ # end
530
+ #
531
+ # @!attribute [rw] endpoint
532
+ # A custom service endpoint, as a hostname or hostname:port. The default is
533
+ # nil, indicating to use the default endpoint in the current universe domain.
534
+ # @return [::String,nil]
535
+ # @!attribute [rw] credentials
536
+ # Credentials to send with calls. You may provide any of the following types:
537
+ # * (`String`) The path to a service account key file in JSON format
538
+ # * (`Hash`) A service account key as a Hash
539
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
540
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
541
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
542
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
543
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
544
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
545
+ # * (`nil`) indicating no credentials
546
+ # @return [::Object]
547
+ # @!attribute [rw] scope
548
+ # The OAuth scopes
549
+ # @return [::Array<::String>]
550
+ # @!attribute [rw] lib_name
551
+ # The library name as recorded in instrumentation and logging
552
+ # @return [::String]
553
+ # @!attribute [rw] lib_version
554
+ # The library version as recorded in instrumentation and logging
555
+ # @return [::String]
556
+ # @!attribute [rw] channel_args
557
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
558
+ # `GRPC::Core::Channel` object is provided as the credential.
559
+ # @return [::Hash]
560
+ # @!attribute [rw] interceptors
561
+ # An array of interceptors that are run before calls are executed.
562
+ # @return [::Array<::GRPC::ClientInterceptor>]
563
+ # @!attribute [rw] timeout
564
+ # The call timeout in seconds.
565
+ # @return [::Numeric]
566
+ # @!attribute [rw] metadata
567
+ # Additional gRPC headers to be sent with the call.
568
+ # @return [::Hash{::Symbol=>::String}]
569
+ # @!attribute [rw] retry_policy
570
+ # The retry policy. The value is a hash with the following keys:
571
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
572
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
573
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
574
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
575
+ # trigger a retry.
576
+ # @return [::Hash]
577
+ # @!attribute [rw] quota_project
578
+ # A separate project against which to charge quota.
579
+ # @return [::String]
580
+ # @!attribute [rw] universe_domain
581
+ # The universe domain within which to make requests. This determines the
582
+ # default endpoint URL. The default value of nil uses the environment
583
+ # universe (usually the default "googleapis.com" universe).
584
+ # @return [::String,nil]
585
+ #
586
+ class Configuration
587
+ extend ::Gapic::Config
588
+
589
+ # @private
590
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
591
+ DEFAULT_ENDPOINT = "apihub.googleapis.com"
592
+
593
+ config_attr :endpoint, nil, ::String, nil
594
+ config_attr :credentials, nil do |value|
595
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
596
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
597
+ allowed.any? { |klass| klass === value }
598
+ end
599
+ config_attr :scope, nil, ::String, ::Array, nil
600
+ config_attr :lib_name, nil, ::String, nil
601
+ config_attr :lib_version, nil, ::String, nil
602
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
603
+ config_attr :interceptors, nil, ::Array, nil
604
+ config_attr :timeout, nil, ::Numeric, nil
605
+ config_attr :metadata, nil, ::Hash, nil
606
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
607
+ config_attr :quota_project, nil, ::String, nil
608
+ config_attr :universe_domain, nil, ::String, nil
609
+
610
+ # @private
611
+ def initialize parent_config = nil
612
+ @parent_config = parent_config unless parent_config.nil?
613
+
614
+ yield self if block_given?
615
+ end
616
+
617
+ ##
618
+ # Configurations for individual RPCs
619
+ # @return [Rpcs]
620
+ #
621
+ def rpcs
622
+ @rpcs ||= begin
623
+ parent_rpcs = nil
624
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
625
+ Rpcs.new parent_rpcs
626
+ end
627
+ end
628
+
629
+ ##
630
+ # Configuration for the channel pool
631
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
632
+ #
633
+ def channel_pool
634
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
635
+ end
636
+
637
+ ##
638
+ # Configuration RPC class for the HostProjectRegistrationService API.
639
+ #
640
+ # Includes fields providing the configuration for each RPC in this service.
641
+ # Each configuration object is of type `Gapic::Config::Method` and includes
642
+ # the following configuration fields:
643
+ #
644
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
645
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
646
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
647
+ # include the following keys:
648
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
649
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
650
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
651
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
652
+ # trigger a retry.
653
+ #
654
+ class Rpcs
655
+ ##
656
+ # RPC-specific configuration for `create_host_project_registration`
657
+ # @return [::Gapic::Config::Method]
658
+ #
659
+ attr_reader :create_host_project_registration
660
+ ##
661
+ # RPC-specific configuration for `get_host_project_registration`
662
+ # @return [::Gapic::Config::Method]
663
+ #
664
+ attr_reader :get_host_project_registration
665
+ ##
666
+ # RPC-specific configuration for `list_host_project_registrations`
667
+ # @return [::Gapic::Config::Method]
668
+ #
669
+ attr_reader :list_host_project_registrations
670
+
671
+ # @private
672
+ def initialize parent_rpcs = nil
673
+ create_host_project_registration_config = parent_rpcs.create_host_project_registration if parent_rpcs.respond_to? :create_host_project_registration
674
+ @create_host_project_registration = ::Gapic::Config::Method.new create_host_project_registration_config
675
+ get_host_project_registration_config = parent_rpcs.get_host_project_registration if parent_rpcs.respond_to? :get_host_project_registration
676
+ @get_host_project_registration = ::Gapic::Config::Method.new get_host_project_registration_config
677
+ list_host_project_registrations_config = parent_rpcs.list_host_project_registrations if parent_rpcs.respond_to? :list_host_project_registrations
678
+ @list_host_project_registrations = ::Gapic::Config::Method.new list_host_project_registrations_config
679
+
680
+ yield self if block_given?
681
+ end
682
+ end
683
+ end
684
+ end
685
+ end
686
+ end
687
+ end
688
+ end
689
+ end