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