google-cloud-storage_insights-v1 0.a → 0.1.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/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/storage_insights/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/storage_insights/v1/rest.rb +38 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/client.rb +1055 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb +47 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb +90 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb +872 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb +463 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb +53 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights.rb +55 -0
- data/lib/google/cloud/storage_insights/v1/version.rb +7 -2
- data/lib/google/cloud/storage_insights/v1.rb +45 -0
- data/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb +164 -0
- data/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb +57 -0
- data/lib/google-cloud-storage_insights-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +372 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb +431 -0
- data/proto_docs/google/protobuf/any.rb +141 -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 +129 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/date.rb +53 -0
- data/proto_docs/google/type/datetime.rb +99 -0
- metadata +206 -12
@@ -0,0 +1,1055 @@
|
|
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/storageinsights/v1/storageinsights_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module StorageInsights
|
26
|
+
module V1
|
27
|
+
module StorageInsights
|
28
|
+
##
|
29
|
+
# Client for the StorageInsights service.
|
30
|
+
#
|
31
|
+
# Service describing handlers for resources
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :storage_insights_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the StorageInsights Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all StorageInsights clients
|
48
|
+
# ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "StorageInsights", "V1"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 60.0
|
69
|
+
|
70
|
+
default_config.rpcs.list_report_configs.timeout = 60.0
|
71
|
+
default_config.rpcs.list_report_configs.retry_policy = {
|
72
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
73
|
+
}
|
74
|
+
|
75
|
+
default_config.rpcs.get_report_config.timeout = 60.0
|
76
|
+
default_config.rpcs.get_report_config.retry_policy = {
|
77
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
78
|
+
}
|
79
|
+
|
80
|
+
default_config.rpcs.list_report_details.timeout = 60.0
|
81
|
+
default_config.rpcs.list_report_details.retry_policy = {
|
82
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
83
|
+
}
|
84
|
+
|
85
|
+
default_config.rpcs.get_report_detail.timeout = 60.0
|
86
|
+
default_config.rpcs.get_report_detail.retry_policy = {
|
87
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
88
|
+
}
|
89
|
+
|
90
|
+
default_config
|
91
|
+
end
|
92
|
+
yield @configure if block_given?
|
93
|
+
@configure
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Configure the StorageInsights Client instance.
|
98
|
+
#
|
99
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
100
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
101
|
+
# should be made on {Client.configure}.
|
102
|
+
#
|
103
|
+
# See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration}
|
104
|
+
# for a description of the configuration fields.
|
105
|
+
#
|
106
|
+
# @yield [config] Configure the Client client.
|
107
|
+
# @yieldparam config [Client::Configuration]
|
108
|
+
#
|
109
|
+
# @return [Client::Configuration]
|
110
|
+
#
|
111
|
+
def configure
|
112
|
+
yield @config if block_given?
|
113
|
+
@config
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# Create a new StorageInsights client object.
|
118
|
+
#
|
119
|
+
# @example
|
120
|
+
#
|
121
|
+
# # Create a client using the default configuration
|
122
|
+
# client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
123
|
+
#
|
124
|
+
# # Create a client using a custom configuration
|
125
|
+
# client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config|
|
126
|
+
# config.timeout = 10.0
|
127
|
+
# end
|
128
|
+
#
|
129
|
+
# @yield [config] Configure the StorageInsights client.
|
130
|
+
# @yieldparam config [Client::Configuration]
|
131
|
+
#
|
132
|
+
def initialize
|
133
|
+
# These require statements are intentionally placed here to initialize
|
134
|
+
# the gRPC module only when it's required.
|
135
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
136
|
+
require "gapic/grpc"
|
137
|
+
require "google/cloud/storageinsights/v1/storageinsights_services_pb"
|
138
|
+
|
139
|
+
# Create the configuration object
|
140
|
+
@config = Configuration.new Client.configure
|
141
|
+
|
142
|
+
# Yield the configuration if needed
|
143
|
+
yield @config if block_given?
|
144
|
+
|
145
|
+
# Create credentials
|
146
|
+
credentials = @config.credentials
|
147
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
148
|
+
# but only if the default endpoint does not have a region prefix.
|
149
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
150
|
+
!@config.endpoint.split(".").first.include?("-")
|
151
|
+
credentials ||= Credentials.default scope: @config.scope,
|
152
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
153
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
154
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
155
|
+
end
|
156
|
+
@quota_project_id = @config.quota_project
|
157
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
158
|
+
|
159
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
160
|
+
config.credentials = credentials
|
161
|
+
config.quota_project = @quota_project_id
|
162
|
+
config.endpoint = @config.endpoint
|
163
|
+
end
|
164
|
+
|
165
|
+
@storage_insights_stub = ::Gapic::ServiceStub.new(
|
166
|
+
::Google::Cloud::StorageInsights::V1::StorageInsights::Stub,
|
167
|
+
credentials: credentials,
|
168
|
+
endpoint: @config.endpoint,
|
169
|
+
channel_args: @config.channel_args,
|
170
|
+
interceptors: @config.interceptors
|
171
|
+
)
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# Get the associated client for mix-in of the Locations.
|
176
|
+
#
|
177
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
178
|
+
#
|
179
|
+
attr_reader :location_client
|
180
|
+
|
181
|
+
# Service calls
|
182
|
+
|
183
|
+
##
|
184
|
+
# Lists ReportConfigs in a given project and location.
|
185
|
+
#
|
186
|
+
# @overload list_report_configs(request, options = nil)
|
187
|
+
# Pass arguments to `list_report_configs` via a request object, either of type
|
188
|
+
# {::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest} or an equivalent Hash.
|
189
|
+
#
|
190
|
+
# @param request [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash]
|
191
|
+
# A request object representing the call parameters. Required. To specify no
|
192
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
193
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
194
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
195
|
+
#
|
196
|
+
# @overload list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
197
|
+
# Pass arguments to `list_report_configs` via keyword arguments. Note that at
|
198
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
199
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
200
|
+
#
|
201
|
+
# @param parent [::String]
|
202
|
+
# Required. Parent value for ListReportConfigsRequest
|
203
|
+
# @param page_size [::Integer]
|
204
|
+
# Requested page size. Server may return fewer items than requested.
|
205
|
+
# If unspecified, server will pick an appropriate default.
|
206
|
+
# @param page_token [::String]
|
207
|
+
# A token identifying a page of results the server should return.
|
208
|
+
# @param filter [::String]
|
209
|
+
# Filtering results
|
210
|
+
# @param order_by [::String]
|
211
|
+
# Hint for how to order the results
|
212
|
+
#
|
213
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
214
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>]
|
215
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
216
|
+
#
|
217
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>]
|
218
|
+
#
|
219
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
220
|
+
#
|
221
|
+
# @example Basic example
|
222
|
+
# require "google/cloud/storage_insights/v1"
|
223
|
+
#
|
224
|
+
# # Create a client object. The client can be reused for multiple calls.
|
225
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
226
|
+
#
|
227
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
228
|
+
# request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new
|
229
|
+
#
|
230
|
+
# # Call the list_report_configs method.
|
231
|
+
# result = client.list_report_configs request
|
232
|
+
#
|
233
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
234
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
235
|
+
# result.each do |item|
|
236
|
+
# # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig.
|
237
|
+
# p item
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
def list_report_configs request, options = nil
|
241
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
242
|
+
|
243
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest
|
244
|
+
|
245
|
+
# Converts hash and nil to an options object
|
246
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
247
|
+
|
248
|
+
# Customize the options with defaults
|
249
|
+
metadata = @config.rpcs.list_report_configs.metadata.to_h
|
250
|
+
|
251
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
252
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
253
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
254
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
255
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
256
|
+
|
257
|
+
header_params = {}
|
258
|
+
if request.parent
|
259
|
+
header_params["parent"] = request.parent
|
260
|
+
end
|
261
|
+
|
262
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
263
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
264
|
+
|
265
|
+
options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout,
|
266
|
+
metadata: metadata,
|
267
|
+
retry_policy: @config.rpcs.list_report_configs.retry_policy
|
268
|
+
|
269
|
+
options.apply_defaults timeout: @config.timeout,
|
270
|
+
metadata: @config.metadata,
|
271
|
+
retry_policy: @config.retry_policy
|
272
|
+
|
273
|
+
@storage_insights_stub.call_rpc :list_report_configs, request, options: options do |response, operation|
|
274
|
+
response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_configs, request, response, operation, options
|
275
|
+
yield response, operation if block_given?
|
276
|
+
return response
|
277
|
+
end
|
278
|
+
rescue ::GRPC::BadStatus => e
|
279
|
+
raise ::Google::Cloud::Error.from_error(e)
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# Gets details of a single ReportConfig.
|
284
|
+
#
|
285
|
+
# @overload get_report_config(request, options = nil)
|
286
|
+
# Pass arguments to `get_report_config` via a request object, either of type
|
287
|
+
# {::Google::Cloud::StorageInsights::V1::GetReportConfigRequest} or an equivalent Hash.
|
288
|
+
#
|
289
|
+
# @param request [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash]
|
290
|
+
# A request object representing the call parameters. Required. To specify no
|
291
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
292
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
293
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
294
|
+
#
|
295
|
+
# @overload get_report_config(name: nil)
|
296
|
+
# Pass arguments to `get_report_config` via keyword arguments. Note that at
|
297
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
298
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
299
|
+
#
|
300
|
+
# @param name [::String]
|
301
|
+
# Required. Name of the resource
|
302
|
+
#
|
303
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
304
|
+
# @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
305
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
306
|
+
#
|
307
|
+
# @return [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
308
|
+
#
|
309
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
310
|
+
#
|
311
|
+
# @example Basic example
|
312
|
+
# require "google/cloud/storage_insights/v1"
|
313
|
+
#
|
314
|
+
# # Create a client object. The client can be reused for multiple calls.
|
315
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
316
|
+
#
|
317
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
318
|
+
# request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new
|
319
|
+
#
|
320
|
+
# # Call the get_report_config method.
|
321
|
+
# result = client.get_report_config request
|
322
|
+
#
|
323
|
+
# # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
|
324
|
+
# p result
|
325
|
+
#
|
326
|
+
def get_report_config request, options = nil
|
327
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
328
|
+
|
329
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest
|
330
|
+
|
331
|
+
# Converts hash and nil to an options object
|
332
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
333
|
+
|
334
|
+
# Customize the options with defaults
|
335
|
+
metadata = @config.rpcs.get_report_config.metadata.to_h
|
336
|
+
|
337
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
338
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
339
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
340
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
341
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
342
|
+
|
343
|
+
header_params = {}
|
344
|
+
if request.name
|
345
|
+
header_params["name"] = request.name
|
346
|
+
end
|
347
|
+
|
348
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
349
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
350
|
+
|
351
|
+
options.apply_defaults timeout: @config.rpcs.get_report_config.timeout,
|
352
|
+
metadata: metadata,
|
353
|
+
retry_policy: @config.rpcs.get_report_config.retry_policy
|
354
|
+
|
355
|
+
options.apply_defaults timeout: @config.timeout,
|
356
|
+
metadata: @config.metadata,
|
357
|
+
retry_policy: @config.retry_policy
|
358
|
+
|
359
|
+
@storage_insights_stub.call_rpc :get_report_config, request, options: options do |response, operation|
|
360
|
+
yield response, operation if block_given?
|
361
|
+
return response
|
362
|
+
end
|
363
|
+
rescue ::GRPC::BadStatus => e
|
364
|
+
raise ::Google::Cloud::Error.from_error(e)
|
365
|
+
end
|
366
|
+
|
367
|
+
##
|
368
|
+
# Creates a new ReportConfig in a given project and location.
|
369
|
+
#
|
370
|
+
# @overload create_report_config(request, options = nil)
|
371
|
+
# Pass arguments to `create_report_config` via a request object, either of type
|
372
|
+
# {::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest} or an equivalent Hash.
|
373
|
+
#
|
374
|
+
# @param request [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash]
|
375
|
+
# A request object representing the call parameters. Required. To specify no
|
376
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
377
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
378
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
379
|
+
#
|
380
|
+
# @overload create_report_config(parent: nil, report_config: nil, request_id: nil)
|
381
|
+
# Pass arguments to `create_report_config` via keyword arguments. Note that at
|
382
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
383
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
384
|
+
#
|
385
|
+
# @param parent [::String]
|
386
|
+
# Required. Value for parent.
|
387
|
+
# @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash]
|
388
|
+
# Required. The resource being created
|
389
|
+
# @param request_id [::String]
|
390
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
391
|
+
# request ID so that if you must retry your request, the server will know to
|
392
|
+
# ignore the request if it has already been completed. The server will
|
393
|
+
# guarantee that for at least 60 minutes since the first request.
|
394
|
+
#
|
395
|
+
# For example, consider a situation where you make an initial request and
|
396
|
+
# the request times out. If you make the request again with the same request
|
397
|
+
# ID, the server can check if original operation with the same request ID
|
398
|
+
# was received, and if so, will ignore the second request. This prevents
|
399
|
+
# clients from accidentally creating duplicate commitments.
|
400
|
+
#
|
401
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
402
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
403
|
+
#
|
404
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
405
|
+
# @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
406
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
407
|
+
#
|
408
|
+
# @return [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
409
|
+
#
|
410
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
411
|
+
#
|
412
|
+
# @example Basic example
|
413
|
+
# require "google/cloud/storage_insights/v1"
|
414
|
+
#
|
415
|
+
# # Create a client object. The client can be reused for multiple calls.
|
416
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
417
|
+
#
|
418
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
419
|
+
# request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new
|
420
|
+
#
|
421
|
+
# # Call the create_report_config method.
|
422
|
+
# result = client.create_report_config request
|
423
|
+
#
|
424
|
+
# # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
|
425
|
+
# p result
|
426
|
+
#
|
427
|
+
def create_report_config request, options = nil
|
428
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
429
|
+
|
430
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest
|
431
|
+
|
432
|
+
# Converts hash and nil to an options object
|
433
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
434
|
+
|
435
|
+
# Customize the options with defaults
|
436
|
+
metadata = @config.rpcs.create_report_config.metadata.to_h
|
437
|
+
|
438
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
439
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
440
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
441
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
442
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
443
|
+
|
444
|
+
header_params = {}
|
445
|
+
if request.parent
|
446
|
+
header_params["parent"] = request.parent
|
447
|
+
end
|
448
|
+
|
449
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
450
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
451
|
+
|
452
|
+
options.apply_defaults timeout: @config.rpcs.create_report_config.timeout,
|
453
|
+
metadata: metadata,
|
454
|
+
retry_policy: @config.rpcs.create_report_config.retry_policy
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.timeout,
|
457
|
+
metadata: @config.metadata,
|
458
|
+
retry_policy: @config.retry_policy
|
459
|
+
|
460
|
+
@storage_insights_stub.call_rpc :create_report_config, request, options: options do |response, operation|
|
461
|
+
yield response, operation if block_given?
|
462
|
+
return response
|
463
|
+
end
|
464
|
+
rescue ::GRPC::BadStatus => e
|
465
|
+
raise ::Google::Cloud::Error.from_error(e)
|
466
|
+
end
|
467
|
+
|
468
|
+
##
|
469
|
+
# Updates the parameters of a single ReportConfig.
|
470
|
+
#
|
471
|
+
# @overload update_report_config(request, options = nil)
|
472
|
+
# Pass arguments to `update_report_config` via a request object, either of type
|
473
|
+
# {::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest} or an equivalent Hash.
|
474
|
+
#
|
475
|
+
# @param request [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash]
|
476
|
+
# A request object representing the call parameters. Required. To specify no
|
477
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
478
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
479
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
480
|
+
#
|
481
|
+
# @overload update_report_config(update_mask: nil, report_config: nil, request_id: nil)
|
482
|
+
# Pass arguments to `update_report_config` via keyword arguments. Note that at
|
483
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
484
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
485
|
+
#
|
486
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
487
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
488
|
+
# ReportConfig resource by the update.
|
489
|
+
# The fields specified in the update_mask are relative to the resource, not
|
490
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
491
|
+
# user does not provide a mask then all fields will be overwritten.
|
492
|
+
# @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash]
|
493
|
+
# Required. The resource being updated
|
494
|
+
# @param request_id [::String]
|
495
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
496
|
+
# request ID so that if you must retry your request, the server will know to
|
497
|
+
# ignore the request if it has already been completed. The server will
|
498
|
+
# guarantee that for at least 60 minutes since the first request.
|
499
|
+
#
|
500
|
+
# For example, consider a situation where you make an initial request and
|
501
|
+
# the request times out. If you make the request again with the same request
|
502
|
+
# ID, the server can check if original operation with the same request ID
|
503
|
+
# was received, and if so, will ignore the second request. This prevents
|
504
|
+
# clients from accidentally creating duplicate commitments.
|
505
|
+
#
|
506
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
507
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
508
|
+
#
|
509
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
510
|
+
# @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
511
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
512
|
+
#
|
513
|
+
# @return [::Google::Cloud::StorageInsights::V1::ReportConfig]
|
514
|
+
#
|
515
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
516
|
+
#
|
517
|
+
# @example Basic example
|
518
|
+
# require "google/cloud/storage_insights/v1"
|
519
|
+
#
|
520
|
+
# # Create a client object. The client can be reused for multiple calls.
|
521
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
522
|
+
#
|
523
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
524
|
+
# request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new
|
525
|
+
#
|
526
|
+
# # Call the update_report_config method.
|
527
|
+
# result = client.update_report_config request
|
528
|
+
#
|
529
|
+
# # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
|
530
|
+
# p result
|
531
|
+
#
|
532
|
+
def update_report_config request, options = nil
|
533
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
534
|
+
|
535
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest
|
536
|
+
|
537
|
+
# Converts hash and nil to an options object
|
538
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
539
|
+
|
540
|
+
# Customize the options with defaults
|
541
|
+
metadata = @config.rpcs.update_report_config.metadata.to_h
|
542
|
+
|
543
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
544
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
545
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
546
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
547
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
548
|
+
|
549
|
+
header_params = {}
|
550
|
+
if request.report_config&.name
|
551
|
+
header_params["report_config.name"] = request.report_config.name
|
552
|
+
end
|
553
|
+
|
554
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
555
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
556
|
+
|
557
|
+
options.apply_defaults timeout: @config.rpcs.update_report_config.timeout,
|
558
|
+
metadata: metadata,
|
559
|
+
retry_policy: @config.rpcs.update_report_config.retry_policy
|
560
|
+
|
561
|
+
options.apply_defaults timeout: @config.timeout,
|
562
|
+
metadata: @config.metadata,
|
563
|
+
retry_policy: @config.retry_policy
|
564
|
+
|
565
|
+
@storage_insights_stub.call_rpc :update_report_config, request, options: options do |response, operation|
|
566
|
+
yield response, operation if block_given?
|
567
|
+
return response
|
568
|
+
end
|
569
|
+
rescue ::GRPC::BadStatus => e
|
570
|
+
raise ::Google::Cloud::Error.from_error(e)
|
571
|
+
end
|
572
|
+
|
573
|
+
##
|
574
|
+
# Deletes a single ReportConfig.
|
575
|
+
#
|
576
|
+
# @overload delete_report_config(request, options = nil)
|
577
|
+
# Pass arguments to `delete_report_config` via a request object, either of type
|
578
|
+
# {::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest} or an equivalent Hash.
|
579
|
+
#
|
580
|
+
# @param request [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash]
|
581
|
+
# A request object representing the call parameters. Required. To specify no
|
582
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
583
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
584
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
585
|
+
#
|
586
|
+
# @overload delete_report_config(name: nil, force: nil, request_id: nil)
|
587
|
+
# Pass arguments to `delete_report_config` via keyword arguments. Note that at
|
588
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
589
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
590
|
+
#
|
591
|
+
# @param name [::String]
|
592
|
+
# Required. Name of the resource
|
593
|
+
# @param force [::Boolean]
|
594
|
+
# Optional. If set, all ReportDetails for this ReportConfig will be deleted.
|
595
|
+
# @param request_id [::String]
|
596
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
597
|
+
# request ID so that if you must retry your request, the server will know to
|
598
|
+
# ignore the request if it has already been completed. The server will
|
599
|
+
# guarantee that for at least 60 minutes after the first request.
|
600
|
+
#
|
601
|
+
# For example, consider a situation where you make an initial request and
|
602
|
+
# the request times out. If you make the request again with the same request
|
603
|
+
# ID, the server can check if original operation with the same request ID
|
604
|
+
# was received, and if so, will ignore the second request. This prevents
|
605
|
+
# clients from accidentally creating duplicate commitments.
|
606
|
+
#
|
607
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
608
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
609
|
+
#
|
610
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
611
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
612
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
613
|
+
#
|
614
|
+
# @return [::Google::Protobuf::Empty]
|
615
|
+
#
|
616
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
617
|
+
#
|
618
|
+
# @example Basic example
|
619
|
+
# require "google/cloud/storage_insights/v1"
|
620
|
+
#
|
621
|
+
# # Create a client object. The client can be reused for multiple calls.
|
622
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
623
|
+
#
|
624
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
625
|
+
# request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new
|
626
|
+
#
|
627
|
+
# # Call the delete_report_config method.
|
628
|
+
# result = client.delete_report_config request
|
629
|
+
#
|
630
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
631
|
+
# p result
|
632
|
+
#
|
633
|
+
def delete_report_config request, options = nil
|
634
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
635
|
+
|
636
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest
|
637
|
+
|
638
|
+
# Converts hash and nil to an options object
|
639
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
640
|
+
|
641
|
+
# Customize the options with defaults
|
642
|
+
metadata = @config.rpcs.delete_report_config.metadata.to_h
|
643
|
+
|
644
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
645
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
646
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
647
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
648
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
649
|
+
|
650
|
+
header_params = {}
|
651
|
+
if request.name
|
652
|
+
header_params["name"] = request.name
|
653
|
+
end
|
654
|
+
|
655
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
656
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
657
|
+
|
658
|
+
options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout,
|
659
|
+
metadata: metadata,
|
660
|
+
retry_policy: @config.rpcs.delete_report_config.retry_policy
|
661
|
+
|
662
|
+
options.apply_defaults timeout: @config.timeout,
|
663
|
+
metadata: @config.metadata,
|
664
|
+
retry_policy: @config.retry_policy
|
665
|
+
|
666
|
+
@storage_insights_stub.call_rpc :delete_report_config, request, options: options do |response, operation|
|
667
|
+
yield response, operation if block_given?
|
668
|
+
return response
|
669
|
+
end
|
670
|
+
rescue ::GRPC::BadStatus => e
|
671
|
+
raise ::Google::Cloud::Error.from_error(e)
|
672
|
+
end
|
673
|
+
|
674
|
+
##
|
675
|
+
# Lists ReportDetails in a given project and location.
|
676
|
+
#
|
677
|
+
# @overload list_report_details(request, options = nil)
|
678
|
+
# Pass arguments to `list_report_details` via a request object, either of type
|
679
|
+
# {::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest} or an equivalent Hash.
|
680
|
+
#
|
681
|
+
# @param request [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash]
|
682
|
+
# A request object representing the call parameters. Required. To specify no
|
683
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
684
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
685
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
686
|
+
#
|
687
|
+
# @overload list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
688
|
+
# Pass arguments to `list_report_details` via keyword arguments. Note that at
|
689
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
690
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
691
|
+
#
|
692
|
+
# @param parent [::String]
|
693
|
+
# Required. Parent value for ListReportDetailsRequest
|
694
|
+
# @param page_size [::Integer]
|
695
|
+
# Requested page size. Server may return fewer items than requested.
|
696
|
+
# If unspecified, server will pick an appropriate default.
|
697
|
+
# @param page_token [::String]
|
698
|
+
# A token identifying a page of results the server should return.
|
699
|
+
# @param filter [::String]
|
700
|
+
# Filtering results
|
701
|
+
# @param order_by [::String]
|
702
|
+
# Hint for how to order the results
|
703
|
+
#
|
704
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
705
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>]
|
706
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
707
|
+
#
|
708
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>]
|
709
|
+
#
|
710
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
711
|
+
#
|
712
|
+
# @example Basic example
|
713
|
+
# require "google/cloud/storage_insights/v1"
|
714
|
+
#
|
715
|
+
# # Create a client object. The client can be reused for multiple calls.
|
716
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
717
|
+
#
|
718
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
719
|
+
# request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new
|
720
|
+
#
|
721
|
+
# # Call the list_report_details method.
|
722
|
+
# result = client.list_report_details request
|
723
|
+
#
|
724
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
725
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
726
|
+
# result.each do |item|
|
727
|
+
# # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail.
|
728
|
+
# p item
|
729
|
+
# end
|
730
|
+
#
|
731
|
+
def list_report_details request, options = nil
|
732
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
733
|
+
|
734
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest
|
735
|
+
|
736
|
+
# Converts hash and nil to an options object
|
737
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
738
|
+
|
739
|
+
# Customize the options with defaults
|
740
|
+
metadata = @config.rpcs.list_report_details.metadata.to_h
|
741
|
+
|
742
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
743
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
744
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
745
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
746
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
747
|
+
|
748
|
+
header_params = {}
|
749
|
+
if request.parent
|
750
|
+
header_params["parent"] = request.parent
|
751
|
+
end
|
752
|
+
|
753
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
754
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
755
|
+
|
756
|
+
options.apply_defaults timeout: @config.rpcs.list_report_details.timeout,
|
757
|
+
metadata: metadata,
|
758
|
+
retry_policy: @config.rpcs.list_report_details.retry_policy
|
759
|
+
|
760
|
+
options.apply_defaults timeout: @config.timeout,
|
761
|
+
metadata: @config.metadata,
|
762
|
+
retry_policy: @config.retry_policy
|
763
|
+
|
764
|
+
@storage_insights_stub.call_rpc :list_report_details, request, options: options do |response, operation|
|
765
|
+
response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_details, request, response, operation, options
|
766
|
+
yield response, operation if block_given?
|
767
|
+
return response
|
768
|
+
end
|
769
|
+
rescue ::GRPC::BadStatus => e
|
770
|
+
raise ::Google::Cloud::Error.from_error(e)
|
771
|
+
end
|
772
|
+
|
773
|
+
##
|
774
|
+
# Gets details of a single ReportDetail.
|
775
|
+
#
|
776
|
+
# @overload get_report_detail(request, options = nil)
|
777
|
+
# Pass arguments to `get_report_detail` via a request object, either of type
|
778
|
+
# {::Google::Cloud::StorageInsights::V1::GetReportDetailRequest} or an equivalent Hash.
|
779
|
+
#
|
780
|
+
# @param request [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash]
|
781
|
+
# A request object representing the call parameters. Required. To specify no
|
782
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
783
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
784
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
785
|
+
#
|
786
|
+
# @overload get_report_detail(name: nil)
|
787
|
+
# Pass arguments to `get_report_detail` via keyword arguments. Note that at
|
788
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
789
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
790
|
+
#
|
791
|
+
# @param name [::String]
|
792
|
+
# Required. Name of the resource
|
793
|
+
#
|
794
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
795
|
+
# @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportDetail]
|
796
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
797
|
+
#
|
798
|
+
# @return [::Google::Cloud::StorageInsights::V1::ReportDetail]
|
799
|
+
#
|
800
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
801
|
+
#
|
802
|
+
# @example Basic example
|
803
|
+
# require "google/cloud/storage_insights/v1"
|
804
|
+
#
|
805
|
+
# # Create a client object. The client can be reused for multiple calls.
|
806
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
807
|
+
#
|
808
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
809
|
+
# request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new
|
810
|
+
#
|
811
|
+
# # Call the get_report_detail method.
|
812
|
+
# result = client.get_report_detail request
|
813
|
+
#
|
814
|
+
# # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail.
|
815
|
+
# p result
|
816
|
+
#
|
817
|
+
def get_report_detail request, options = nil
|
818
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
819
|
+
|
820
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest
|
821
|
+
|
822
|
+
# Converts hash and nil to an options object
|
823
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
824
|
+
|
825
|
+
# Customize the options with defaults
|
826
|
+
metadata = @config.rpcs.get_report_detail.metadata.to_h
|
827
|
+
|
828
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
829
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
830
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
831
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
832
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
833
|
+
|
834
|
+
header_params = {}
|
835
|
+
if request.name
|
836
|
+
header_params["name"] = request.name
|
837
|
+
end
|
838
|
+
|
839
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
840
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
841
|
+
|
842
|
+
options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout,
|
843
|
+
metadata: metadata,
|
844
|
+
retry_policy: @config.rpcs.get_report_detail.retry_policy
|
845
|
+
|
846
|
+
options.apply_defaults timeout: @config.timeout,
|
847
|
+
metadata: @config.metadata,
|
848
|
+
retry_policy: @config.retry_policy
|
849
|
+
|
850
|
+
@storage_insights_stub.call_rpc :get_report_detail, request, options: options do |response, operation|
|
851
|
+
yield response, operation if block_given?
|
852
|
+
return response
|
853
|
+
end
|
854
|
+
rescue ::GRPC::BadStatus => e
|
855
|
+
raise ::Google::Cloud::Error.from_error(e)
|
856
|
+
end
|
857
|
+
|
858
|
+
##
|
859
|
+
# Configuration class for the StorageInsights API.
|
860
|
+
#
|
861
|
+
# This class represents the configuration for StorageInsights,
|
862
|
+
# providing control over timeouts, retry behavior, logging, transport
|
863
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
864
|
+
# applied individually to specific RPCs. See
|
865
|
+
# {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration::Rpcs}
|
866
|
+
# for a list of RPCs that can be configured independently.
|
867
|
+
#
|
868
|
+
# Configuration can be applied globally to all clients, or to a single client
|
869
|
+
# on construction.
|
870
|
+
#
|
871
|
+
# @example
|
872
|
+
#
|
873
|
+
# # Modify the global config, setting the timeout for
|
874
|
+
# # list_report_configs to 20 seconds,
|
875
|
+
# # and all remaining timeouts to 10 seconds.
|
876
|
+
# ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config|
|
877
|
+
# config.timeout = 10.0
|
878
|
+
# config.rpcs.list_report_configs.timeout = 20.0
|
879
|
+
# end
|
880
|
+
#
|
881
|
+
# # Apply the above configuration only to a new client.
|
882
|
+
# client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config|
|
883
|
+
# config.timeout = 10.0
|
884
|
+
# config.rpcs.list_report_configs.timeout = 20.0
|
885
|
+
# end
|
886
|
+
#
|
887
|
+
# @!attribute [rw] endpoint
|
888
|
+
# The hostname or hostname:port of the service endpoint.
|
889
|
+
# Defaults to `"storageinsights.googleapis.com"`.
|
890
|
+
# @return [::String]
|
891
|
+
# @!attribute [rw] credentials
|
892
|
+
# Credentials to send with calls. You may provide any of the following types:
|
893
|
+
# * (`String`) The path to a service account key file in JSON format
|
894
|
+
# * (`Hash`) A service account key as a Hash
|
895
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
896
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
897
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
898
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
899
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
900
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
901
|
+
# * (`nil`) indicating no credentials
|
902
|
+
# @return [::Object]
|
903
|
+
# @!attribute [rw] scope
|
904
|
+
# The OAuth scopes
|
905
|
+
# @return [::Array<::String>]
|
906
|
+
# @!attribute [rw] lib_name
|
907
|
+
# The library name as recorded in instrumentation and logging
|
908
|
+
# @return [::String]
|
909
|
+
# @!attribute [rw] lib_version
|
910
|
+
# The library version as recorded in instrumentation and logging
|
911
|
+
# @return [::String]
|
912
|
+
# @!attribute [rw] channel_args
|
913
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
914
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
915
|
+
# @return [::Hash]
|
916
|
+
# @!attribute [rw] interceptors
|
917
|
+
# An array of interceptors that are run before calls are executed.
|
918
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
919
|
+
# @!attribute [rw] timeout
|
920
|
+
# The call timeout in seconds.
|
921
|
+
# @return [::Numeric]
|
922
|
+
# @!attribute [rw] metadata
|
923
|
+
# Additional gRPC headers to be sent with the call.
|
924
|
+
# @return [::Hash{::Symbol=>::String}]
|
925
|
+
# @!attribute [rw] retry_policy
|
926
|
+
# The retry policy. The value is a hash with the following keys:
|
927
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
928
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
929
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
930
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
931
|
+
# trigger a retry.
|
932
|
+
# @return [::Hash]
|
933
|
+
# @!attribute [rw] quota_project
|
934
|
+
# A separate project against which to charge quota.
|
935
|
+
# @return [::String]
|
936
|
+
#
|
937
|
+
class Configuration
|
938
|
+
extend ::Gapic::Config
|
939
|
+
|
940
|
+
config_attr :endpoint, "storageinsights.googleapis.com", ::String
|
941
|
+
config_attr :credentials, nil do |value|
|
942
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
943
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
944
|
+
allowed.any? { |klass| klass === value }
|
945
|
+
end
|
946
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
947
|
+
config_attr :lib_name, nil, ::String, nil
|
948
|
+
config_attr :lib_version, nil, ::String, nil
|
949
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
950
|
+
config_attr :interceptors, nil, ::Array, nil
|
951
|
+
config_attr :timeout, nil, ::Numeric, nil
|
952
|
+
config_attr :metadata, nil, ::Hash, nil
|
953
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
954
|
+
config_attr :quota_project, nil, ::String, nil
|
955
|
+
|
956
|
+
# @private
|
957
|
+
def initialize parent_config = nil
|
958
|
+
@parent_config = parent_config unless parent_config.nil?
|
959
|
+
|
960
|
+
yield self if block_given?
|
961
|
+
end
|
962
|
+
|
963
|
+
##
|
964
|
+
# Configurations for individual RPCs
|
965
|
+
# @return [Rpcs]
|
966
|
+
#
|
967
|
+
def rpcs
|
968
|
+
@rpcs ||= begin
|
969
|
+
parent_rpcs = nil
|
970
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
971
|
+
Rpcs.new parent_rpcs
|
972
|
+
end
|
973
|
+
end
|
974
|
+
|
975
|
+
##
|
976
|
+
# Configuration RPC class for the StorageInsights API.
|
977
|
+
#
|
978
|
+
# Includes fields providing the configuration for each RPC in this service.
|
979
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
980
|
+
# the following configuration fields:
|
981
|
+
#
|
982
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
983
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
984
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
985
|
+
# include the following keys:
|
986
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
987
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
988
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
989
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
990
|
+
# trigger a retry.
|
991
|
+
#
|
992
|
+
class Rpcs
|
993
|
+
##
|
994
|
+
# RPC-specific configuration for `list_report_configs`
|
995
|
+
# @return [::Gapic::Config::Method]
|
996
|
+
#
|
997
|
+
attr_reader :list_report_configs
|
998
|
+
##
|
999
|
+
# RPC-specific configuration for `get_report_config`
|
1000
|
+
# @return [::Gapic::Config::Method]
|
1001
|
+
#
|
1002
|
+
attr_reader :get_report_config
|
1003
|
+
##
|
1004
|
+
# RPC-specific configuration for `create_report_config`
|
1005
|
+
# @return [::Gapic::Config::Method]
|
1006
|
+
#
|
1007
|
+
attr_reader :create_report_config
|
1008
|
+
##
|
1009
|
+
# RPC-specific configuration for `update_report_config`
|
1010
|
+
# @return [::Gapic::Config::Method]
|
1011
|
+
#
|
1012
|
+
attr_reader :update_report_config
|
1013
|
+
##
|
1014
|
+
# RPC-specific configuration for `delete_report_config`
|
1015
|
+
# @return [::Gapic::Config::Method]
|
1016
|
+
#
|
1017
|
+
attr_reader :delete_report_config
|
1018
|
+
##
|
1019
|
+
# RPC-specific configuration for `list_report_details`
|
1020
|
+
# @return [::Gapic::Config::Method]
|
1021
|
+
#
|
1022
|
+
attr_reader :list_report_details
|
1023
|
+
##
|
1024
|
+
# RPC-specific configuration for `get_report_detail`
|
1025
|
+
# @return [::Gapic::Config::Method]
|
1026
|
+
#
|
1027
|
+
attr_reader :get_report_detail
|
1028
|
+
|
1029
|
+
# @private
|
1030
|
+
def initialize parent_rpcs = nil
|
1031
|
+
list_report_configs_config = parent_rpcs.list_report_configs if parent_rpcs.respond_to? :list_report_configs
|
1032
|
+
@list_report_configs = ::Gapic::Config::Method.new list_report_configs_config
|
1033
|
+
get_report_config_config = parent_rpcs.get_report_config if parent_rpcs.respond_to? :get_report_config
|
1034
|
+
@get_report_config = ::Gapic::Config::Method.new get_report_config_config
|
1035
|
+
create_report_config_config = parent_rpcs.create_report_config if parent_rpcs.respond_to? :create_report_config
|
1036
|
+
@create_report_config = ::Gapic::Config::Method.new create_report_config_config
|
1037
|
+
update_report_config_config = parent_rpcs.update_report_config if parent_rpcs.respond_to? :update_report_config
|
1038
|
+
@update_report_config = ::Gapic::Config::Method.new update_report_config_config
|
1039
|
+
delete_report_config_config = parent_rpcs.delete_report_config if parent_rpcs.respond_to? :delete_report_config
|
1040
|
+
@delete_report_config = ::Gapic::Config::Method.new delete_report_config_config
|
1041
|
+
list_report_details_config = parent_rpcs.list_report_details if parent_rpcs.respond_to? :list_report_details
|
1042
|
+
@list_report_details = ::Gapic::Config::Method.new list_report_details_config
|
1043
|
+
get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail
|
1044
|
+
@get_report_detail = ::Gapic::Config::Method.new get_report_detail_config
|
1045
|
+
|
1046
|
+
yield self if block_given?
|
1047
|
+
end
|
1048
|
+
end
|
1049
|
+
end
|
1050
|
+
end
|
1051
|
+
end
|
1052
|
+
end
|
1053
|
+
end
|
1054
|
+
end
|
1055
|
+
end
|