google-cloud-ids-v1 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +3 -3
- data/lib/google/cloud/ids/v1/ids/client.rb +18 -18
- data/lib/google/cloud/ids/v1/ids/operations.rb +17 -17
- data/lib/google/cloud/ids/v1/ids/rest/client.rb +635 -0
- data/lib/google/cloud/ids/v1/ids/rest/operations.rb +795 -0
- data/lib/google/cloud/ids/v1/ids/rest/service_stub.rb +285 -0
- data/lib/google/cloud/ids/v1/ids/rest.rb +53 -0
- data/lib/google/cloud/ids/v1/ids.rb +7 -1
- data/lib/google/cloud/ids/v1/ids_pb.rb +25 -63
- data/lib/google/cloud/ids/v1/rest.rb +37 -0
- data/lib/google/cloud/ids/v1/version.rb +1 -1
- data/lib/google/cloud/ids/v1.rb +7 -2
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +18 -9
- data/proto_docs/google/protobuf/field_mask.rb +0 -229
@@ -0,0 +1,635 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/ids/v1/ids_pb"
|
21
|
+
require "google/cloud/ids/v1/ids/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module IDS
|
26
|
+
module V1
|
27
|
+
module IDS
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the IDS service.
|
31
|
+
#
|
32
|
+
# The IDS Service
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :ids_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the IDS Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::IDS::V1::IDS::Rest::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all IDS clients
|
49
|
+
# ::Google::Cloud::IDS::V1::IDS::Rest::Client.configure do |config|
|
50
|
+
# config.timeout = 10.0
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @yield [config] Configure the Client client.
|
54
|
+
# @yieldparam config [Client::Configuration]
|
55
|
+
#
|
56
|
+
# @return [Client::Configuration]
|
57
|
+
#
|
58
|
+
def self.configure
|
59
|
+
@configure ||= begin
|
60
|
+
namespace = ["Google", "Cloud", "IDS", "V1"]
|
61
|
+
parent_config = while namespace.any?
|
62
|
+
parent_name = namespace.join "::"
|
63
|
+
parent_const = const_get parent_name
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
|
+
namespace.pop
|
66
|
+
end
|
67
|
+
default_config = Client::Configuration.new parent_config
|
68
|
+
|
69
|
+
default_config.rpcs.list_endpoints.timeout = 60.0
|
70
|
+
default_config.rpcs.list_endpoints.retry_policy = {
|
71
|
+
initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14]
|
72
|
+
}
|
73
|
+
|
74
|
+
default_config.rpcs.get_endpoint.timeout = 60.0
|
75
|
+
default_config.rpcs.get_endpoint.retry_policy = {
|
76
|
+
initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14]
|
77
|
+
}
|
78
|
+
|
79
|
+
default_config.rpcs.create_endpoint.timeout = 3600.0
|
80
|
+
|
81
|
+
default_config.rpcs.delete_endpoint.timeout = 3600.0
|
82
|
+
|
83
|
+
default_config
|
84
|
+
end
|
85
|
+
yield @configure if block_given?
|
86
|
+
@configure
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Configure the IDS Client instance.
|
91
|
+
#
|
92
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
93
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
94
|
+
# should be made on {Client.configure}.
|
95
|
+
#
|
96
|
+
# See {::Google::Cloud::IDS::V1::IDS::Rest::Client::Configuration}
|
97
|
+
# for a description of the configuration fields.
|
98
|
+
#
|
99
|
+
# @yield [config] Configure the Client client.
|
100
|
+
# @yieldparam config [Client::Configuration]
|
101
|
+
#
|
102
|
+
# @return [Client::Configuration]
|
103
|
+
#
|
104
|
+
def configure
|
105
|
+
yield @config if block_given?
|
106
|
+
@config
|
107
|
+
end
|
108
|
+
|
109
|
+
##
|
110
|
+
# Create a new IDS REST client object.
|
111
|
+
#
|
112
|
+
# @example
|
113
|
+
#
|
114
|
+
# # Create a client using the default configuration
|
115
|
+
# client = ::Google::Cloud::IDS::V1::IDS::Rest::Client.new
|
116
|
+
#
|
117
|
+
# # Create a client using a custom configuration
|
118
|
+
# client = ::Google::Cloud::IDS::V1::IDS::Rest::Client.new do |config|
|
119
|
+
# config.timeout = 10.0
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# @yield [config] Configure the IDS client.
|
123
|
+
# @yieldparam config [Client::Configuration]
|
124
|
+
#
|
125
|
+
def initialize
|
126
|
+
# Create the configuration object
|
127
|
+
@config = Configuration.new Client.configure
|
128
|
+
|
129
|
+
# Yield the configuration if needed
|
130
|
+
yield @config if block_given?
|
131
|
+
|
132
|
+
# Create credentials
|
133
|
+
credentials = @config.credentials
|
134
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
135
|
+
# but only if the default endpoint does not have a region prefix.
|
136
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
137
|
+
!@config.endpoint.split(".").first.include?("-")
|
138
|
+
credentials ||= Credentials.default scope: @config.scope,
|
139
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
140
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
141
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
142
|
+
end
|
143
|
+
|
144
|
+
@quota_project_id = @config.quota_project
|
145
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
146
|
+
|
147
|
+
@operations_client = ::Google::Cloud::IDS::V1::IDS::Rest::Operations.new do |config|
|
148
|
+
config.credentials = credentials
|
149
|
+
config.quota_project = @quota_project_id
|
150
|
+
config.endpoint = @config.endpoint
|
151
|
+
end
|
152
|
+
|
153
|
+
@ids_stub = ::Google::Cloud::IDS::V1::IDS::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Get the associated client for long-running operations.
|
158
|
+
#
|
159
|
+
# @return [::Google::Cloud::IDS::V1::IDS::Rest::Operations]
|
160
|
+
#
|
161
|
+
attr_reader :operations_client
|
162
|
+
|
163
|
+
# Service calls
|
164
|
+
|
165
|
+
##
|
166
|
+
# Lists Endpoints in a given project and location.
|
167
|
+
#
|
168
|
+
# @overload list_endpoints(request, options = nil)
|
169
|
+
# Pass arguments to `list_endpoints` via a request object, either of type
|
170
|
+
# {::Google::Cloud::IDS::V1::ListEndpointsRequest} or an equivalent Hash.
|
171
|
+
#
|
172
|
+
# @param request [::Google::Cloud::IDS::V1::ListEndpointsRequest, ::Hash]
|
173
|
+
# A request object representing the call parameters. Required. To specify no
|
174
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
175
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
176
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
177
|
+
#
|
178
|
+
# @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
179
|
+
# Pass arguments to `list_endpoints` via keyword arguments. Note that at
|
180
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
181
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
182
|
+
#
|
183
|
+
# @param parent [::String]
|
184
|
+
# Required. The parent, which owns this collection of endpoints.
|
185
|
+
# @param page_size [::Integer]
|
186
|
+
# Optional. The maximum number of endpoints to return. The service may return fewer
|
187
|
+
# than this value.
|
188
|
+
# @param page_token [::String]
|
189
|
+
# Optional. A page token, received from a previous `ListEndpoints` call.
|
190
|
+
# Provide this to retrieve the subsequent page.
|
191
|
+
#
|
192
|
+
# When paginating, all other parameters provided to `ListEndpoints` must
|
193
|
+
# match the call that provided the page token.
|
194
|
+
# @param filter [::String]
|
195
|
+
# Optional. The filter expression, following the syntax outlined in
|
196
|
+
# https://google.aip.dev/160.
|
197
|
+
# @param order_by [::String]
|
198
|
+
# Optional. One or more fields to compare and use to sort the output.
|
199
|
+
# See https://google.aip.dev/132#ordering.
|
200
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
201
|
+
# @yieldparam result [::Google::Cloud::IDS::V1::ListEndpointsResponse]
|
202
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
203
|
+
#
|
204
|
+
# @return [::Google::Cloud::IDS::V1::ListEndpointsResponse]
|
205
|
+
#
|
206
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
207
|
+
def list_endpoints request, options = nil
|
208
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
209
|
+
|
210
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::IDS::V1::ListEndpointsRequest
|
211
|
+
|
212
|
+
# Converts hash and nil to an options object
|
213
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
214
|
+
|
215
|
+
# Customize the options with defaults
|
216
|
+
call_metadata = @config.rpcs.list_endpoints.metadata.to_h
|
217
|
+
|
218
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
219
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
220
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
221
|
+
gapic_version: ::Google::Cloud::IDS::V1::VERSION,
|
222
|
+
transports_version_send: [:rest]
|
223
|
+
|
224
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
225
|
+
|
226
|
+
options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout,
|
227
|
+
metadata: call_metadata,
|
228
|
+
retry_policy: @config.rpcs.list_endpoints.retry_policy
|
229
|
+
|
230
|
+
options.apply_defaults timeout: @config.timeout,
|
231
|
+
metadata: @config.metadata,
|
232
|
+
retry_policy: @config.retry_policy
|
233
|
+
|
234
|
+
@ids_stub.list_endpoints request, options do |result, operation|
|
235
|
+
yield result, operation if block_given?
|
236
|
+
return result
|
237
|
+
end
|
238
|
+
rescue ::Gapic::Rest::Error => e
|
239
|
+
raise ::Google::Cloud::Error.from_error(e)
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# Gets details of a single Endpoint.
|
244
|
+
#
|
245
|
+
# @overload get_endpoint(request, options = nil)
|
246
|
+
# Pass arguments to `get_endpoint` via a request object, either of type
|
247
|
+
# {::Google::Cloud::IDS::V1::GetEndpointRequest} or an equivalent Hash.
|
248
|
+
#
|
249
|
+
# @param request [::Google::Cloud::IDS::V1::GetEndpointRequest, ::Hash]
|
250
|
+
# A request object representing the call parameters. Required. To specify no
|
251
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
252
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
253
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
254
|
+
#
|
255
|
+
# @overload get_endpoint(name: nil)
|
256
|
+
# Pass arguments to `get_endpoint` via keyword arguments. Note that at
|
257
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
258
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
259
|
+
#
|
260
|
+
# @param name [::String]
|
261
|
+
# Required. The name of the endpoint to retrieve.
|
262
|
+
# Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
263
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
264
|
+
# @yieldparam result [::Google::Cloud::IDS::V1::Endpoint]
|
265
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
266
|
+
#
|
267
|
+
# @return [::Google::Cloud::IDS::V1::Endpoint]
|
268
|
+
#
|
269
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
270
|
+
def get_endpoint request, options = nil
|
271
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
|
+
|
273
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::IDS::V1::GetEndpointRequest
|
274
|
+
|
275
|
+
# Converts hash and nil to an options object
|
276
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
277
|
+
|
278
|
+
# Customize the options with defaults
|
279
|
+
call_metadata = @config.rpcs.get_endpoint.metadata.to_h
|
280
|
+
|
281
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
282
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
283
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
284
|
+
gapic_version: ::Google::Cloud::IDS::V1::VERSION,
|
285
|
+
transports_version_send: [:rest]
|
286
|
+
|
287
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
288
|
+
|
289
|
+
options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout,
|
290
|
+
metadata: call_metadata,
|
291
|
+
retry_policy: @config.rpcs.get_endpoint.retry_policy
|
292
|
+
|
293
|
+
options.apply_defaults timeout: @config.timeout,
|
294
|
+
metadata: @config.metadata,
|
295
|
+
retry_policy: @config.retry_policy
|
296
|
+
|
297
|
+
@ids_stub.get_endpoint request, options do |result, operation|
|
298
|
+
yield result, operation if block_given?
|
299
|
+
return result
|
300
|
+
end
|
301
|
+
rescue ::Gapic::Rest::Error => e
|
302
|
+
raise ::Google::Cloud::Error.from_error(e)
|
303
|
+
end
|
304
|
+
|
305
|
+
##
|
306
|
+
# Creates a new Endpoint in a given project and location.
|
307
|
+
#
|
308
|
+
# @overload create_endpoint(request, options = nil)
|
309
|
+
# Pass arguments to `create_endpoint` via a request object, either of type
|
310
|
+
# {::Google::Cloud::IDS::V1::CreateEndpointRequest} or an equivalent Hash.
|
311
|
+
#
|
312
|
+
# @param request [::Google::Cloud::IDS::V1::CreateEndpointRequest, ::Hash]
|
313
|
+
# A request object representing the call parameters. Required. To specify no
|
314
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
315
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
316
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
317
|
+
#
|
318
|
+
# @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil, request_id: nil)
|
319
|
+
# Pass arguments to `create_endpoint` via keyword arguments. Note that at
|
320
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
321
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
322
|
+
#
|
323
|
+
# @param parent [::String]
|
324
|
+
# Required. The endpoint's parent.
|
325
|
+
# @param endpoint_id [::String]
|
326
|
+
# Required. The endpoint identifier. This will be part of the endpoint's
|
327
|
+
# resource name.
|
328
|
+
# This value must start with a lowercase letter followed by up to 62
|
329
|
+
# lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
|
330
|
+
# Values that do not match this pattern will trigger an INVALID_ARGUMENT
|
331
|
+
# error.
|
332
|
+
# @param endpoint [::Google::Cloud::IDS::V1::Endpoint, ::Hash]
|
333
|
+
# Required. The endpoint to create.
|
334
|
+
# @param request_id [::String]
|
335
|
+
# An optional request ID to identify requests. Specify a unique request ID
|
336
|
+
# so that if you must retry your request, the server will know to ignore
|
337
|
+
# the request if it has already been completed. The server will guarantee
|
338
|
+
# that for at least 60 minutes since the first request.
|
339
|
+
#
|
340
|
+
# For example, consider a situation where you make an initial request and t
|
341
|
+
# he request times out. If you make the request again with the same request
|
342
|
+
# ID, the server can check if original operation with the same request ID
|
343
|
+
# was received, and if so, will ignore the second request. This prevents
|
344
|
+
# clients from accidentally creating duplicate commitments.
|
345
|
+
#
|
346
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
347
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
348
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
349
|
+
# @yieldparam result [::Gapic::Operation]
|
350
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
351
|
+
#
|
352
|
+
# @return [::Gapic::Operation]
|
353
|
+
#
|
354
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
355
|
+
def create_endpoint request, options = nil
|
356
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
357
|
+
|
358
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::IDS::V1::CreateEndpointRequest
|
359
|
+
|
360
|
+
# Converts hash and nil to an options object
|
361
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
362
|
+
|
363
|
+
# Customize the options with defaults
|
364
|
+
call_metadata = @config.rpcs.create_endpoint.metadata.to_h
|
365
|
+
|
366
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
367
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
368
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
369
|
+
gapic_version: ::Google::Cloud::IDS::V1::VERSION,
|
370
|
+
transports_version_send: [:rest]
|
371
|
+
|
372
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
373
|
+
|
374
|
+
options.apply_defaults timeout: @config.rpcs.create_endpoint.timeout,
|
375
|
+
metadata: call_metadata,
|
376
|
+
retry_policy: @config.rpcs.create_endpoint.retry_policy
|
377
|
+
|
378
|
+
options.apply_defaults timeout: @config.timeout,
|
379
|
+
metadata: @config.metadata,
|
380
|
+
retry_policy: @config.retry_policy
|
381
|
+
|
382
|
+
@ids_stub.create_endpoint request, options do |result, operation|
|
383
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
384
|
+
yield result, operation if block_given?
|
385
|
+
return result
|
386
|
+
end
|
387
|
+
rescue ::Gapic::Rest::Error => e
|
388
|
+
raise ::Google::Cloud::Error.from_error(e)
|
389
|
+
end
|
390
|
+
|
391
|
+
##
|
392
|
+
# Deletes a single Endpoint.
|
393
|
+
#
|
394
|
+
# @overload delete_endpoint(request, options = nil)
|
395
|
+
# Pass arguments to `delete_endpoint` via a request object, either of type
|
396
|
+
# {::Google::Cloud::IDS::V1::DeleteEndpointRequest} or an equivalent Hash.
|
397
|
+
#
|
398
|
+
# @param request [::Google::Cloud::IDS::V1::DeleteEndpointRequest, ::Hash]
|
399
|
+
# A request object representing the call parameters. Required. To specify no
|
400
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
401
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
402
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
403
|
+
#
|
404
|
+
# @overload delete_endpoint(name: nil, request_id: nil)
|
405
|
+
# Pass arguments to `delete_endpoint` via keyword arguments. Note that at
|
406
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
407
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
408
|
+
#
|
409
|
+
# @param name [::String]
|
410
|
+
# Required. The name of the endpoint to delete.
|
411
|
+
# @param request_id [::String]
|
412
|
+
# An optional request ID to identify requests. Specify a unique request ID
|
413
|
+
# so that if you must retry your request, the server will know to ignore
|
414
|
+
# the request if it has already been completed. The server will guarantee
|
415
|
+
# that for at least 60 minutes after the first request.
|
416
|
+
#
|
417
|
+
# For example, consider a situation where you make an initial request and t
|
418
|
+
# he request times out. If you make the request again with the same request
|
419
|
+
# ID, the server can check if original operation with the same request ID
|
420
|
+
# was received, and if so, will ignore the second request. This prevents
|
421
|
+
# clients from accidentally creating duplicate commitments.
|
422
|
+
#
|
423
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
424
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
425
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
426
|
+
# @yieldparam result [::Gapic::Operation]
|
427
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
428
|
+
#
|
429
|
+
# @return [::Gapic::Operation]
|
430
|
+
#
|
431
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
432
|
+
def delete_endpoint request, options = nil
|
433
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
434
|
+
|
435
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::IDS::V1::DeleteEndpointRequest
|
436
|
+
|
437
|
+
# Converts hash and nil to an options object
|
438
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
439
|
+
|
440
|
+
# Customize the options with defaults
|
441
|
+
call_metadata = @config.rpcs.delete_endpoint.metadata.to_h
|
442
|
+
|
443
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
444
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
445
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
446
|
+
gapic_version: ::Google::Cloud::IDS::V1::VERSION,
|
447
|
+
transports_version_send: [:rest]
|
448
|
+
|
449
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
450
|
+
|
451
|
+
options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout,
|
452
|
+
metadata: call_metadata,
|
453
|
+
retry_policy: @config.rpcs.delete_endpoint.retry_policy
|
454
|
+
|
455
|
+
options.apply_defaults timeout: @config.timeout,
|
456
|
+
metadata: @config.metadata,
|
457
|
+
retry_policy: @config.retry_policy
|
458
|
+
|
459
|
+
@ids_stub.delete_endpoint request, options do |result, operation|
|
460
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
461
|
+
yield result, operation if block_given?
|
462
|
+
return result
|
463
|
+
end
|
464
|
+
rescue ::Gapic::Rest::Error => e
|
465
|
+
raise ::Google::Cloud::Error.from_error(e)
|
466
|
+
end
|
467
|
+
|
468
|
+
##
|
469
|
+
# Configuration class for the IDS REST API.
|
470
|
+
#
|
471
|
+
# This class represents the configuration for IDS REST,
|
472
|
+
# providing control over timeouts, retry behavior, logging, transport
|
473
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
474
|
+
# applied individually to specific RPCs. See
|
475
|
+
# {::Google::Cloud::IDS::V1::IDS::Rest::Client::Configuration::Rpcs}
|
476
|
+
# for a list of RPCs that can be configured independently.
|
477
|
+
#
|
478
|
+
# Configuration can be applied globally to all clients, or to a single client
|
479
|
+
# on construction.
|
480
|
+
#
|
481
|
+
# @example
|
482
|
+
#
|
483
|
+
# # Modify the global config, setting the timeout for
|
484
|
+
# # list_endpoints to 20 seconds,
|
485
|
+
# # and all remaining timeouts to 10 seconds.
|
486
|
+
# ::Google::Cloud::IDS::V1::IDS::Rest::Client.configure do |config|
|
487
|
+
# config.timeout = 10.0
|
488
|
+
# config.rpcs.list_endpoints.timeout = 20.0
|
489
|
+
# end
|
490
|
+
#
|
491
|
+
# # Apply the above configuration only to a new client.
|
492
|
+
# client = ::Google::Cloud::IDS::V1::IDS::Rest::Client.new do |config|
|
493
|
+
# config.timeout = 10.0
|
494
|
+
# config.rpcs.list_endpoints.timeout = 20.0
|
495
|
+
# end
|
496
|
+
#
|
497
|
+
# @!attribute [rw] endpoint
|
498
|
+
# The hostname or hostname:port of the service endpoint.
|
499
|
+
# Defaults to `"ids.googleapis.com"`.
|
500
|
+
# @return [::String]
|
501
|
+
# @!attribute [rw] credentials
|
502
|
+
# Credentials to send with calls. You may provide any of the following types:
|
503
|
+
# * (`String`) The path to a service account key file in JSON format
|
504
|
+
# * (`Hash`) A service account key as a Hash
|
505
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
506
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
507
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
508
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
509
|
+
# * (`nil`) indicating no credentials
|
510
|
+
# @return [::Object]
|
511
|
+
# @!attribute [rw] scope
|
512
|
+
# The OAuth scopes
|
513
|
+
# @return [::Array<::String>]
|
514
|
+
# @!attribute [rw] lib_name
|
515
|
+
# The library name as recorded in instrumentation and logging
|
516
|
+
# @return [::String]
|
517
|
+
# @!attribute [rw] lib_version
|
518
|
+
# The library version as recorded in instrumentation and logging
|
519
|
+
# @return [::String]
|
520
|
+
# @!attribute [rw] timeout
|
521
|
+
# The call timeout in seconds.
|
522
|
+
# @return [::Numeric]
|
523
|
+
# @!attribute [rw] metadata
|
524
|
+
# Additional headers to be sent with the call.
|
525
|
+
# @return [::Hash{::Symbol=>::String}]
|
526
|
+
# @!attribute [rw] retry_policy
|
527
|
+
# The retry policy. The value is a hash with the following keys:
|
528
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
529
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
530
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
531
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
532
|
+
# trigger a retry.
|
533
|
+
# @return [::Hash]
|
534
|
+
# @!attribute [rw] quota_project
|
535
|
+
# A separate project against which to charge quota.
|
536
|
+
# @return [::String]
|
537
|
+
#
|
538
|
+
class Configuration
|
539
|
+
extend ::Gapic::Config
|
540
|
+
|
541
|
+
DEFAULT_ENDPOINT = "ids.googleapis.com"
|
542
|
+
|
543
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
544
|
+
config_attr :credentials, nil do |value|
|
545
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
546
|
+
allowed.any? { |klass| klass === value }
|
547
|
+
end
|
548
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
549
|
+
config_attr :lib_name, nil, ::String, nil
|
550
|
+
config_attr :lib_version, nil, ::String, nil
|
551
|
+
config_attr :timeout, nil, ::Numeric, nil
|
552
|
+
config_attr :metadata, nil, ::Hash, nil
|
553
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
554
|
+
config_attr :quota_project, nil, ::String, nil
|
555
|
+
|
556
|
+
# @private
|
557
|
+
def initialize parent_config = nil
|
558
|
+
@parent_config = parent_config unless parent_config.nil?
|
559
|
+
|
560
|
+
yield self if block_given?
|
561
|
+
end
|
562
|
+
|
563
|
+
##
|
564
|
+
# Configurations for individual RPCs
|
565
|
+
# @return [Rpcs]
|
566
|
+
#
|
567
|
+
def rpcs
|
568
|
+
@rpcs ||= begin
|
569
|
+
parent_rpcs = nil
|
570
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
571
|
+
Rpcs.new parent_rpcs
|
572
|
+
end
|
573
|
+
end
|
574
|
+
|
575
|
+
##
|
576
|
+
# Configuration RPC class for the IDS API.
|
577
|
+
#
|
578
|
+
# Includes fields providing the configuration for each RPC in this service.
|
579
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
580
|
+
# the following configuration fields:
|
581
|
+
#
|
582
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
583
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
584
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
585
|
+
# include the following keys:
|
586
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
587
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
588
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
589
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
590
|
+
# trigger a retry.
|
591
|
+
#
|
592
|
+
class Rpcs
|
593
|
+
##
|
594
|
+
# RPC-specific configuration for `list_endpoints`
|
595
|
+
# @return [::Gapic::Config::Method]
|
596
|
+
#
|
597
|
+
attr_reader :list_endpoints
|
598
|
+
##
|
599
|
+
# RPC-specific configuration for `get_endpoint`
|
600
|
+
# @return [::Gapic::Config::Method]
|
601
|
+
#
|
602
|
+
attr_reader :get_endpoint
|
603
|
+
##
|
604
|
+
# RPC-specific configuration for `create_endpoint`
|
605
|
+
# @return [::Gapic::Config::Method]
|
606
|
+
#
|
607
|
+
attr_reader :create_endpoint
|
608
|
+
##
|
609
|
+
# RPC-specific configuration for `delete_endpoint`
|
610
|
+
# @return [::Gapic::Config::Method]
|
611
|
+
#
|
612
|
+
attr_reader :delete_endpoint
|
613
|
+
|
614
|
+
# @private
|
615
|
+
def initialize parent_rpcs = nil
|
616
|
+
list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints
|
617
|
+
@list_endpoints = ::Gapic::Config::Method.new list_endpoints_config
|
618
|
+
get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint
|
619
|
+
@get_endpoint = ::Gapic::Config::Method.new get_endpoint_config
|
620
|
+
create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint
|
621
|
+
@create_endpoint = ::Gapic::Config::Method.new create_endpoint_config
|
622
|
+
delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint
|
623
|
+
@delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config
|
624
|
+
|
625
|
+
yield self if block_given?
|
626
|
+
end
|
627
|
+
end
|
628
|
+
end
|
629
|
+
end
|
630
|
+
end
|
631
|
+
end
|
632
|
+
end
|
633
|
+
end
|
634
|
+
end
|
635
|
+
end
|