google-cloud-asset-v1 0.23.0 → 0.25.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.
@@ -0,0 +1,2716 @@
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/asset/v1/asset_service_pb"
21
+ require "google/cloud/asset/v1/asset_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Asset
26
+ module V1
27
+ module AssetService
28
+ module Rest
29
+ ##
30
+ # REST client for the AssetService service.
31
+ #
32
+ # Asset service definition.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :asset_service_stub
39
+
40
+ ##
41
+ # Configure the AssetService Client class.
42
+ #
43
+ # See {::Google::Cloud::Asset::V1::AssetService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all AssetService clients
49
+ # ::Google::Cloud::Asset::V1::AssetService::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", "Asset", "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.export_assets.timeout = 60.0
70
+
71
+ default_config.rpcs.list_assets.timeout = 60.0
72
+ default_config.rpcs.list_assets.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
74
+ }
75
+
76
+ default_config.rpcs.batch_get_assets_history.timeout = 60.0
77
+ default_config.rpcs.batch_get_assets_history.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.create_feed.timeout = 60.0
82
+
83
+ default_config.rpcs.get_feed.timeout = 60.0
84
+ default_config.rpcs.get_feed.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.list_feeds.timeout = 60.0
89
+ default_config.rpcs.list_feeds.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
91
+ }
92
+
93
+ default_config.rpcs.update_feed.timeout = 60.0
94
+
95
+ default_config.rpcs.delete_feed.timeout = 60.0
96
+ default_config.rpcs.delete_feed.retry_policy = {
97
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
98
+ }
99
+
100
+ default_config.rpcs.search_all_resources.timeout = 30.0
101
+ default_config.rpcs.search_all_resources.retry_policy = {
102
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.search_all_iam_policies.timeout = 30.0
106
+ default_config.rpcs.search_all_iam_policies.retry_policy = {
107
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config.rpcs.analyze_iam_policy.timeout = 300.0
111
+ default_config.rpcs.analyze_iam_policy.retry_policy = {
112
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
113
+ }
114
+
115
+ default_config.rpcs.analyze_iam_policy_longrunning.timeout = 60.0
116
+
117
+ default_config.rpcs.query_assets.timeout = 200.0
118
+ default_config.rpcs.query_assets.retry_policy = {
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
120
+ }
121
+
122
+ default_config.rpcs.create_saved_query.timeout = 60.0
123
+
124
+ default_config.rpcs.get_saved_query.timeout = 60.0
125
+ default_config.rpcs.get_saved_query.retry_policy = {
126
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
127
+ }
128
+
129
+ default_config.rpcs.list_saved_queries.timeout = 60.0
130
+ default_config.rpcs.list_saved_queries.retry_policy = {
131
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
132
+ }
133
+
134
+ default_config.rpcs.update_saved_query.timeout = 60.0
135
+
136
+ default_config.rpcs.delete_saved_query.timeout = 60.0
137
+ default_config.rpcs.delete_saved_query.retry_policy = {
138
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
139
+ }
140
+
141
+ default_config.rpcs.batch_get_effective_iam_policies.timeout = 300.0
142
+ default_config.rpcs.batch_get_effective_iam_policies.retry_policy = {
143
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
144
+ }
145
+
146
+ default_config.rpcs.analyze_org_policies.timeout = 60.0
147
+ default_config.rpcs.analyze_org_policies.retry_policy = {
148
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
149
+ }
150
+
151
+ default_config.rpcs.analyze_org_policy_governed_containers.timeout = 60.0
152
+ default_config.rpcs.analyze_org_policy_governed_containers.retry_policy = {
153
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
154
+ }
155
+
156
+ default_config.rpcs.analyze_org_policy_governed_assets.timeout = 60.0
157
+ default_config.rpcs.analyze_org_policy_governed_assets.retry_policy = {
158
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
159
+ }
160
+
161
+ default_config
162
+ end
163
+ yield @configure if block_given?
164
+ @configure
165
+ end
166
+
167
+ ##
168
+ # Configure the AssetService Client instance.
169
+ #
170
+ # The configuration is set to the derived mode, meaning that values can be changed,
171
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
172
+ # should be made on {Client.configure}.
173
+ #
174
+ # See {::Google::Cloud::Asset::V1::AssetService::Rest::Client::Configuration}
175
+ # for a description of the configuration fields.
176
+ #
177
+ # @yield [config] Configure the Client client.
178
+ # @yieldparam config [Client::Configuration]
179
+ #
180
+ # @return [Client::Configuration]
181
+ #
182
+ def configure
183
+ yield @config if block_given?
184
+ @config
185
+ end
186
+
187
+ ##
188
+ # Create a new AssetService REST client object.
189
+ #
190
+ # @example
191
+ #
192
+ # # Create a client using the default configuration
193
+ # client = ::Google::Cloud::Asset::V1::AssetService::Rest::Client.new
194
+ #
195
+ # # Create a client using a custom configuration
196
+ # client = ::Google::Cloud::Asset::V1::AssetService::Rest::Client.new do |config|
197
+ # config.timeout = 10.0
198
+ # end
199
+ #
200
+ # @yield [config] Configure the AssetService client.
201
+ # @yieldparam config [Client::Configuration]
202
+ #
203
+ def initialize
204
+ # Create the configuration object
205
+ @config = Configuration.new Client.configure
206
+
207
+ # Yield the configuration if needed
208
+ yield @config if block_given?
209
+
210
+ # Create credentials
211
+ credentials = @config.credentials
212
+ # Use self-signed JWT if the endpoint is unchanged from default,
213
+ # but only if the default endpoint does not have a region prefix.
214
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
215
+ !@config.endpoint.split(".").first.include?("-")
216
+ credentials ||= Credentials.default scope: @config.scope,
217
+ enable_self_signed_jwt: enable_self_signed_jwt
218
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
219
+ credentials = Credentials.new credentials, scope: @config.scope
220
+ end
221
+
222
+ @quota_project_id = @config.quota_project
223
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
224
+
225
+ @operations_client = ::Google::Cloud::Asset::V1::AssetService::Rest::Operations.new do |config|
226
+ config.credentials = credentials
227
+ config.quota_project = @quota_project_id
228
+ config.endpoint = @config.endpoint
229
+ end
230
+
231
+ @asset_service_stub = ::Google::Cloud::Asset::V1::AssetService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
232
+ end
233
+
234
+ ##
235
+ # Get the associated client for long-running operations.
236
+ #
237
+ # @return [::Google::Cloud::Asset::V1::AssetService::Rest::Operations]
238
+ #
239
+ attr_reader :operations_client
240
+
241
+ # Service calls
242
+
243
+ ##
244
+ # Exports assets with time and resource types to a given Cloud Storage
245
+ # location/BigQuery table. For Cloud Storage location destinations, the
246
+ # output format is newline-delimited JSON. Each line represents a
247
+ # {::Google::Cloud::Asset::V1::Asset google.cloud.asset.v1.Asset} in the JSON
248
+ # format; for BigQuery table destinations, the output table stores the fields
249
+ # in asset Protobuf as columns. This API implements the
250
+ # {::Google::Longrunning::Operation google.longrunning.Operation} API, which
251
+ # allows you to keep track of the export. We recommend intervals of at least
252
+ # 2 seconds with exponential retry to poll the export operation result. For
253
+ # regular-size resource parent, the export operation usually finishes within
254
+ # 5 minutes.
255
+ #
256
+ # @overload export_assets(request, options = nil)
257
+ # Pass arguments to `export_assets` via a request object, either of type
258
+ # {::Google::Cloud::Asset::V1::ExportAssetsRequest} or an equivalent Hash.
259
+ #
260
+ # @param request [::Google::Cloud::Asset::V1::ExportAssetsRequest, ::Hash]
261
+ # A request object representing the call parameters. Required. To specify no
262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
263
+ # @param options [::Gapic::CallOptions, ::Hash]
264
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
265
+ #
266
+ # @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil, relationship_types: nil)
267
+ # Pass arguments to `export_assets` via keyword arguments. Note that at
268
+ # least one keyword argument is required. To specify no parameters, or to keep all
269
+ # the default parameter values, pass an empty Hash as a request object (see above).
270
+ #
271
+ # @param parent [::String]
272
+ # Required. The relative name of the root asset. This can only be an
273
+ # organization number (such as "organizations/123"), a project ID (such as
274
+ # "projects/my-project-id"), or a project number (such as "projects/12345"),
275
+ # or a folder number (such as "folders/123").
276
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
277
+ # Timestamp to take an asset snapshot. This can only be set to a timestamp
278
+ # between the current time and the current time minus 35 days (inclusive).
279
+ # If not specified, the current time will be used. Due to delays in resource
280
+ # data collection and indexing, there is a volatile window during which
281
+ # running the same query may get different results.
282
+ # @param asset_types [::Array<::String>]
283
+ # A list of asset types to take a snapshot for. For example:
284
+ # "compute.googleapis.com/Disk".
285
+ #
286
+ # Regular expressions are also supported. For example:
287
+ #
288
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
289
+ # with "compute.googleapis.com".
290
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
291
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
292
+ #
293
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
294
+ # regular expression syntax. If the regular expression does not match any
295
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
296
+ #
297
+ # If specified, only matching assets will be returned, otherwise, it will
298
+ # snapshot all asset types. See [Introduction to Cloud Asset
299
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
300
+ # for all supported asset types.
301
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
302
+ # Asset content type. If not specified, no content but the asset name will be
303
+ # returned.
304
+ # @param output_config [::Google::Cloud::Asset::V1::OutputConfig, ::Hash]
305
+ # Required. Output configuration indicating where the results will be output
306
+ # to.
307
+ # @param relationship_types [::Array<::String>]
308
+ # A list of relationship types to export, for example:
309
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
310
+ # content_type=RELATIONSHIP.
311
+ # * If specified:
312
+ # it snapshots specified relationships. It returns an error if
313
+ # any of the [relationship_types] doesn't belong to the supported
314
+ # relationship types of the [asset_types] or if any of the [asset_types]
315
+ # doesn't belong to the source types of the [relationship_types].
316
+ # * Otherwise:
317
+ # it snapshots the supported relationships for all [asset_types] or returns
318
+ # an error if any of the [asset_types] has no relationship support.
319
+ # An unspecified asset types field means all supported asset_types.
320
+ # See [Introduction to Cloud Asset
321
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
322
+ # supported asset types and relationship types.
323
+ # @yield [result, operation] Access the result along with the TransportOperation object
324
+ # @yieldparam result [::Gapic::Operation]
325
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
326
+ #
327
+ # @return [::Gapic::Operation]
328
+ #
329
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
330
+ def export_assets request, options = nil
331
+ raise ::ArgumentError, "request must be provided" if request.nil?
332
+
333
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ExportAssetsRequest
334
+
335
+ # Converts hash and nil to an options object
336
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
337
+
338
+ # Customize the options with defaults
339
+ call_metadata = @config.rpcs.export_assets.metadata.to_h
340
+
341
+ # Set x-goog-api-client and x-goog-user-project headers
342
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
343
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
344
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
345
+ transports_version_send: [:rest]
346
+
347
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
+
349
+ options.apply_defaults timeout: @config.rpcs.export_assets.timeout,
350
+ metadata: call_metadata,
351
+ retry_policy: @config.rpcs.export_assets.retry_policy
352
+
353
+ options.apply_defaults timeout: @config.timeout,
354
+ metadata: @config.metadata,
355
+ retry_policy: @config.retry_policy
356
+
357
+ @asset_service_stub.export_assets request, options do |result, operation|
358
+ result = ::Gapic::Operation.new result, @operations_client, options: options
359
+ yield result, operation if block_given?
360
+ return result
361
+ end
362
+ rescue ::Gapic::Rest::Error => e
363
+ raise ::Google::Cloud::Error.from_error(e)
364
+ end
365
+
366
+ ##
367
+ # Lists assets with time and resource types and returns paged results in
368
+ # response.
369
+ #
370
+ # @overload list_assets(request, options = nil)
371
+ # Pass arguments to `list_assets` via a request object, either of type
372
+ # {::Google::Cloud::Asset::V1::ListAssetsRequest} or an equivalent Hash.
373
+ #
374
+ # @param request [::Google::Cloud::Asset::V1::ListAssetsRequest, ::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 list_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, page_size: nil, page_token: nil, relationship_types: nil)
381
+ # Pass arguments to `list_assets` 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. Name of the organization, folder, or project the assets belong
387
+ # to. Format: "organizations/[organization-number]" (such as
388
+ # "organizations/123"), "projects/[project-id]" (such as
389
+ # "projects/my-project-id"), "projects/[project-number]" (such as
390
+ # "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").
391
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
392
+ # Timestamp to take an asset snapshot. This can only be set to a timestamp
393
+ # between the current time and the current time minus 35 days (inclusive).
394
+ # If not specified, the current time will be used. Due to delays in resource
395
+ # data collection and indexing, there is a volatile window during which
396
+ # running the same query may get different results.
397
+ # @param asset_types [::Array<::String>]
398
+ # A list of asset types to take a snapshot for. For example:
399
+ # "compute.googleapis.com/Disk".
400
+ #
401
+ # Regular expression is also supported. For example:
402
+ #
403
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
404
+ # with "compute.googleapis.com".
405
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
406
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
407
+ #
408
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
409
+ # regular expression syntax. If the regular expression does not match any
410
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
411
+ #
412
+ # If specified, only matching assets will be returned, otherwise, it will
413
+ # snapshot all asset types. See [Introduction to Cloud Asset
414
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
415
+ # for all supported asset types.
416
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
417
+ # Asset content type. If not specified, no content but the asset name will
418
+ # be returned.
419
+ # @param page_size [::Integer]
420
+ # The maximum number of assets to be returned in a single response. Default
421
+ # is 100, minimum is 1, and maximum is 1000.
422
+ # @param page_token [::String]
423
+ # The `next_page_token` returned from the previous `ListAssetsResponse`, or
424
+ # unspecified for the first `ListAssetsRequest`. It is a continuation of a
425
+ # prior `ListAssets` call, and the API should return the next page of assets.
426
+ # @param relationship_types [::Array<::String>]
427
+ # A list of relationship types to output, for example:
428
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
429
+ # content_type=RELATIONSHIP.
430
+ # * If specified:
431
+ # it snapshots specified relationships. It returns an error if
432
+ # any of the [relationship_types] doesn't belong to the supported
433
+ # relationship types of the [asset_types] or if any of the [asset_types]
434
+ # doesn't belong to the source types of the [relationship_types].
435
+ # * Otherwise:
436
+ # it snapshots the supported relationships for all [asset_types] or returns
437
+ # an error if any of the [asset_types] has no relationship support.
438
+ # An unspecified asset types field means all supported asset_types.
439
+ # See [Introduction to Cloud Asset
440
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
441
+ # for all supported asset types and relationship types.
442
+ # @yield [result, operation] Access the result along with the TransportOperation object
443
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>]
444
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
445
+ #
446
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>]
447
+ #
448
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
449
+ def list_assets request, options = nil
450
+ raise ::ArgumentError, "request must be provided" if request.nil?
451
+
452
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListAssetsRequest
453
+
454
+ # Converts hash and nil to an options object
455
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
456
+
457
+ # Customize the options with defaults
458
+ call_metadata = @config.rpcs.list_assets.metadata.to_h
459
+
460
+ # Set x-goog-api-client and x-goog-user-project headers
461
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
462
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
463
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
464
+ transports_version_send: [:rest]
465
+
466
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
+
468
+ options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
469
+ metadata: call_metadata,
470
+ retry_policy: @config.rpcs.list_assets.retry_policy
471
+
472
+ options.apply_defaults timeout: @config.timeout,
473
+ metadata: @config.metadata,
474
+ retry_policy: @config.retry_policy
475
+
476
+ @asset_service_stub.list_assets request, options do |result, operation|
477
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :list_assets, "assets", request, result, options
478
+ yield result, operation if block_given?
479
+ return result
480
+ end
481
+ rescue ::Gapic::Rest::Error => e
482
+ raise ::Google::Cloud::Error.from_error(e)
483
+ end
484
+
485
+ ##
486
+ # Batch gets the update history of assets that overlap a time window.
487
+ # For IAM_POLICY content, this API outputs history when the asset and its
488
+ # attached IAM POLICY both exist. This can create gaps in the output history.
489
+ # Otherwise, this API outputs history with asset in both non-delete or
490
+ # deleted status.
491
+ # If a specified asset does not exist, this API returns an INVALID_ARGUMENT
492
+ # error.
493
+ #
494
+ # @overload batch_get_assets_history(request, options = nil)
495
+ # Pass arguments to `batch_get_assets_history` via a request object, either of type
496
+ # {::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
497
+ #
498
+ # @param request [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest, ::Hash]
499
+ # A request object representing the call parameters. Required. To specify no
500
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
501
+ # @param options [::Gapic::CallOptions, ::Hash]
502
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
503
+ #
504
+ # @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil, relationship_types: nil)
505
+ # Pass arguments to `batch_get_assets_history` via keyword arguments. Note that at
506
+ # least one keyword argument is required. To specify no parameters, or to keep all
507
+ # the default parameter values, pass an empty Hash as a request object (see above).
508
+ #
509
+ # @param parent [::String]
510
+ # Required. The relative name of the root asset. It can only be an
511
+ # organization number (such as "organizations/123"), a project ID (such as
512
+ # "projects/my-project-id")", or a project number (such as "projects/12345").
513
+ # @param asset_names [::Array<::String>]
514
+ # A list of the full names of the assets.
515
+ # See: https://cloud.google.com/asset-inventory/docs/resource-name-format
516
+ # Example:
517
+ #
518
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
519
+ #
520
+ # The request becomes a no-op if the asset name list is empty, and the max
521
+ # size of the asset name list is 100 in one request.
522
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
523
+ # Optional. The content type.
524
+ # @param read_time_window [::Google::Cloud::Asset::V1::TimeWindow, ::Hash]
525
+ # Optional. The time window for the asset history. Both start_time and
526
+ # end_time are optional and if set, it must be after the current time minus
527
+ # 35 days. If end_time is not set, it is default to current timestamp.
528
+ # If start_time is not set, the snapshot of the assets at end_time will be
529
+ # returned. The returned results contain all temporal assets whose time
530
+ # window overlap with read_time_window.
531
+ # @param relationship_types [::Array<::String>]
532
+ # Optional. A list of relationship types to output, for example:
533
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
534
+ # content_type=RELATIONSHIP.
535
+ # * If specified:
536
+ # it outputs specified relationships' history on the [asset_names]. It
537
+ # returns an error if any of the [relationship_types] doesn't belong to the
538
+ # supported relationship types of the [asset_names] or if any of the
539
+ # [asset_names]'s types doesn't belong to the source types of the
540
+ # [relationship_types].
541
+ # * Otherwise:
542
+ # it outputs the supported relationships' history on the [asset_names] or
543
+ # returns an error if any of the [asset_names]'s types has no relationship
544
+ # support.
545
+ # See [Introduction to Cloud Asset
546
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
547
+ # supported asset types and relationship types.
548
+ # @yield [result, operation] Access the result along with the TransportOperation object
549
+ # @yieldparam result [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
550
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
551
+ #
552
+ # @return [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
553
+ #
554
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
555
+ def batch_get_assets_history request, options = nil
556
+ raise ::ArgumentError, "request must be provided" if request.nil?
557
+
558
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest
559
+
560
+ # Converts hash and nil to an options object
561
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
562
+
563
+ # Customize the options with defaults
564
+ call_metadata = @config.rpcs.batch_get_assets_history.metadata.to_h
565
+
566
+ # Set x-goog-api-client and x-goog-user-project headers
567
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
568
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
569
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
570
+ transports_version_send: [:rest]
571
+
572
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
573
+
574
+ options.apply_defaults timeout: @config.rpcs.batch_get_assets_history.timeout,
575
+ metadata: call_metadata,
576
+ retry_policy: @config.rpcs.batch_get_assets_history.retry_policy
577
+
578
+ options.apply_defaults timeout: @config.timeout,
579
+ metadata: @config.metadata,
580
+ retry_policy: @config.retry_policy
581
+
582
+ @asset_service_stub.batch_get_assets_history request, options do |result, operation|
583
+ yield result, operation if block_given?
584
+ return result
585
+ end
586
+ rescue ::Gapic::Rest::Error => e
587
+ raise ::Google::Cloud::Error.from_error(e)
588
+ end
589
+
590
+ ##
591
+ # Creates a feed in a parent project/folder/organization to listen to its
592
+ # asset updates.
593
+ #
594
+ # @overload create_feed(request, options = nil)
595
+ # Pass arguments to `create_feed` via a request object, either of type
596
+ # {::Google::Cloud::Asset::V1::CreateFeedRequest} or an equivalent Hash.
597
+ #
598
+ # @param request [::Google::Cloud::Asset::V1::CreateFeedRequest, ::Hash]
599
+ # A request object representing the call parameters. Required. To specify no
600
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
601
+ # @param options [::Gapic::CallOptions, ::Hash]
602
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
603
+ #
604
+ # @overload create_feed(parent: nil, feed_id: nil, feed: nil)
605
+ # Pass arguments to `create_feed` via keyword arguments. Note that at
606
+ # least one keyword argument is required. To specify no parameters, or to keep all
607
+ # the default parameter values, pass an empty Hash as a request object (see above).
608
+ #
609
+ # @param parent [::String]
610
+ # Required. The name of the project/folder/organization where this feed
611
+ # should be created in. It can only be an organization number (such as
612
+ # "organizations/123"), a folder number (such as "folders/123"), a project ID
613
+ # (such as "projects/my-project-id"), or a project number (such as
614
+ # "projects/12345").
615
+ # @param feed_id [::String]
616
+ # Required. This is the client-assigned asset feed identifier and it needs to
617
+ # be unique under a specific parent project/folder/organization.
618
+ # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
619
+ # Required. The feed details. The field `name` must be empty and it will be
620
+ # generated in the format of: projects/project_number/feeds/feed_id
621
+ # folders/folder_number/feeds/feed_id
622
+ # organizations/organization_number/feeds/feed_id
623
+ # @yield [result, operation] Access the result along with the TransportOperation object
624
+ # @yieldparam result [::Google::Cloud::Asset::V1::Feed]
625
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
626
+ #
627
+ # @return [::Google::Cloud::Asset::V1::Feed]
628
+ #
629
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
630
+ def create_feed request, options = nil
631
+ raise ::ArgumentError, "request must be provided" if request.nil?
632
+
633
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::CreateFeedRequest
634
+
635
+ # Converts hash and nil to an options object
636
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
637
+
638
+ # Customize the options with defaults
639
+ call_metadata = @config.rpcs.create_feed.metadata.to_h
640
+
641
+ # Set x-goog-api-client and x-goog-user-project headers
642
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
643
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
644
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
645
+ transports_version_send: [:rest]
646
+
647
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
648
+
649
+ options.apply_defaults timeout: @config.rpcs.create_feed.timeout,
650
+ metadata: call_metadata,
651
+ retry_policy: @config.rpcs.create_feed.retry_policy
652
+
653
+ options.apply_defaults timeout: @config.timeout,
654
+ metadata: @config.metadata,
655
+ retry_policy: @config.retry_policy
656
+
657
+ @asset_service_stub.create_feed request, options do |result, operation|
658
+ yield result, operation if block_given?
659
+ return result
660
+ end
661
+ rescue ::Gapic::Rest::Error => e
662
+ raise ::Google::Cloud::Error.from_error(e)
663
+ end
664
+
665
+ ##
666
+ # Gets details about an asset feed.
667
+ #
668
+ # @overload get_feed(request, options = nil)
669
+ # Pass arguments to `get_feed` via a request object, either of type
670
+ # {::Google::Cloud::Asset::V1::GetFeedRequest} or an equivalent Hash.
671
+ #
672
+ # @param request [::Google::Cloud::Asset::V1::GetFeedRequest, ::Hash]
673
+ # A request object representing the call parameters. Required. To specify no
674
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
675
+ # @param options [::Gapic::CallOptions, ::Hash]
676
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
677
+ #
678
+ # @overload get_feed(name: nil)
679
+ # Pass arguments to `get_feed` via keyword arguments. Note that at
680
+ # least one keyword argument is required. To specify no parameters, or to keep all
681
+ # the default parameter values, pass an empty Hash as a request object (see above).
682
+ #
683
+ # @param name [::String]
684
+ # Required. The name of the Feed and it must be in the format of:
685
+ # projects/project_number/feeds/feed_id
686
+ # folders/folder_number/feeds/feed_id
687
+ # organizations/organization_number/feeds/feed_id
688
+ # @yield [result, operation] Access the result along with the TransportOperation object
689
+ # @yieldparam result [::Google::Cloud::Asset::V1::Feed]
690
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
691
+ #
692
+ # @return [::Google::Cloud::Asset::V1::Feed]
693
+ #
694
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
695
+ def get_feed request, options = nil
696
+ raise ::ArgumentError, "request must be provided" if request.nil?
697
+
698
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::GetFeedRequest
699
+
700
+ # Converts hash and nil to an options object
701
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
702
+
703
+ # Customize the options with defaults
704
+ call_metadata = @config.rpcs.get_feed.metadata.to_h
705
+
706
+ # Set x-goog-api-client and x-goog-user-project headers
707
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
708
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
709
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
710
+ transports_version_send: [:rest]
711
+
712
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
713
+
714
+ options.apply_defaults timeout: @config.rpcs.get_feed.timeout,
715
+ metadata: call_metadata,
716
+ retry_policy: @config.rpcs.get_feed.retry_policy
717
+
718
+ options.apply_defaults timeout: @config.timeout,
719
+ metadata: @config.metadata,
720
+ retry_policy: @config.retry_policy
721
+
722
+ @asset_service_stub.get_feed request, options do |result, operation|
723
+ yield result, operation if block_given?
724
+ return result
725
+ end
726
+ rescue ::Gapic::Rest::Error => e
727
+ raise ::Google::Cloud::Error.from_error(e)
728
+ end
729
+
730
+ ##
731
+ # Lists all asset feeds in a parent project/folder/organization.
732
+ #
733
+ # @overload list_feeds(request, options = nil)
734
+ # Pass arguments to `list_feeds` via a request object, either of type
735
+ # {::Google::Cloud::Asset::V1::ListFeedsRequest} or an equivalent Hash.
736
+ #
737
+ # @param request [::Google::Cloud::Asset::V1::ListFeedsRequest, ::Hash]
738
+ # A request object representing the call parameters. Required. To specify no
739
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
740
+ # @param options [::Gapic::CallOptions, ::Hash]
741
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
742
+ #
743
+ # @overload list_feeds(parent: nil)
744
+ # Pass arguments to `list_feeds` via keyword arguments. Note that at
745
+ # least one keyword argument is required. To specify no parameters, or to keep all
746
+ # the default parameter values, pass an empty Hash as a request object (see above).
747
+ #
748
+ # @param parent [::String]
749
+ # Required. The parent project/folder/organization whose feeds are to be
750
+ # listed. It can only be using project/folder/organization number (such as
751
+ # "folders/12345")", or a project ID (such as "projects/my-project-id").
752
+ # @yield [result, operation] Access the result along with the TransportOperation object
753
+ # @yieldparam result [::Google::Cloud::Asset::V1::ListFeedsResponse]
754
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
755
+ #
756
+ # @return [::Google::Cloud::Asset::V1::ListFeedsResponse]
757
+ #
758
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
759
+ def list_feeds request, options = nil
760
+ raise ::ArgumentError, "request must be provided" if request.nil?
761
+
762
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListFeedsRequest
763
+
764
+ # Converts hash and nil to an options object
765
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
766
+
767
+ # Customize the options with defaults
768
+ call_metadata = @config.rpcs.list_feeds.metadata.to_h
769
+
770
+ # Set x-goog-api-client and x-goog-user-project headers
771
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
772
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
773
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
774
+ transports_version_send: [:rest]
775
+
776
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
777
+
778
+ options.apply_defaults timeout: @config.rpcs.list_feeds.timeout,
779
+ metadata: call_metadata,
780
+ retry_policy: @config.rpcs.list_feeds.retry_policy
781
+
782
+ options.apply_defaults timeout: @config.timeout,
783
+ metadata: @config.metadata,
784
+ retry_policy: @config.retry_policy
785
+
786
+ @asset_service_stub.list_feeds request, options do |result, operation|
787
+ yield result, operation if block_given?
788
+ return result
789
+ end
790
+ rescue ::Gapic::Rest::Error => e
791
+ raise ::Google::Cloud::Error.from_error(e)
792
+ end
793
+
794
+ ##
795
+ # Updates an asset feed configuration.
796
+ #
797
+ # @overload update_feed(request, options = nil)
798
+ # Pass arguments to `update_feed` via a request object, either of type
799
+ # {::Google::Cloud::Asset::V1::UpdateFeedRequest} or an equivalent Hash.
800
+ #
801
+ # @param request [::Google::Cloud::Asset::V1::UpdateFeedRequest, ::Hash]
802
+ # A request object representing the call parameters. Required. To specify no
803
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
804
+ # @param options [::Gapic::CallOptions, ::Hash]
805
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
806
+ #
807
+ # @overload update_feed(feed: nil, update_mask: nil)
808
+ # Pass arguments to `update_feed` via keyword arguments. Note that at
809
+ # least one keyword argument is required. To specify no parameters, or to keep all
810
+ # the default parameter values, pass an empty Hash as a request object (see above).
811
+ #
812
+ # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
813
+ # Required. The new values of feed details. It must match an existing feed
814
+ # and the field `name` must be in the format of:
815
+ # projects/project_number/feeds/feed_id or
816
+ # folders/folder_number/feeds/feed_id or
817
+ # organizations/organization_number/feeds/feed_id.
818
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
819
+ # Required. Only updates the `feed` fields indicated by this mask.
820
+ # The field mask must not be empty, and it must not contain fields that
821
+ # are immutable or only set by the server.
822
+ # @yield [result, operation] Access the result along with the TransportOperation object
823
+ # @yieldparam result [::Google::Cloud::Asset::V1::Feed]
824
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
825
+ #
826
+ # @return [::Google::Cloud::Asset::V1::Feed]
827
+ #
828
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
829
+ def update_feed request, options = nil
830
+ raise ::ArgumentError, "request must be provided" if request.nil?
831
+
832
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::UpdateFeedRequest
833
+
834
+ # Converts hash and nil to an options object
835
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
836
+
837
+ # Customize the options with defaults
838
+ call_metadata = @config.rpcs.update_feed.metadata.to_h
839
+
840
+ # Set x-goog-api-client and x-goog-user-project headers
841
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
842
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
843
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
844
+ transports_version_send: [:rest]
845
+
846
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
847
+
848
+ options.apply_defaults timeout: @config.rpcs.update_feed.timeout,
849
+ metadata: call_metadata,
850
+ retry_policy: @config.rpcs.update_feed.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @asset_service_stub.update_feed request, options do |result, operation|
857
+ yield result, operation if block_given?
858
+ return result
859
+ end
860
+ rescue ::Gapic::Rest::Error => e
861
+ raise ::Google::Cloud::Error.from_error(e)
862
+ end
863
+
864
+ ##
865
+ # Deletes an asset feed.
866
+ #
867
+ # @overload delete_feed(request, options = nil)
868
+ # Pass arguments to `delete_feed` via a request object, either of type
869
+ # {::Google::Cloud::Asset::V1::DeleteFeedRequest} or an equivalent Hash.
870
+ #
871
+ # @param request [::Google::Cloud::Asset::V1::DeleteFeedRequest, ::Hash]
872
+ # A request object representing the call parameters. Required. To specify no
873
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
874
+ # @param options [::Gapic::CallOptions, ::Hash]
875
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
876
+ #
877
+ # @overload delete_feed(name: nil)
878
+ # Pass arguments to `delete_feed` via keyword arguments. Note that at
879
+ # least one keyword argument is required. To specify no parameters, or to keep all
880
+ # the default parameter values, pass an empty Hash as a request object (see above).
881
+ #
882
+ # @param name [::String]
883
+ # Required. The name of the feed and it must be in the format of:
884
+ # projects/project_number/feeds/feed_id
885
+ # folders/folder_number/feeds/feed_id
886
+ # organizations/organization_number/feeds/feed_id
887
+ # @yield [result, operation] Access the result along with the TransportOperation object
888
+ # @yieldparam result [::Google::Protobuf::Empty]
889
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
890
+ #
891
+ # @return [::Google::Protobuf::Empty]
892
+ #
893
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
894
+ def delete_feed request, options = nil
895
+ raise ::ArgumentError, "request must be provided" if request.nil?
896
+
897
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::DeleteFeedRequest
898
+
899
+ # Converts hash and nil to an options object
900
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
901
+
902
+ # Customize the options with defaults
903
+ call_metadata = @config.rpcs.delete_feed.metadata.to_h
904
+
905
+ # Set x-goog-api-client and x-goog-user-project headers
906
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
907
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
908
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
909
+ transports_version_send: [:rest]
910
+
911
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
912
+
913
+ options.apply_defaults timeout: @config.rpcs.delete_feed.timeout,
914
+ metadata: call_metadata,
915
+ retry_policy: @config.rpcs.delete_feed.retry_policy
916
+
917
+ options.apply_defaults timeout: @config.timeout,
918
+ metadata: @config.metadata,
919
+ retry_policy: @config.retry_policy
920
+
921
+ @asset_service_stub.delete_feed request, options do |result, operation|
922
+ yield result, operation if block_given?
923
+ return result
924
+ end
925
+ rescue ::Gapic::Rest::Error => e
926
+ raise ::Google::Cloud::Error.from_error(e)
927
+ end
928
+
929
+ ##
930
+ # Searches all Google Cloud resources within the specified scope, such as a
931
+ # project, folder, or organization. The caller must be granted the
932
+ # `cloudasset.assets.searchAllResources` permission on the desired scope,
933
+ # otherwise the request will be rejected.
934
+ #
935
+ # @overload search_all_resources(request, options = nil)
936
+ # Pass arguments to `search_all_resources` via a request object, either of type
937
+ # {::Google::Cloud::Asset::V1::SearchAllResourcesRequest} or an equivalent Hash.
938
+ #
939
+ # @param request [::Google::Cloud::Asset::V1::SearchAllResourcesRequest, ::Hash]
940
+ # A request object representing the call parameters. Required. To specify no
941
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
942
+ # @param options [::Gapic::CallOptions, ::Hash]
943
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
944
+ #
945
+ # @overload search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil)
946
+ # Pass arguments to `search_all_resources` via keyword arguments. Note that at
947
+ # least one keyword argument is required. To specify no parameters, or to keep all
948
+ # the default parameter values, pass an empty Hash as a request object (see above).
949
+ #
950
+ # @param scope [::String]
951
+ # Required. A scope can be a project, a folder, or an organization. The
952
+ # search is limited to the resources within the `scope`. The caller must be
953
+ # granted the
954
+ # [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
955
+ # permission on the desired scope.
956
+ #
957
+ # The allowed values are:
958
+ #
959
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
960
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
961
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
962
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
963
+ # @param query [::String]
964
+ # Optional. The query statement. See [how to construct a
965
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
966
+ # for more information. If not specified or empty, it will search all the
967
+ # resources within the specified `scope`.
968
+ #
969
+ # Examples:
970
+ #
971
+ # * `name:Important` to find Google Cloud resources whose name contains
972
+ # "Important" as a word.
973
+ # * `name=Important` to find the Google Cloud resource whose name is exactly
974
+ # "Important".
975
+ # * `displayName:Impor*` to find Google Cloud resources whose display name
976
+ # contains "Impor" as a prefix of any word in the field.
977
+ # * `location:us-west*` to find Google Cloud resources whose location
978
+ # contains both "us" and "west" as prefixes.
979
+ # * `labels:prod` to find Google Cloud resources whose labels contain "prod"
980
+ # as a key or value.
981
+ # * `labels.env:prod` to find Google Cloud resources that have a label "env"
982
+ # and its value is "prod".
983
+ # * `labels.env:*` to find Google Cloud resources that have a label "env".
984
+ # * `kmsKey:key` to find Google Cloud resources encrypted with a
985
+ # customer-managed encryption key whose name contains "key" as a word. This
986
+ # field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS
987
+ # key information.
988
+ # * `kmsKeys:key` to find Google Cloud resources encrypted with
989
+ # customer-managed encryption keys whose name contains the word "key".
990
+ # * `relationships:instance-group-1` to find Google Cloud resources that have
991
+ # relationships with "instance-group-1" in the related resource name.
992
+ # * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine
993
+ # instances that have relationships of type "INSTANCE_TO_INSTANCEGROUP".
994
+ # * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
995
+ # Compute Engine instances that have relationships with "instance-group-1"
996
+ # in the Compute Engine instance group resource name, for relationship type
997
+ # "INSTANCE_TO_INSTANCEGROUP".
998
+ # * `state:ACTIVE` to find Google Cloud resources whose state contains
999
+ # "ACTIVE" as a word.
1000
+ # * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't
1001
+ # contain "ACTIVE" as a word.
1002
+ # * `createTime<1609459200` to find Google Cloud resources that were created
1003
+ # before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1004
+ # "2021-01-01 00:00:00 UTC" in seconds.
1005
+ # * `updateTime>1609459200` to find Google Cloud resources that were updated
1006
+ # after "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1007
+ # "2021-01-01 00:00:00 UTC" in seconds.
1008
+ # * `Important` to find Google Cloud resources that contain "Important" as a
1009
+ # word in any of the searchable fields.
1010
+ # * `Impor*` to find Google Cloud resources that contain "Impor" as a prefix
1011
+ # of any word in any of the searchable fields.
1012
+ # * `Important location:(us-west1 OR global)` to find Google Cloud
1013
+ # resources that contain "Important" as a word in any of the searchable
1014
+ # fields and are also located in the "us-west1" region or the "global"
1015
+ # location.
1016
+ # @param asset_types [::Array<::String>]
1017
+ # Optional. A list of asset types that this request searches for. If empty,
1018
+ # it will search all the [searchable asset
1019
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1020
+ #
1021
+ # Regular expressions are also supported. For example:
1022
+ #
1023
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
1024
+ # with "compute.googleapis.com".
1025
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
1026
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
1027
+ #
1028
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
1029
+ # regular expression syntax. If the regular expression does not match any
1030
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
1031
+ # @param page_size [::Integer]
1032
+ # Optional. The page size for search result pagination. Page size is capped
1033
+ # at 500 even if a larger value is given. If set to zero, server will pick an
1034
+ # appropriate default. Returned results may be fewer than requested. When
1035
+ # this happens, there could be more results as long as `next_page_token` is
1036
+ # returned.
1037
+ # @param page_token [::String]
1038
+ # Optional. If present, then retrieve the next batch of results from the
1039
+ # preceding call to this method. `page_token` must be the value of
1040
+ # `next_page_token` from the previous response. The values of all other
1041
+ # method parameters, must be identical to those in the previous call.
1042
+ # @param order_by [::String]
1043
+ # Optional. A comma-separated list of fields specifying the sorting order of
1044
+ # the results. The default order is ascending. Add " DESC" after the field
1045
+ # name to indicate descending order. Redundant space characters are ignored.
1046
+ # Example: "location DESC, name".
1047
+ # Only singular primitive fields in the response are sortable:
1048
+ #
1049
+ # * name
1050
+ # * assetType
1051
+ # * project
1052
+ # * displayName
1053
+ # * description
1054
+ # * location
1055
+ # * createTime
1056
+ # * updateTime
1057
+ # * state
1058
+ # * parentFullResourceName
1059
+ # * parentAssetType
1060
+ #
1061
+ # All the other fields such as repeated fields (e.g., `networkTags`,
1062
+ # `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g.,
1063
+ # `additionalAttributes`) are not supported.
1064
+ # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
1065
+ # Optional. A comma-separated list of fields specifying which fields to be
1066
+ # returned in ResourceSearchResult. Only '*' or combination of top level
1067
+ # fields can be specified. Field names of both snake_case and camelCase are
1068
+ # supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
1069
+ #
1070
+ # The read_mask paths must be valid field paths listed but not limited to
1071
+ # (both snake_case and camelCase are supported):
1072
+ #
1073
+ # * name
1074
+ # * assetType
1075
+ # * project
1076
+ # * displayName
1077
+ # * description
1078
+ # * location
1079
+ # * tagKeys
1080
+ # * tagValues
1081
+ # * tagValueIds
1082
+ # * labels
1083
+ # * networkTags
1084
+ # * kmsKey (This field is deprecated. Please use the `kmsKeys` field to
1085
+ # retrieve Cloud KMS key information.)
1086
+ # * kmsKeys
1087
+ # * createTime
1088
+ # * updateTime
1089
+ # * state
1090
+ # * additionalAttributes
1091
+ # * versionedResources
1092
+ #
1093
+ # If read_mask is not specified, all fields except versionedResources will
1094
+ # be returned.
1095
+ # If only '*' is specified, all fields including versionedResources will be
1096
+ # returned.
1097
+ # Any invalid field path will trigger INVALID_ARGUMENT error.
1098
+ # @yield [result, operation] Access the result along with the TransportOperation object
1099
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
1100
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1101
+ #
1102
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
1103
+ #
1104
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1105
+ def search_all_resources request, options = nil
1106
+ raise ::ArgumentError, "request must be provided" if request.nil?
1107
+
1108
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllResourcesRequest
1109
+
1110
+ # Converts hash and nil to an options object
1111
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1112
+
1113
+ # Customize the options with defaults
1114
+ call_metadata = @config.rpcs.search_all_resources.metadata.to_h
1115
+
1116
+ # Set x-goog-api-client and x-goog-user-project headers
1117
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1118
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1119
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1120
+ transports_version_send: [:rest]
1121
+
1122
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1123
+
1124
+ options.apply_defaults timeout: @config.rpcs.search_all_resources.timeout,
1125
+ metadata: call_metadata,
1126
+ retry_policy: @config.rpcs.search_all_resources.retry_policy
1127
+
1128
+ options.apply_defaults timeout: @config.timeout,
1129
+ metadata: @config.metadata,
1130
+ retry_policy: @config.retry_policy
1131
+
1132
+ @asset_service_stub.search_all_resources request, options do |result, operation|
1133
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :search_all_resources, "results", request, result, options
1134
+ yield result, operation if block_given?
1135
+ return result
1136
+ end
1137
+ rescue ::Gapic::Rest::Error => e
1138
+ raise ::Google::Cloud::Error.from_error(e)
1139
+ end
1140
+
1141
+ ##
1142
+ # Searches all IAM policies within the specified scope, such as a project,
1143
+ # folder, or organization. The caller must be granted the
1144
+ # `cloudasset.assets.searchAllIamPolicies` permission on the desired scope,
1145
+ # otherwise the request will be rejected.
1146
+ #
1147
+ # @overload search_all_iam_policies(request, options = nil)
1148
+ # Pass arguments to `search_all_iam_policies` via a request object, either of type
1149
+ # {::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest} or an equivalent Hash.
1150
+ #
1151
+ # @param request [::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest, ::Hash]
1152
+ # A request object representing the call parameters. Required. To specify no
1153
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1154
+ # @param options [::Gapic::CallOptions, ::Hash]
1155
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1156
+ #
1157
+ # @overload search_all_iam_policies(scope: nil, query: nil, page_size: nil, page_token: nil, asset_types: nil, order_by: nil)
1158
+ # Pass arguments to `search_all_iam_policies` via keyword arguments. Note that at
1159
+ # least one keyword argument is required. To specify no parameters, or to keep all
1160
+ # the default parameter values, pass an empty Hash as a request object (see above).
1161
+ #
1162
+ # @param scope [::String]
1163
+ # Required. A scope can be a project, a folder, or an organization. The
1164
+ # search is limited to the IAM policies within the `scope`. The caller must
1165
+ # be granted the
1166
+ # [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1167
+ # permission on the desired scope.
1168
+ #
1169
+ # The allowed values are:
1170
+ #
1171
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
1172
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
1173
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
1174
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
1175
+ # @param query [::String]
1176
+ # Optional. The query statement. See [how to construct a
1177
+ # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
1178
+ # for more information. If not specified or empty, it will search all the
1179
+ # IAM policies within the specified `scope`. Note that the query string is
1180
+ # compared against each IAM policy binding, including its principals,
1181
+ # roles, and IAM conditions. The returned IAM policies will only
1182
+ # contain the bindings that match your query. To learn more about the IAM
1183
+ # policy structure, see the [IAM policy
1184
+ # documentation](https://cloud.google.com/iam/help/allow-policies/structure).
1185
+ #
1186
+ # Examples:
1187
+ #
1188
+ # * `policy:amy@gmail.com` to find IAM policy bindings that specify user
1189
+ # "amy@gmail.com".
1190
+ # * `policy:roles/compute.admin` to find IAM policy bindings that specify
1191
+ # the Compute Admin role.
1192
+ # * `policy:comp*` to find IAM policy bindings that contain "comp" as a
1193
+ # prefix of any word in the binding.
1194
+ # * `policy.role.permissions:storage.buckets.update` to find IAM policy
1195
+ # bindings that specify a role containing "storage.buckets.update"
1196
+ # permission. Note that if callers don't have `iam.roles.get` access to a
1197
+ # role's included permissions, policy bindings that specify this role will
1198
+ # be dropped from the search results.
1199
+ # * `policy.role.permissions:upd*` to find IAM policy bindings that specify a
1200
+ # role containing "upd" as a prefix of any word in the role permission.
1201
+ # Note that if callers don't have `iam.roles.get` access to a role's
1202
+ # included permissions, policy bindings that specify this role will be
1203
+ # dropped from the search results.
1204
+ # * `resource:organizations/123456` to find IAM policy bindings
1205
+ # that are set on "organizations/123456".
1206
+ # * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to
1207
+ # find IAM policy bindings that are set on the project named "myproject".
1208
+ # * `Important` to find IAM policy bindings that contain "Important" as a
1209
+ # word in any of the searchable fields (except for the included
1210
+ # permissions).
1211
+ # * `resource:(instance1 OR instance2) policy:amy` to find
1212
+ # IAM policy bindings that are set on resources "instance1" or
1213
+ # "instance2" and also specify user "amy".
1214
+ # * `roles:roles/compute.admin` to find IAM policy bindings that specify the
1215
+ # Compute Admin role.
1216
+ # * `memberTypes:user` to find IAM policy bindings that contain the
1217
+ # principal type "user".
1218
+ # @param page_size [::Integer]
1219
+ # Optional. The page size for search result pagination. Page size is capped
1220
+ # at 500 even if a larger value is given. If set to zero, server will pick an
1221
+ # appropriate default. Returned results may be fewer than requested. When
1222
+ # this happens, there could be more results as long as `next_page_token` is
1223
+ # returned.
1224
+ # @param page_token [::String]
1225
+ # Optional. If present, retrieve the next batch of results from the preceding
1226
+ # call to this method. `page_token` must be the value of `next_page_token`
1227
+ # from the previous response. The values of all other method parameters must
1228
+ # be identical to those in the previous call.
1229
+ # @param asset_types [::Array<::String>]
1230
+ # Optional. A list of asset types that the IAM policies are attached to. If
1231
+ # empty, it will search the IAM policies that are attached to all the
1232
+ # [searchable asset
1233
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1234
+ #
1235
+ # Regular expressions are also supported. For example:
1236
+ #
1237
+ # * "compute.googleapis.com.*" snapshots IAM policies attached to asset type
1238
+ # starts with "compute.googleapis.com".
1239
+ # * ".*Instance" snapshots IAM policies attached to asset type ends with
1240
+ # "Instance".
1241
+ # * ".*Instance.*" snapshots IAM policies attached to asset type contains
1242
+ # "Instance".
1243
+ #
1244
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
1245
+ # regular expression syntax. If the regular expression does not match any
1246
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
1247
+ # @param order_by [::String]
1248
+ # Optional. A comma-separated list of fields specifying the sorting order of
1249
+ # the results. The default order is ascending. Add " DESC" after the field
1250
+ # name to indicate descending order. Redundant space characters are ignored.
1251
+ # Example: "assetType DESC, resource".
1252
+ # Only singular primitive fields in the response are sortable:
1253
+ # * resource
1254
+ # * assetType
1255
+ # * project
1256
+ # All the other fields such as repeated fields (e.g., `folders`) and
1257
+ # non-primitive fields (e.g., `policy`) are not supported.
1258
+ # @yield [result, operation] Access the result along with the TransportOperation object
1259
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
1260
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1261
+ #
1262
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
1263
+ #
1264
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1265
+ def search_all_iam_policies request, options = nil
1266
+ raise ::ArgumentError, "request must be provided" if request.nil?
1267
+
1268
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest
1269
+
1270
+ # Converts hash and nil to an options object
1271
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1272
+
1273
+ # Customize the options with defaults
1274
+ call_metadata = @config.rpcs.search_all_iam_policies.metadata.to_h
1275
+
1276
+ # Set x-goog-api-client and x-goog-user-project headers
1277
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1278
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1279
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1280
+ transports_version_send: [:rest]
1281
+
1282
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1283
+
1284
+ options.apply_defaults timeout: @config.rpcs.search_all_iam_policies.timeout,
1285
+ metadata: call_metadata,
1286
+ retry_policy: @config.rpcs.search_all_iam_policies.retry_policy
1287
+
1288
+ options.apply_defaults timeout: @config.timeout,
1289
+ metadata: @config.metadata,
1290
+ retry_policy: @config.retry_policy
1291
+
1292
+ @asset_service_stub.search_all_iam_policies request, options do |result, operation|
1293
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, "results", request, result, options
1294
+ yield result, operation if block_given?
1295
+ return result
1296
+ end
1297
+ rescue ::Gapic::Rest::Error => e
1298
+ raise ::Google::Cloud::Error.from_error(e)
1299
+ end
1300
+
1301
+ ##
1302
+ # Analyzes IAM policies to answer which identities have what accesses on
1303
+ # which resources.
1304
+ #
1305
+ # @overload analyze_iam_policy(request, options = nil)
1306
+ # Pass arguments to `analyze_iam_policy` via a request object, either of type
1307
+ # {::Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest} or an equivalent Hash.
1308
+ #
1309
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest, ::Hash]
1310
+ # A request object representing the call parameters. Required. To specify no
1311
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1312
+ # @param options [::Gapic::CallOptions, ::Hash]
1313
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1314
+ #
1315
+ # @overload analyze_iam_policy(analysis_query: nil, saved_analysis_query: nil, execution_timeout: nil)
1316
+ # Pass arguments to `analyze_iam_policy` via keyword arguments. Note that at
1317
+ # least one keyword argument is required. To specify no parameters, or to keep all
1318
+ # the default parameter values, pass an empty Hash as a request object (see above).
1319
+ #
1320
+ # @param analysis_query [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery, ::Hash]
1321
+ # Required. The request query.
1322
+ # @param saved_analysis_query [::String]
1323
+ # Optional. The name of a saved query, which must be in the format of:
1324
+ #
1325
+ # * projects/project_number/savedQueries/saved_query_id
1326
+ # * folders/folder_number/savedQueries/saved_query_id
1327
+ # * organizations/organization_number/savedQueries/saved_query_id
1328
+ #
1329
+ # If both `analysis_query` and `saved_analysis_query` are provided, they
1330
+ # will be merged together with the `saved_analysis_query` as base and
1331
+ # the `analysis_query` as overrides. For more details of the merge behavior,
1332
+ # please refer to the
1333
+ # [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
1334
+ # page.
1335
+ #
1336
+ # Note that you cannot override primitive fields with default value, such as
1337
+ # 0 or empty string, etc., because we use proto3, which doesn't support field
1338
+ # presence yet.
1339
+ # @param execution_timeout [::Google::Protobuf::Duration, ::Hash]
1340
+ # Optional. Amount of time executable has to complete. See JSON
1341
+ # representation of
1342
+ # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json).
1343
+ #
1344
+ # If this field is set with a value less than the RPC deadline, and the
1345
+ # execution of your query hasn't finished in the specified
1346
+ # execution timeout, you will get a response with partial result.
1347
+ # Otherwise, your query's execution will continue until the RPC deadline.
1348
+ # If it's not finished until then, you will get a DEADLINE_EXCEEDED error.
1349
+ #
1350
+ # Default is empty.
1351
+ # @yield [result, operation] Access the result along with the TransportOperation object
1352
+ # @yieldparam result [::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse]
1353
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1354
+ #
1355
+ # @return [::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse]
1356
+ #
1357
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1358
+ def analyze_iam_policy request, options = nil
1359
+ raise ::ArgumentError, "request must be provided" if request.nil?
1360
+
1361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest
1362
+
1363
+ # Converts hash and nil to an options object
1364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1365
+
1366
+ # Customize the options with defaults
1367
+ call_metadata = @config.rpcs.analyze_iam_policy.metadata.to_h
1368
+
1369
+ # Set x-goog-api-client and x-goog-user-project headers
1370
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1372
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1373
+ transports_version_send: [:rest]
1374
+
1375
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1376
+
1377
+ options.apply_defaults timeout: @config.rpcs.analyze_iam_policy.timeout,
1378
+ metadata: call_metadata,
1379
+ retry_policy: @config.rpcs.analyze_iam_policy.retry_policy
1380
+
1381
+ options.apply_defaults timeout: @config.timeout,
1382
+ metadata: @config.metadata,
1383
+ retry_policy: @config.retry_policy
1384
+
1385
+ @asset_service_stub.analyze_iam_policy request, options do |result, operation|
1386
+ yield result, operation if block_given?
1387
+ return result
1388
+ end
1389
+ rescue ::Gapic::Rest::Error => e
1390
+ raise ::Google::Cloud::Error.from_error(e)
1391
+ end
1392
+
1393
+ ##
1394
+ # Analyzes IAM policies asynchronously to answer which identities have what
1395
+ # accesses on which resources, and writes the analysis results to a Google
1396
+ # Cloud Storage or a BigQuery destination. For Cloud Storage destination, the
1397
+ # output format is the JSON format that represents a
1398
+ # {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse AnalyzeIamPolicyResponse}.
1399
+ # This method implements the
1400
+ # {::Google::Longrunning::Operation google.longrunning.Operation}, which allows
1401
+ # you to track the operation status. We recommend intervals of at least 2
1402
+ # seconds with exponential backoff retry to poll the operation result. The
1403
+ # metadata contains the metadata for the long-running operation.
1404
+ #
1405
+ # @overload analyze_iam_policy_longrunning(request, options = nil)
1406
+ # Pass arguments to `analyze_iam_policy_longrunning` via a request object, either of type
1407
+ # {::Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest} or an equivalent Hash.
1408
+ #
1409
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest, ::Hash]
1410
+ # A request object representing the call parameters. Required. To specify no
1411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1412
+ # @param options [::Gapic::CallOptions, ::Hash]
1413
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1414
+ #
1415
+ # @overload analyze_iam_policy_longrunning(analysis_query: nil, saved_analysis_query: nil, output_config: nil)
1416
+ # Pass arguments to `analyze_iam_policy_longrunning` via keyword arguments. Note that at
1417
+ # least one keyword argument is required. To specify no parameters, or to keep all
1418
+ # the default parameter values, pass an empty Hash as a request object (see above).
1419
+ #
1420
+ # @param analysis_query [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery, ::Hash]
1421
+ # Required. The request query.
1422
+ # @param saved_analysis_query [::String]
1423
+ # Optional. The name of a saved query, which must be in the format of:
1424
+ #
1425
+ # * projects/project_number/savedQueries/saved_query_id
1426
+ # * folders/folder_number/savedQueries/saved_query_id
1427
+ # * organizations/organization_number/savedQueries/saved_query_id
1428
+ #
1429
+ # If both `analysis_query` and `saved_analysis_query` are provided, they
1430
+ # will be merged together with the `saved_analysis_query` as base and
1431
+ # the `analysis_query` as overrides. For more details of the merge behavior,
1432
+ # please refer to the
1433
+ # [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details)
1434
+ # doc.
1435
+ #
1436
+ # Note that you cannot override primitive fields with default value, such as
1437
+ # 0 or empty string, etc., because we use proto3, which doesn't support field
1438
+ # presence yet.
1439
+ # @param output_config [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig, ::Hash]
1440
+ # Required. Output configuration indicating where the results will be output
1441
+ # to.
1442
+ # @yield [result, operation] Access the result along with the TransportOperation object
1443
+ # @yieldparam result [::Gapic::Operation]
1444
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1445
+ #
1446
+ # @return [::Gapic::Operation]
1447
+ #
1448
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1449
+ def analyze_iam_policy_longrunning request, options = nil
1450
+ raise ::ArgumentError, "request must be provided" if request.nil?
1451
+
1452
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest
1453
+
1454
+ # Converts hash and nil to an options object
1455
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1456
+
1457
+ # Customize the options with defaults
1458
+ call_metadata = @config.rpcs.analyze_iam_policy_longrunning.metadata.to_h
1459
+
1460
+ # Set x-goog-api-client and x-goog-user-project headers
1461
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1462
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1463
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1464
+ transports_version_send: [:rest]
1465
+
1466
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1467
+
1468
+ options.apply_defaults timeout: @config.rpcs.analyze_iam_policy_longrunning.timeout,
1469
+ metadata: call_metadata,
1470
+ retry_policy: @config.rpcs.analyze_iam_policy_longrunning.retry_policy
1471
+
1472
+ options.apply_defaults timeout: @config.timeout,
1473
+ metadata: @config.metadata,
1474
+ retry_policy: @config.retry_policy
1475
+
1476
+ @asset_service_stub.analyze_iam_policy_longrunning request, options do |result, operation|
1477
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1478
+ yield result, operation if block_given?
1479
+ return result
1480
+ end
1481
+ rescue ::Gapic::Rest::Error => e
1482
+ raise ::Google::Cloud::Error.from_error(e)
1483
+ end
1484
+
1485
+ ##
1486
+ # Analyze moving a resource to a specified destination without kicking off
1487
+ # the actual move. The analysis is best effort depending on the user's
1488
+ # permissions of viewing different hierarchical policies and configurations.
1489
+ # The policies and configuration are subject to change before the actual
1490
+ # resource migration takes place.
1491
+ #
1492
+ # @overload analyze_move(request, options = nil)
1493
+ # Pass arguments to `analyze_move` via a request object, either of type
1494
+ # {::Google::Cloud::Asset::V1::AnalyzeMoveRequest} or an equivalent Hash.
1495
+ #
1496
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeMoveRequest, ::Hash]
1497
+ # A request object representing the call parameters. Required. To specify no
1498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1499
+ # @param options [::Gapic::CallOptions, ::Hash]
1500
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1501
+ #
1502
+ # @overload analyze_move(resource: nil, destination_parent: nil, view: nil)
1503
+ # Pass arguments to `analyze_move` via keyword arguments. Note that at
1504
+ # least one keyword argument is required. To specify no parameters, or to keep all
1505
+ # the default parameter values, pass an empty Hash as a request object (see above).
1506
+ #
1507
+ # @param resource [::String]
1508
+ # Required. Name of the resource to perform the analysis against.
1509
+ # Only Google Cloud projects are supported as of today. Hence, this can only
1510
+ # be a project ID (such as "projects/my-project-id") or a project number
1511
+ # (such as "projects/12345").
1512
+ # @param destination_parent [::String]
1513
+ # Required. Name of the Google Cloud folder or organization to reparent the
1514
+ # target resource. The analysis will be performed against hypothetically
1515
+ # moving the resource to this specified desitination parent. This can only be
1516
+ # a folder number (such as "folders/123") or an organization number (such as
1517
+ # "organizations/123").
1518
+ # @param view [::Google::Cloud::Asset::V1::AnalyzeMoveRequest::AnalysisView]
1519
+ # Analysis view indicating what information should be included in the
1520
+ # analysis response. If unspecified, the default view is FULL.
1521
+ # @yield [result, operation] Access the result along with the TransportOperation object
1522
+ # @yieldparam result [::Google::Cloud::Asset::V1::AnalyzeMoveResponse]
1523
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1524
+ #
1525
+ # @return [::Google::Cloud::Asset::V1::AnalyzeMoveResponse]
1526
+ #
1527
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1528
+ def analyze_move request, options = nil
1529
+ raise ::ArgumentError, "request must be provided" if request.nil?
1530
+
1531
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeMoveRequest
1532
+
1533
+ # Converts hash and nil to an options object
1534
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1535
+
1536
+ # Customize the options with defaults
1537
+ call_metadata = @config.rpcs.analyze_move.metadata.to_h
1538
+
1539
+ # Set x-goog-api-client and x-goog-user-project headers
1540
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1541
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1542
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1543
+ transports_version_send: [:rest]
1544
+
1545
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1546
+
1547
+ options.apply_defaults timeout: @config.rpcs.analyze_move.timeout,
1548
+ metadata: call_metadata,
1549
+ retry_policy: @config.rpcs.analyze_move.retry_policy
1550
+
1551
+ options.apply_defaults timeout: @config.timeout,
1552
+ metadata: @config.metadata,
1553
+ retry_policy: @config.retry_policy
1554
+
1555
+ @asset_service_stub.analyze_move request, options do |result, operation|
1556
+ yield result, operation if block_given?
1557
+ return result
1558
+ end
1559
+ rescue ::Gapic::Rest::Error => e
1560
+ raise ::Google::Cloud::Error.from_error(e)
1561
+ end
1562
+
1563
+ ##
1564
+ # Issue a job that queries assets using a SQL statement compatible with
1565
+ # [BigQuery Standard
1566
+ # SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
1567
+ #
1568
+ # If the query execution finishes within timeout and there's no pagination,
1569
+ # the full query results will be returned in the `QueryAssetsResponse`.
1570
+ #
1571
+ # Otherwise, full query results can be obtained by issuing extra requests
1572
+ # with the `job_reference` from the a previous `QueryAssets` call.
1573
+ #
1574
+ # Note, the query result has approximately 10 GB limitation enforced by
1575
+ # BigQuery
1576
+ # https://cloud.google.com/bigquery/docs/best-practices-performance-output,
1577
+ # queries return larger results will result in errors.
1578
+ #
1579
+ # @overload query_assets(request, options = nil)
1580
+ # Pass arguments to `query_assets` via a request object, either of type
1581
+ # {::Google::Cloud::Asset::V1::QueryAssetsRequest} or an equivalent Hash.
1582
+ #
1583
+ # @param request [::Google::Cloud::Asset::V1::QueryAssetsRequest, ::Hash]
1584
+ # A request object representing the call parameters. Required. To specify no
1585
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1586
+ # @param options [::Gapic::CallOptions, ::Hash]
1587
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1588
+ #
1589
+ # @overload query_assets(parent: nil, statement: nil, job_reference: nil, page_size: nil, page_token: nil, timeout: nil, read_time_window: nil, read_time: nil, output_config: nil)
1590
+ # Pass arguments to `query_assets` via keyword arguments. Note that at
1591
+ # least one keyword argument is required. To specify no parameters, or to keep all
1592
+ # the default parameter values, pass an empty Hash as a request object (see above).
1593
+ #
1594
+ # @param parent [::String]
1595
+ # Required. The relative name of the root asset. This can only be an
1596
+ # organization number (such as "organizations/123"), a project ID (such as
1597
+ # "projects/my-project-id"), or a project number (such as "projects/12345"),
1598
+ # or a folder number (such as "folders/123").
1599
+ #
1600
+ # Only assets belonging to the `parent` will be returned.
1601
+ # @param statement [::String]
1602
+ # Optional. A SQL statement that's compatible with [BigQuery Standard
1603
+ # SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
1604
+ # @param job_reference [::String]
1605
+ # Optional. Reference to the query job, which is from the
1606
+ # `QueryAssetsResponse` of previous `QueryAssets` call.
1607
+ # @param page_size [::Integer]
1608
+ # Optional. The maximum number of rows to return in the results. Responses
1609
+ # are limited to 10 MB and 1000 rows.
1610
+ #
1611
+ # By default, the maximum row count is 1000. When the byte or row count limit
1612
+ # is reached, the rest of the query results will be paginated.
1613
+ #
1614
+ # The field will be ignored when [output_config] is specified.
1615
+ # @param page_token [::String]
1616
+ # Optional. A page token received from previous `QueryAssets`.
1617
+ #
1618
+ # The field will be ignored when [output_config] is specified.
1619
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
1620
+ # Optional. Specifies the maximum amount of time that the client is willing
1621
+ # to wait for the query to complete. By default, this limit is 5 min for the
1622
+ # first query, and 1 minute for the following queries. If the query is
1623
+ # complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
1624
+ # false.
1625
+ #
1626
+ # Like BigQuery [jobs.query
1627
+ # API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
1628
+ # The call is not guaranteed to wait for the specified timeout; it typically
1629
+ # returns after around 200 seconds (200,000 milliseconds), even if the query
1630
+ # is not complete.
1631
+ #
1632
+ # The field will be ignored when [output_config] is specified.
1633
+ # @param read_time_window [::Google::Cloud::Asset::V1::TimeWindow, ::Hash]
1634
+ # Optional. [start_time] is required. [start_time] must be less than
1635
+ # [end_time] Defaults [end_time] to now if [start_time] is set and
1636
+ # [end_time] isn't. Maximum permitted time range is 7 days.
1637
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1638
+ # Optional. Queries cloud assets as they appeared at the specified point in
1639
+ # time.
1640
+ # @param output_config [::Google::Cloud::Asset::V1::QueryAssetsOutputConfig, ::Hash]
1641
+ # Optional. Destination where the query results will be saved.
1642
+ #
1643
+ # When this field is specified, the query results won't be saved in the
1644
+ # [QueryAssetsResponse.query_result]. Instead
1645
+ # [QueryAssetsResponse.output_config] will be set.
1646
+ #
1647
+ # Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
1648
+ # to check the status of the query job when passed to a following
1649
+ # [QueryAssets] API call.
1650
+ # @yield [result, operation] Access the result along with the TransportOperation object
1651
+ # @yieldparam result [::Google::Cloud::Asset::V1::QueryAssetsResponse]
1652
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1653
+ #
1654
+ # @return [::Google::Cloud::Asset::V1::QueryAssetsResponse]
1655
+ #
1656
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1657
+ def query_assets request, options = nil
1658
+ raise ::ArgumentError, "request must be provided" if request.nil?
1659
+
1660
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::QueryAssetsRequest
1661
+
1662
+ # Converts hash and nil to an options object
1663
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1664
+
1665
+ # Customize the options with defaults
1666
+ call_metadata = @config.rpcs.query_assets.metadata.to_h
1667
+
1668
+ # Set x-goog-api-client and x-goog-user-project headers
1669
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1670
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1671
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1672
+ transports_version_send: [:rest]
1673
+
1674
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1675
+
1676
+ options.apply_defaults timeout: @config.rpcs.query_assets.timeout,
1677
+ metadata: call_metadata,
1678
+ retry_policy: @config.rpcs.query_assets.retry_policy
1679
+
1680
+ options.apply_defaults timeout: @config.timeout,
1681
+ metadata: @config.metadata,
1682
+ retry_policy: @config.retry_policy
1683
+
1684
+ @asset_service_stub.query_assets request, options do |result, operation|
1685
+ yield result, operation if block_given?
1686
+ return result
1687
+ end
1688
+ rescue ::Gapic::Rest::Error => e
1689
+ raise ::Google::Cloud::Error.from_error(e)
1690
+ end
1691
+
1692
+ ##
1693
+ # Creates a saved query in a parent project/folder/organization.
1694
+ #
1695
+ # @overload create_saved_query(request, options = nil)
1696
+ # Pass arguments to `create_saved_query` via a request object, either of type
1697
+ # {::Google::Cloud::Asset::V1::CreateSavedQueryRequest} or an equivalent Hash.
1698
+ #
1699
+ # @param request [::Google::Cloud::Asset::V1::CreateSavedQueryRequest, ::Hash]
1700
+ # A request object representing the call parameters. Required. To specify no
1701
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1702
+ # @param options [::Gapic::CallOptions, ::Hash]
1703
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1704
+ #
1705
+ # @overload create_saved_query(parent: nil, saved_query: nil, saved_query_id: nil)
1706
+ # Pass arguments to `create_saved_query` via keyword arguments. Note that at
1707
+ # least one keyword argument is required. To specify no parameters, or to keep all
1708
+ # the default parameter values, pass an empty Hash as a request object (see above).
1709
+ #
1710
+ # @param parent [::String]
1711
+ # Required. The name of the project/folder/organization where this
1712
+ # saved_query should be created in. It can only be an organization number
1713
+ # (such as "organizations/123"), a folder number (such as "folders/123"), a
1714
+ # project ID (such as "projects/my-project-id"), or a project number (such as
1715
+ # "projects/12345").
1716
+ # @param saved_query [::Google::Cloud::Asset::V1::SavedQuery, ::Hash]
1717
+ # Required. The saved_query details. The `name` field must be empty as it
1718
+ # will be generated based on the parent and saved_query_id.
1719
+ # @param saved_query_id [::String]
1720
+ # Required. The ID to use for the saved query, which must be unique in the
1721
+ # specified parent. It will become the final component of the saved query's
1722
+ # resource name.
1723
+ #
1724
+ # This value should be 4-63 characters, and valid characters
1725
+ # are `[a-z][0-9]-`.
1726
+ #
1727
+ # Notice that this field is required in the saved query creation, and the
1728
+ # `name` field of the `saved_query` will be ignored.
1729
+ # @yield [result, operation] Access the result along with the TransportOperation object
1730
+ # @yieldparam result [::Google::Cloud::Asset::V1::SavedQuery]
1731
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1732
+ #
1733
+ # @return [::Google::Cloud::Asset::V1::SavedQuery]
1734
+ #
1735
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1736
+ def create_saved_query request, options = nil
1737
+ raise ::ArgumentError, "request must be provided" if request.nil?
1738
+
1739
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::CreateSavedQueryRequest
1740
+
1741
+ # Converts hash and nil to an options object
1742
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1743
+
1744
+ # Customize the options with defaults
1745
+ call_metadata = @config.rpcs.create_saved_query.metadata.to_h
1746
+
1747
+ # Set x-goog-api-client and x-goog-user-project headers
1748
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1749
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1750
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1751
+ transports_version_send: [:rest]
1752
+
1753
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1754
+
1755
+ options.apply_defaults timeout: @config.rpcs.create_saved_query.timeout,
1756
+ metadata: call_metadata,
1757
+ retry_policy: @config.rpcs.create_saved_query.retry_policy
1758
+
1759
+ options.apply_defaults timeout: @config.timeout,
1760
+ metadata: @config.metadata,
1761
+ retry_policy: @config.retry_policy
1762
+
1763
+ @asset_service_stub.create_saved_query request, options do |result, operation|
1764
+ yield result, operation if block_given?
1765
+ return result
1766
+ end
1767
+ rescue ::Gapic::Rest::Error => e
1768
+ raise ::Google::Cloud::Error.from_error(e)
1769
+ end
1770
+
1771
+ ##
1772
+ # Gets details about a saved query.
1773
+ #
1774
+ # @overload get_saved_query(request, options = nil)
1775
+ # Pass arguments to `get_saved_query` via a request object, either of type
1776
+ # {::Google::Cloud::Asset::V1::GetSavedQueryRequest} or an equivalent Hash.
1777
+ #
1778
+ # @param request [::Google::Cloud::Asset::V1::GetSavedQueryRequest, ::Hash]
1779
+ # A request object representing the call parameters. Required. To specify no
1780
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1781
+ # @param options [::Gapic::CallOptions, ::Hash]
1782
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1783
+ #
1784
+ # @overload get_saved_query(name: nil)
1785
+ # Pass arguments to `get_saved_query` via keyword arguments. Note that at
1786
+ # least one keyword argument is required. To specify no parameters, or to keep all
1787
+ # the default parameter values, pass an empty Hash as a request object (see above).
1788
+ #
1789
+ # @param name [::String]
1790
+ # Required. The name of the saved query and it must be in the format of:
1791
+ #
1792
+ # * projects/project_number/savedQueries/saved_query_id
1793
+ # * folders/folder_number/savedQueries/saved_query_id
1794
+ # * organizations/organization_number/savedQueries/saved_query_id
1795
+ # @yield [result, operation] Access the result along with the TransportOperation object
1796
+ # @yieldparam result [::Google::Cloud::Asset::V1::SavedQuery]
1797
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1798
+ #
1799
+ # @return [::Google::Cloud::Asset::V1::SavedQuery]
1800
+ #
1801
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1802
+ def get_saved_query request, options = nil
1803
+ raise ::ArgumentError, "request must be provided" if request.nil?
1804
+
1805
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::GetSavedQueryRequest
1806
+
1807
+ # Converts hash and nil to an options object
1808
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1809
+
1810
+ # Customize the options with defaults
1811
+ call_metadata = @config.rpcs.get_saved_query.metadata.to_h
1812
+
1813
+ # Set x-goog-api-client and x-goog-user-project headers
1814
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1815
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1816
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1817
+ transports_version_send: [:rest]
1818
+
1819
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1820
+
1821
+ options.apply_defaults timeout: @config.rpcs.get_saved_query.timeout,
1822
+ metadata: call_metadata,
1823
+ retry_policy: @config.rpcs.get_saved_query.retry_policy
1824
+
1825
+ options.apply_defaults timeout: @config.timeout,
1826
+ metadata: @config.metadata,
1827
+ retry_policy: @config.retry_policy
1828
+
1829
+ @asset_service_stub.get_saved_query request, options do |result, operation|
1830
+ yield result, operation if block_given?
1831
+ return result
1832
+ end
1833
+ rescue ::Gapic::Rest::Error => e
1834
+ raise ::Google::Cloud::Error.from_error(e)
1835
+ end
1836
+
1837
+ ##
1838
+ # Lists all saved queries in a parent project/folder/organization.
1839
+ #
1840
+ # @overload list_saved_queries(request, options = nil)
1841
+ # Pass arguments to `list_saved_queries` via a request object, either of type
1842
+ # {::Google::Cloud::Asset::V1::ListSavedQueriesRequest} or an equivalent Hash.
1843
+ #
1844
+ # @param request [::Google::Cloud::Asset::V1::ListSavedQueriesRequest, ::Hash]
1845
+ # A request object representing the call parameters. Required. To specify no
1846
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1847
+ # @param options [::Gapic::CallOptions, ::Hash]
1848
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1849
+ #
1850
+ # @overload list_saved_queries(parent: nil, filter: nil, page_size: nil, page_token: nil)
1851
+ # Pass arguments to `list_saved_queries` via keyword arguments. Note that at
1852
+ # least one keyword argument is required. To specify no parameters, or to keep all
1853
+ # the default parameter values, pass an empty Hash as a request object (see above).
1854
+ #
1855
+ # @param parent [::String]
1856
+ # Required. The parent project/folder/organization whose savedQueries are to
1857
+ # be listed. It can only be using project/folder/organization number (such as
1858
+ # "folders/12345")", or a project ID (such as "projects/my-project-id").
1859
+ # @param filter [::String]
1860
+ # Optional. The expression to filter resources.
1861
+ # The expression is a list of zero or more restrictions combined via logical
1862
+ # operators `AND` and `OR`. When `AND` and `OR` are both used in the
1863
+ # expression, parentheses must be appropriately used to group the
1864
+ # combinations. The expression may also contain regular expressions.
1865
+ #
1866
+ # See https://google.aip.dev/160 for more information on the grammar.
1867
+ # @param page_size [::Integer]
1868
+ # Optional. The maximum number of saved queries to return per page. The
1869
+ # service may return fewer than this value. If unspecified, at most 50 will
1870
+ # be returned. The maximum value is 1000; values above 1000 will be coerced
1871
+ # to 1000.
1872
+ # @param page_token [::String]
1873
+ # Optional. A page token, received from a previous `ListSavedQueries` call.
1874
+ # Provide this to retrieve the subsequent page.
1875
+ #
1876
+ # When paginating, all other parameters provided to `ListSavedQueries` must
1877
+ # match the call that provided the page token.
1878
+ # @yield [result, operation] Access the result along with the TransportOperation object
1879
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::SavedQuery>]
1880
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1881
+ #
1882
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::SavedQuery>]
1883
+ #
1884
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1885
+ def list_saved_queries request, options = nil
1886
+ raise ::ArgumentError, "request must be provided" if request.nil?
1887
+
1888
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListSavedQueriesRequest
1889
+
1890
+ # Converts hash and nil to an options object
1891
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1892
+
1893
+ # Customize the options with defaults
1894
+ call_metadata = @config.rpcs.list_saved_queries.metadata.to_h
1895
+
1896
+ # Set x-goog-api-client and x-goog-user-project headers
1897
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1898
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1899
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1900
+ transports_version_send: [:rest]
1901
+
1902
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1903
+
1904
+ options.apply_defaults timeout: @config.rpcs.list_saved_queries.timeout,
1905
+ metadata: call_metadata,
1906
+ retry_policy: @config.rpcs.list_saved_queries.retry_policy
1907
+
1908
+ options.apply_defaults timeout: @config.timeout,
1909
+ metadata: @config.metadata,
1910
+ retry_policy: @config.retry_policy
1911
+
1912
+ @asset_service_stub.list_saved_queries request, options do |result, operation|
1913
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :list_saved_queries, "saved_queries", request, result, options
1914
+ yield result, operation if block_given?
1915
+ return result
1916
+ end
1917
+ rescue ::Gapic::Rest::Error => e
1918
+ raise ::Google::Cloud::Error.from_error(e)
1919
+ end
1920
+
1921
+ ##
1922
+ # Updates a saved query.
1923
+ #
1924
+ # @overload update_saved_query(request, options = nil)
1925
+ # Pass arguments to `update_saved_query` via a request object, either of type
1926
+ # {::Google::Cloud::Asset::V1::UpdateSavedQueryRequest} or an equivalent Hash.
1927
+ #
1928
+ # @param request [::Google::Cloud::Asset::V1::UpdateSavedQueryRequest, ::Hash]
1929
+ # A request object representing the call parameters. Required. To specify no
1930
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1931
+ # @param options [::Gapic::CallOptions, ::Hash]
1932
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1933
+ #
1934
+ # @overload update_saved_query(saved_query: nil, update_mask: nil)
1935
+ # Pass arguments to `update_saved_query` via keyword arguments. Note that at
1936
+ # least one keyword argument is required. To specify no parameters, or to keep all
1937
+ # the default parameter values, pass an empty Hash as a request object (see above).
1938
+ #
1939
+ # @param saved_query [::Google::Cloud::Asset::V1::SavedQuery, ::Hash]
1940
+ # Required. The saved query to update.
1941
+ #
1942
+ # The saved query's `name` field is used to identify the one to update,
1943
+ # which has format as below:
1944
+ #
1945
+ # * projects/project_number/savedQueries/saved_query_id
1946
+ # * folders/folder_number/savedQueries/saved_query_id
1947
+ # * organizations/organization_number/savedQueries/saved_query_id
1948
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1949
+ # Required. The list of fields to update.
1950
+ # @yield [result, operation] Access the result along with the TransportOperation object
1951
+ # @yieldparam result [::Google::Cloud::Asset::V1::SavedQuery]
1952
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1953
+ #
1954
+ # @return [::Google::Cloud::Asset::V1::SavedQuery]
1955
+ #
1956
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1957
+ def update_saved_query request, options = nil
1958
+ raise ::ArgumentError, "request must be provided" if request.nil?
1959
+
1960
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::UpdateSavedQueryRequest
1961
+
1962
+ # Converts hash and nil to an options object
1963
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1964
+
1965
+ # Customize the options with defaults
1966
+ call_metadata = @config.rpcs.update_saved_query.metadata.to_h
1967
+
1968
+ # Set x-goog-api-client and x-goog-user-project headers
1969
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1970
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1971
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
1972
+ transports_version_send: [:rest]
1973
+
1974
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1975
+
1976
+ options.apply_defaults timeout: @config.rpcs.update_saved_query.timeout,
1977
+ metadata: call_metadata,
1978
+ retry_policy: @config.rpcs.update_saved_query.retry_policy
1979
+
1980
+ options.apply_defaults timeout: @config.timeout,
1981
+ metadata: @config.metadata,
1982
+ retry_policy: @config.retry_policy
1983
+
1984
+ @asset_service_stub.update_saved_query request, options do |result, operation|
1985
+ yield result, operation if block_given?
1986
+ return result
1987
+ end
1988
+ rescue ::Gapic::Rest::Error => e
1989
+ raise ::Google::Cloud::Error.from_error(e)
1990
+ end
1991
+
1992
+ ##
1993
+ # Deletes a saved query.
1994
+ #
1995
+ # @overload delete_saved_query(request, options = nil)
1996
+ # Pass arguments to `delete_saved_query` via a request object, either of type
1997
+ # {::Google::Cloud::Asset::V1::DeleteSavedQueryRequest} or an equivalent Hash.
1998
+ #
1999
+ # @param request [::Google::Cloud::Asset::V1::DeleteSavedQueryRequest, ::Hash]
2000
+ # A request object representing the call parameters. Required. To specify no
2001
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2002
+ # @param options [::Gapic::CallOptions, ::Hash]
2003
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2004
+ #
2005
+ # @overload delete_saved_query(name: nil)
2006
+ # Pass arguments to `delete_saved_query` via keyword arguments. Note that at
2007
+ # least one keyword argument is required. To specify no parameters, or to keep all
2008
+ # the default parameter values, pass an empty Hash as a request object (see above).
2009
+ #
2010
+ # @param name [::String]
2011
+ # Required. The name of the saved query to delete. It must be in the format
2012
+ # of:
2013
+ #
2014
+ # * projects/project_number/savedQueries/saved_query_id
2015
+ # * folders/folder_number/savedQueries/saved_query_id
2016
+ # * organizations/organization_number/savedQueries/saved_query_id
2017
+ # @yield [result, operation] Access the result along with the TransportOperation object
2018
+ # @yieldparam result [::Google::Protobuf::Empty]
2019
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2020
+ #
2021
+ # @return [::Google::Protobuf::Empty]
2022
+ #
2023
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2024
+ def delete_saved_query request, options = nil
2025
+ raise ::ArgumentError, "request must be provided" if request.nil?
2026
+
2027
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::DeleteSavedQueryRequest
2028
+
2029
+ # Converts hash and nil to an options object
2030
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2031
+
2032
+ # Customize the options with defaults
2033
+ call_metadata = @config.rpcs.delete_saved_query.metadata.to_h
2034
+
2035
+ # Set x-goog-api-client and x-goog-user-project headers
2036
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2037
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2038
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
2039
+ transports_version_send: [:rest]
2040
+
2041
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2042
+
2043
+ options.apply_defaults timeout: @config.rpcs.delete_saved_query.timeout,
2044
+ metadata: call_metadata,
2045
+ retry_policy: @config.rpcs.delete_saved_query.retry_policy
2046
+
2047
+ options.apply_defaults timeout: @config.timeout,
2048
+ metadata: @config.metadata,
2049
+ retry_policy: @config.retry_policy
2050
+
2051
+ @asset_service_stub.delete_saved_query request, options do |result, operation|
2052
+ yield result, operation if block_given?
2053
+ return result
2054
+ end
2055
+ rescue ::Gapic::Rest::Error => e
2056
+ raise ::Google::Cloud::Error.from_error(e)
2057
+ end
2058
+
2059
+ ##
2060
+ # Gets effective IAM policies for a batch of resources.
2061
+ #
2062
+ # @overload batch_get_effective_iam_policies(request, options = nil)
2063
+ # Pass arguments to `batch_get_effective_iam_policies` via a request object, either of type
2064
+ # {::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest} or an equivalent Hash.
2065
+ #
2066
+ # @param request [::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest, ::Hash]
2067
+ # A request object representing the call parameters. Required. To specify no
2068
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2069
+ # @param options [::Gapic::CallOptions, ::Hash]
2070
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2071
+ #
2072
+ # @overload batch_get_effective_iam_policies(scope: nil, names: nil)
2073
+ # Pass arguments to `batch_get_effective_iam_policies` via keyword arguments. Note that at
2074
+ # least one keyword argument is required. To specify no parameters, or to keep all
2075
+ # the default parameter values, pass an empty Hash as a request object (see above).
2076
+ #
2077
+ # @param scope [::String]
2078
+ # Required. Only IAM policies on or below the scope will be returned.
2079
+ #
2080
+ # This can only be an organization number (such as "organizations/123"), a
2081
+ # folder number (such as "folders/123"), a project ID (such as
2082
+ # "projects/my-project-id"), or a project number (such as "projects/12345").
2083
+ #
2084
+ # To know how to get organization id, visit [here
2085
+ # ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
2086
+ #
2087
+ # To know how to get folder or project id, visit [here
2088
+ # ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects).
2089
+ # @param names [::Array<::String>]
2090
+ # Required. The names refer to the [full_resource_names]
2091
+ # (https://cloud.google.com/asset-inventory/docs/resource-name-format)
2092
+ # of [searchable asset
2093
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
2094
+ # A maximum of 20 resources' effective policies can be retrieved in a batch.
2095
+ # @yield [result, operation] Access the result along with the TransportOperation object
2096
+ # @yieldparam result [::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse]
2097
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2098
+ #
2099
+ # @return [::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse]
2100
+ #
2101
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2102
+ def batch_get_effective_iam_policies request, options = nil
2103
+ raise ::ArgumentError, "request must be provided" if request.nil?
2104
+
2105
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest
2106
+
2107
+ # Converts hash and nil to an options object
2108
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2109
+
2110
+ # Customize the options with defaults
2111
+ call_metadata = @config.rpcs.batch_get_effective_iam_policies.metadata.to_h
2112
+
2113
+ # Set x-goog-api-client and x-goog-user-project headers
2114
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2115
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2116
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
2117
+ transports_version_send: [:rest]
2118
+
2119
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2120
+
2121
+ options.apply_defaults timeout: @config.rpcs.batch_get_effective_iam_policies.timeout,
2122
+ metadata: call_metadata,
2123
+ retry_policy: @config.rpcs.batch_get_effective_iam_policies.retry_policy
2124
+
2125
+ options.apply_defaults timeout: @config.timeout,
2126
+ metadata: @config.metadata,
2127
+ retry_policy: @config.retry_policy
2128
+
2129
+ @asset_service_stub.batch_get_effective_iam_policies request, options do |result, operation|
2130
+ yield result, operation if block_given?
2131
+ return result
2132
+ end
2133
+ rescue ::Gapic::Rest::Error => e
2134
+ raise ::Google::Cloud::Error.from_error(e)
2135
+ end
2136
+
2137
+ ##
2138
+ # Analyzes organization policies under a scope.
2139
+ #
2140
+ # @overload analyze_org_policies(request, options = nil)
2141
+ # Pass arguments to `analyze_org_policies` via a request object, either of type
2142
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest} or an equivalent Hash.
2143
+ #
2144
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest, ::Hash]
2145
+ # A request object representing the call parameters. Required. To specify no
2146
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2147
+ # @param options [::Gapic::CallOptions, ::Hash]
2148
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2149
+ #
2150
+ # @overload analyze_org_policies(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2151
+ # Pass arguments to `analyze_org_policies` via keyword arguments. Note that at
2152
+ # least one keyword argument is required. To specify no parameters, or to keep all
2153
+ # the default parameter values, pass an empty Hash as a request object (see above).
2154
+ #
2155
+ # @param scope [::String]
2156
+ # Required. The organization to scope the request. Only organization
2157
+ # policies within the scope will be analyzed.
2158
+ #
2159
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2160
+ # @param constraint [::String]
2161
+ # Required. The name of the constraint to analyze organization policies for.
2162
+ # The response only contains analyzed organization policies for the provided
2163
+ # constraint.
2164
+ # @param filter [::String]
2165
+ # The expression to filter
2166
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}.
2167
+ # The only supported field is `consolidated_policy.attached_resource`, and
2168
+ # the only supported operator is `=`.
2169
+ #
2170
+ # Example:
2171
+ # consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001"
2172
+ # will return the org policy results of"folders/001".
2173
+ # @param page_size [::Integer]
2174
+ # The maximum number of items to return per page. If unspecified,
2175
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}
2176
+ # will contain 20 items with a maximum of 200.
2177
+ # @param page_token [::String]
2178
+ # The pagination token to retrieve the next page.
2179
+ # @yield [result, operation] Access the result along with the TransportOperation object
2180
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
2181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2182
+ #
2183
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
2184
+ #
2185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2186
+ def analyze_org_policies request, options = nil
2187
+ raise ::ArgumentError, "request must be provided" if request.nil?
2188
+
2189
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest
2190
+
2191
+ # Converts hash and nil to an options object
2192
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2193
+
2194
+ # Customize the options with defaults
2195
+ call_metadata = @config.rpcs.analyze_org_policies.metadata.to_h
2196
+
2197
+ # Set x-goog-api-client and x-goog-user-project headers
2198
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2199
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2200
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
2201
+ transports_version_send: [:rest]
2202
+
2203
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2204
+
2205
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policies.timeout,
2206
+ metadata: call_metadata,
2207
+ retry_policy: @config.rpcs.analyze_org_policies.retry_policy
2208
+
2209
+ options.apply_defaults timeout: @config.timeout,
2210
+ metadata: @config.metadata,
2211
+ retry_policy: @config.retry_policy
2212
+
2213
+ @asset_service_stub.analyze_org_policies request, options do |result, operation|
2214
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, "org_policy_results", request, result, options
2215
+ yield result, operation if block_given?
2216
+ return result
2217
+ end
2218
+ rescue ::Gapic::Rest::Error => e
2219
+ raise ::Google::Cloud::Error.from_error(e)
2220
+ end
2221
+
2222
+ ##
2223
+ # Analyzes organization policies governed containers (projects, folders or
2224
+ # organization) under a scope.
2225
+ #
2226
+ # @overload analyze_org_policy_governed_containers(request, options = nil)
2227
+ # Pass arguments to `analyze_org_policy_governed_containers` via a request object, either of type
2228
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest} or an equivalent Hash.
2229
+ #
2230
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest, ::Hash]
2231
+ # A request object representing the call parameters. Required. To specify no
2232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2233
+ # @param options [::Gapic::CallOptions, ::Hash]
2234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2235
+ #
2236
+ # @overload analyze_org_policy_governed_containers(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2237
+ # Pass arguments to `analyze_org_policy_governed_containers` via keyword arguments. Note that at
2238
+ # least one keyword argument is required. To specify no parameters, or to keep all
2239
+ # the default parameter values, pass an empty Hash as a request object (see above).
2240
+ #
2241
+ # @param scope [::String]
2242
+ # Required. The organization to scope the request. Only organization
2243
+ # policies within the scope will be analyzed. The output containers will
2244
+ # also be limited to the ones governed by those in-scope organization
2245
+ # policies.
2246
+ #
2247
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2248
+ # @param constraint [::String]
2249
+ # Required. The name of the constraint to analyze governed containers for.
2250
+ # The analysis only contains organization policies for the provided
2251
+ # constraint.
2252
+ # @param filter [::String]
2253
+ # The expression to filter the governed containers in result.
2254
+ # The only supported field is `parent`, and the only supported operator is
2255
+ # `=`.
2256
+ #
2257
+ # Example:
2258
+ # parent="//cloudresourcemanager.googleapis.com/folders/001" will return all
2259
+ # containers under "folders/001".
2260
+ # @param page_size [::Integer]
2261
+ # The maximum number of items to return per page. If unspecified,
2262
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse#governed_containers AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}
2263
+ # will contain 100 items with a maximum of 200.
2264
+ # @param page_token [::String]
2265
+ # The pagination token to retrieve the next page.
2266
+ # @yield [result, operation] Access the result along with the TransportOperation object
2267
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
2268
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2269
+ #
2270
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
2271
+ #
2272
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2273
+ def analyze_org_policy_governed_containers request, options = nil
2274
+ raise ::ArgumentError, "request must be provided" if request.nil?
2275
+
2276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest
2277
+
2278
+ # Converts hash and nil to an options object
2279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2280
+
2281
+ # Customize the options with defaults
2282
+ call_metadata = @config.rpcs.analyze_org_policy_governed_containers.metadata.to_h
2283
+
2284
+ # Set x-goog-api-client and x-goog-user-project headers
2285
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2287
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
2288
+ transports_version_send: [:rest]
2289
+
2290
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2291
+
2292
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_containers.timeout,
2293
+ metadata: call_metadata,
2294
+ retry_policy: @config.rpcs.analyze_org_policy_governed_containers.retry_policy
2295
+
2296
+ options.apply_defaults timeout: @config.timeout,
2297
+ metadata: @config.metadata,
2298
+ retry_policy: @config.retry_policy
2299
+
2300
+ @asset_service_stub.analyze_org_policy_governed_containers request, options do |result, operation|
2301
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, "governed_containers", request, result, options
2302
+ yield result, operation if block_given?
2303
+ return result
2304
+ end
2305
+ rescue ::Gapic::Rest::Error => e
2306
+ raise ::Google::Cloud::Error.from_error(e)
2307
+ end
2308
+
2309
+ ##
2310
+ # Analyzes organization policies governed assets (Google Cloud resources or
2311
+ # policies) under a scope. This RPC supports custom constraints and the
2312
+ # following 10 canned constraints:
2313
+ #
2314
+ # * storage.uniformBucketLevelAccess
2315
+ # * iam.disableServiceAccountKeyCreation
2316
+ # * iam.allowedPolicyMemberDomains
2317
+ # * compute.vmExternalIpAccess
2318
+ # * appengine.enforceServiceAccountActAsCheck
2319
+ # * gcp.resourceLocations
2320
+ # * compute.trustedImageProjects
2321
+ # * compute.skipDefaultNetworkCreation
2322
+ # * compute.requireOsLogin
2323
+ # * compute.disableNestedVirtualization
2324
+ #
2325
+ # This RPC only returns either resources of types supported by [searchable
2326
+ # asset
2327
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
2328
+ # or IAM policies.
2329
+ #
2330
+ # @overload analyze_org_policy_governed_assets(request, options = nil)
2331
+ # Pass arguments to `analyze_org_policy_governed_assets` via a request object, either of type
2332
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest} or an equivalent Hash.
2333
+ #
2334
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest, ::Hash]
2335
+ # A request object representing the call parameters. Required. To specify no
2336
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2337
+ # @param options [::Gapic::CallOptions, ::Hash]
2338
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2339
+ #
2340
+ # @overload analyze_org_policy_governed_assets(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2341
+ # Pass arguments to `analyze_org_policy_governed_assets` via keyword arguments. Note that at
2342
+ # least one keyword argument is required. To specify no parameters, or to keep all
2343
+ # the default parameter values, pass an empty Hash as a request object (see above).
2344
+ #
2345
+ # @param scope [::String]
2346
+ # Required. The organization to scope the request. Only organization
2347
+ # policies within the scope will be analyzed. The output assets will
2348
+ # also be limited to the ones governed by those in-scope organization
2349
+ # policies.
2350
+ #
2351
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2352
+ # @param constraint [::String]
2353
+ # Required. The name of the constraint to analyze governed assets for. The
2354
+ # analysis only contains analyzed organization policies for the provided
2355
+ # constraint.
2356
+ # @param filter [::String]
2357
+ # The expression to filter the governed assets in result. The only supported
2358
+ # fields for governed resources are `governed_resource.project` and
2359
+ # `governed_resource.folders`. The only supported fields for governed iam
2360
+ # policies are `governed_iam_policy.project` and
2361
+ # `governed_iam_policy.folders`. The only supported operator is `=`.
2362
+ #
2363
+ # Example 1: governed_resource.project="projects/12345678" filter will return
2364
+ # all governed resources under projects/12345678 including the project
2365
+ # ifself, if applicable.
2366
+ #
2367
+ # Example 2: governed_iam_policy.folders="folders/12345678" filter will
2368
+ # return all governed iam policies under folders/12345678, if applicable.
2369
+ # @param page_size [::Integer]
2370
+ # The maximum number of items to return per page. If unspecified,
2371
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse#governed_assets AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}
2372
+ # will contain 100 items with a maximum of 200.
2373
+ # @param page_token [::String]
2374
+ # The pagination token to retrieve the next page.
2375
+ # @yield [result, operation] Access the result along with the TransportOperation object
2376
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
2377
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2378
+ #
2379
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
2380
+ #
2381
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2382
+ def analyze_org_policy_governed_assets request, options = nil
2383
+ raise ::ArgumentError, "request must be provided" if request.nil?
2384
+
2385
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest
2386
+
2387
+ # Converts hash and nil to an options object
2388
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2389
+
2390
+ # Customize the options with defaults
2391
+ call_metadata = @config.rpcs.analyze_org_policy_governed_assets.metadata.to_h
2392
+
2393
+ # Set x-goog-api-client and x-goog-user-project headers
2394
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2395
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2396
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION,
2397
+ transports_version_send: [:rest]
2398
+
2399
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2400
+
2401
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_assets.timeout,
2402
+ metadata: call_metadata,
2403
+ retry_policy: @config.rpcs.analyze_org_policy_governed_assets.retry_policy
2404
+
2405
+ options.apply_defaults timeout: @config.timeout,
2406
+ metadata: @config.metadata,
2407
+ retry_policy: @config.retry_policy
2408
+
2409
+ @asset_service_stub.analyze_org_policy_governed_assets request, options do |result, operation|
2410
+ result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, "governed_assets", request, result, options
2411
+ yield result, operation if block_given?
2412
+ return result
2413
+ end
2414
+ rescue ::Gapic::Rest::Error => e
2415
+ raise ::Google::Cloud::Error.from_error(e)
2416
+ end
2417
+
2418
+ ##
2419
+ # Configuration class for the AssetService REST API.
2420
+ #
2421
+ # This class represents the configuration for AssetService REST,
2422
+ # providing control over timeouts, retry behavior, logging, transport
2423
+ # parameters, and other low-level controls. Certain parameters can also be
2424
+ # applied individually to specific RPCs. See
2425
+ # {::Google::Cloud::Asset::V1::AssetService::Rest::Client::Configuration::Rpcs}
2426
+ # for a list of RPCs that can be configured independently.
2427
+ #
2428
+ # Configuration can be applied globally to all clients, or to a single client
2429
+ # on construction.
2430
+ #
2431
+ # @example
2432
+ #
2433
+ # # Modify the global config, setting the timeout for
2434
+ # # export_assets to 20 seconds,
2435
+ # # and all remaining timeouts to 10 seconds.
2436
+ # ::Google::Cloud::Asset::V1::AssetService::Rest::Client.configure do |config|
2437
+ # config.timeout = 10.0
2438
+ # config.rpcs.export_assets.timeout = 20.0
2439
+ # end
2440
+ #
2441
+ # # Apply the above configuration only to a new client.
2442
+ # client = ::Google::Cloud::Asset::V1::AssetService::Rest::Client.new do |config|
2443
+ # config.timeout = 10.0
2444
+ # config.rpcs.export_assets.timeout = 20.0
2445
+ # end
2446
+ #
2447
+ # @!attribute [rw] endpoint
2448
+ # The hostname or hostname:port of the service endpoint.
2449
+ # Defaults to `"cloudasset.googleapis.com"`.
2450
+ # @return [::String]
2451
+ # @!attribute [rw] credentials
2452
+ # Credentials to send with calls. You may provide any of the following types:
2453
+ # * (`String`) The path to a service account key file in JSON format
2454
+ # * (`Hash`) A service account key as a Hash
2455
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2456
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2457
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2458
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2459
+ # * (`nil`) indicating no credentials
2460
+ # @return [::Object]
2461
+ # @!attribute [rw] scope
2462
+ # The OAuth scopes
2463
+ # @return [::Array<::String>]
2464
+ # @!attribute [rw] lib_name
2465
+ # The library name as recorded in instrumentation and logging
2466
+ # @return [::String]
2467
+ # @!attribute [rw] lib_version
2468
+ # The library version as recorded in instrumentation and logging
2469
+ # @return [::String]
2470
+ # @!attribute [rw] timeout
2471
+ # The call timeout in seconds.
2472
+ # @return [::Numeric]
2473
+ # @!attribute [rw] metadata
2474
+ # Additional headers to be sent with the call.
2475
+ # @return [::Hash{::Symbol=>::String}]
2476
+ # @!attribute [rw] retry_policy
2477
+ # The retry policy. The value is a hash with the following keys:
2478
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2479
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2480
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2481
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2482
+ # trigger a retry.
2483
+ # @return [::Hash]
2484
+ # @!attribute [rw] quota_project
2485
+ # A separate project against which to charge quota.
2486
+ # @return [::String]
2487
+ #
2488
+ class Configuration
2489
+ extend ::Gapic::Config
2490
+
2491
+ config_attr :endpoint, "cloudasset.googleapis.com", ::String
2492
+ config_attr :credentials, nil do |value|
2493
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2494
+ allowed.any? { |klass| klass === value }
2495
+ end
2496
+ config_attr :scope, nil, ::String, ::Array, nil
2497
+ config_attr :lib_name, nil, ::String, nil
2498
+ config_attr :lib_version, nil, ::String, nil
2499
+ config_attr :timeout, nil, ::Numeric, nil
2500
+ config_attr :metadata, nil, ::Hash, nil
2501
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2502
+ config_attr :quota_project, nil, ::String, nil
2503
+
2504
+ # @private
2505
+ def initialize parent_config = nil
2506
+ @parent_config = parent_config unless parent_config.nil?
2507
+
2508
+ yield self if block_given?
2509
+ end
2510
+
2511
+ ##
2512
+ # Configurations for individual RPCs
2513
+ # @return [Rpcs]
2514
+ #
2515
+ def rpcs
2516
+ @rpcs ||= begin
2517
+ parent_rpcs = nil
2518
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2519
+ Rpcs.new parent_rpcs
2520
+ end
2521
+ end
2522
+
2523
+ ##
2524
+ # Configuration RPC class for the AssetService API.
2525
+ #
2526
+ # Includes fields providing the configuration for each RPC in this service.
2527
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2528
+ # the following configuration fields:
2529
+ #
2530
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2531
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2532
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2533
+ # include the following keys:
2534
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2535
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2536
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2537
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2538
+ # trigger a retry.
2539
+ #
2540
+ class Rpcs
2541
+ ##
2542
+ # RPC-specific configuration for `export_assets`
2543
+ # @return [::Gapic::Config::Method]
2544
+ #
2545
+ attr_reader :export_assets
2546
+ ##
2547
+ # RPC-specific configuration for `list_assets`
2548
+ # @return [::Gapic::Config::Method]
2549
+ #
2550
+ attr_reader :list_assets
2551
+ ##
2552
+ # RPC-specific configuration for `batch_get_assets_history`
2553
+ # @return [::Gapic::Config::Method]
2554
+ #
2555
+ attr_reader :batch_get_assets_history
2556
+ ##
2557
+ # RPC-specific configuration for `create_feed`
2558
+ # @return [::Gapic::Config::Method]
2559
+ #
2560
+ attr_reader :create_feed
2561
+ ##
2562
+ # RPC-specific configuration for `get_feed`
2563
+ # @return [::Gapic::Config::Method]
2564
+ #
2565
+ attr_reader :get_feed
2566
+ ##
2567
+ # RPC-specific configuration for `list_feeds`
2568
+ # @return [::Gapic::Config::Method]
2569
+ #
2570
+ attr_reader :list_feeds
2571
+ ##
2572
+ # RPC-specific configuration for `update_feed`
2573
+ # @return [::Gapic::Config::Method]
2574
+ #
2575
+ attr_reader :update_feed
2576
+ ##
2577
+ # RPC-specific configuration for `delete_feed`
2578
+ # @return [::Gapic::Config::Method]
2579
+ #
2580
+ attr_reader :delete_feed
2581
+ ##
2582
+ # RPC-specific configuration for `search_all_resources`
2583
+ # @return [::Gapic::Config::Method]
2584
+ #
2585
+ attr_reader :search_all_resources
2586
+ ##
2587
+ # RPC-specific configuration for `search_all_iam_policies`
2588
+ # @return [::Gapic::Config::Method]
2589
+ #
2590
+ attr_reader :search_all_iam_policies
2591
+ ##
2592
+ # RPC-specific configuration for `analyze_iam_policy`
2593
+ # @return [::Gapic::Config::Method]
2594
+ #
2595
+ attr_reader :analyze_iam_policy
2596
+ ##
2597
+ # RPC-specific configuration for `analyze_iam_policy_longrunning`
2598
+ # @return [::Gapic::Config::Method]
2599
+ #
2600
+ attr_reader :analyze_iam_policy_longrunning
2601
+ ##
2602
+ # RPC-specific configuration for `analyze_move`
2603
+ # @return [::Gapic::Config::Method]
2604
+ #
2605
+ attr_reader :analyze_move
2606
+ ##
2607
+ # RPC-specific configuration for `query_assets`
2608
+ # @return [::Gapic::Config::Method]
2609
+ #
2610
+ attr_reader :query_assets
2611
+ ##
2612
+ # RPC-specific configuration for `create_saved_query`
2613
+ # @return [::Gapic::Config::Method]
2614
+ #
2615
+ attr_reader :create_saved_query
2616
+ ##
2617
+ # RPC-specific configuration for `get_saved_query`
2618
+ # @return [::Gapic::Config::Method]
2619
+ #
2620
+ attr_reader :get_saved_query
2621
+ ##
2622
+ # RPC-specific configuration for `list_saved_queries`
2623
+ # @return [::Gapic::Config::Method]
2624
+ #
2625
+ attr_reader :list_saved_queries
2626
+ ##
2627
+ # RPC-specific configuration for `update_saved_query`
2628
+ # @return [::Gapic::Config::Method]
2629
+ #
2630
+ attr_reader :update_saved_query
2631
+ ##
2632
+ # RPC-specific configuration for `delete_saved_query`
2633
+ # @return [::Gapic::Config::Method]
2634
+ #
2635
+ attr_reader :delete_saved_query
2636
+ ##
2637
+ # RPC-specific configuration for `batch_get_effective_iam_policies`
2638
+ # @return [::Gapic::Config::Method]
2639
+ #
2640
+ attr_reader :batch_get_effective_iam_policies
2641
+ ##
2642
+ # RPC-specific configuration for `analyze_org_policies`
2643
+ # @return [::Gapic::Config::Method]
2644
+ #
2645
+ attr_reader :analyze_org_policies
2646
+ ##
2647
+ # RPC-specific configuration for `analyze_org_policy_governed_containers`
2648
+ # @return [::Gapic::Config::Method]
2649
+ #
2650
+ attr_reader :analyze_org_policy_governed_containers
2651
+ ##
2652
+ # RPC-specific configuration for `analyze_org_policy_governed_assets`
2653
+ # @return [::Gapic::Config::Method]
2654
+ #
2655
+ attr_reader :analyze_org_policy_governed_assets
2656
+
2657
+ # @private
2658
+ def initialize parent_rpcs = nil
2659
+ export_assets_config = parent_rpcs.export_assets if parent_rpcs.respond_to? :export_assets
2660
+ @export_assets = ::Gapic::Config::Method.new export_assets_config
2661
+ list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
2662
+ @list_assets = ::Gapic::Config::Method.new list_assets_config
2663
+ batch_get_assets_history_config = parent_rpcs.batch_get_assets_history if parent_rpcs.respond_to? :batch_get_assets_history
2664
+ @batch_get_assets_history = ::Gapic::Config::Method.new batch_get_assets_history_config
2665
+ create_feed_config = parent_rpcs.create_feed if parent_rpcs.respond_to? :create_feed
2666
+ @create_feed = ::Gapic::Config::Method.new create_feed_config
2667
+ get_feed_config = parent_rpcs.get_feed if parent_rpcs.respond_to? :get_feed
2668
+ @get_feed = ::Gapic::Config::Method.new get_feed_config
2669
+ list_feeds_config = parent_rpcs.list_feeds if parent_rpcs.respond_to? :list_feeds
2670
+ @list_feeds = ::Gapic::Config::Method.new list_feeds_config
2671
+ update_feed_config = parent_rpcs.update_feed if parent_rpcs.respond_to? :update_feed
2672
+ @update_feed = ::Gapic::Config::Method.new update_feed_config
2673
+ delete_feed_config = parent_rpcs.delete_feed if parent_rpcs.respond_to? :delete_feed
2674
+ @delete_feed = ::Gapic::Config::Method.new delete_feed_config
2675
+ search_all_resources_config = parent_rpcs.search_all_resources if parent_rpcs.respond_to? :search_all_resources
2676
+ @search_all_resources = ::Gapic::Config::Method.new search_all_resources_config
2677
+ search_all_iam_policies_config = parent_rpcs.search_all_iam_policies if parent_rpcs.respond_to? :search_all_iam_policies
2678
+ @search_all_iam_policies = ::Gapic::Config::Method.new search_all_iam_policies_config
2679
+ analyze_iam_policy_config = parent_rpcs.analyze_iam_policy if parent_rpcs.respond_to? :analyze_iam_policy
2680
+ @analyze_iam_policy = ::Gapic::Config::Method.new analyze_iam_policy_config
2681
+ analyze_iam_policy_longrunning_config = parent_rpcs.analyze_iam_policy_longrunning if parent_rpcs.respond_to? :analyze_iam_policy_longrunning
2682
+ @analyze_iam_policy_longrunning = ::Gapic::Config::Method.new analyze_iam_policy_longrunning_config
2683
+ analyze_move_config = parent_rpcs.analyze_move if parent_rpcs.respond_to? :analyze_move
2684
+ @analyze_move = ::Gapic::Config::Method.new analyze_move_config
2685
+ query_assets_config = parent_rpcs.query_assets if parent_rpcs.respond_to? :query_assets
2686
+ @query_assets = ::Gapic::Config::Method.new query_assets_config
2687
+ create_saved_query_config = parent_rpcs.create_saved_query if parent_rpcs.respond_to? :create_saved_query
2688
+ @create_saved_query = ::Gapic::Config::Method.new create_saved_query_config
2689
+ get_saved_query_config = parent_rpcs.get_saved_query if parent_rpcs.respond_to? :get_saved_query
2690
+ @get_saved_query = ::Gapic::Config::Method.new get_saved_query_config
2691
+ list_saved_queries_config = parent_rpcs.list_saved_queries if parent_rpcs.respond_to? :list_saved_queries
2692
+ @list_saved_queries = ::Gapic::Config::Method.new list_saved_queries_config
2693
+ update_saved_query_config = parent_rpcs.update_saved_query if parent_rpcs.respond_to? :update_saved_query
2694
+ @update_saved_query = ::Gapic::Config::Method.new update_saved_query_config
2695
+ delete_saved_query_config = parent_rpcs.delete_saved_query if parent_rpcs.respond_to? :delete_saved_query
2696
+ @delete_saved_query = ::Gapic::Config::Method.new delete_saved_query_config
2697
+ batch_get_effective_iam_policies_config = parent_rpcs.batch_get_effective_iam_policies if parent_rpcs.respond_to? :batch_get_effective_iam_policies
2698
+ @batch_get_effective_iam_policies = ::Gapic::Config::Method.new batch_get_effective_iam_policies_config
2699
+ analyze_org_policies_config = parent_rpcs.analyze_org_policies if parent_rpcs.respond_to? :analyze_org_policies
2700
+ @analyze_org_policies = ::Gapic::Config::Method.new analyze_org_policies_config
2701
+ analyze_org_policy_governed_containers_config = parent_rpcs.analyze_org_policy_governed_containers if parent_rpcs.respond_to? :analyze_org_policy_governed_containers
2702
+ @analyze_org_policy_governed_containers = ::Gapic::Config::Method.new analyze_org_policy_governed_containers_config
2703
+ analyze_org_policy_governed_assets_config = parent_rpcs.analyze_org_policy_governed_assets if parent_rpcs.respond_to? :analyze_org_policy_governed_assets
2704
+ @analyze_org_policy_governed_assets = ::Gapic::Config::Method.new analyze_org_policy_governed_assets_config
2705
+
2706
+ yield self if block_given?
2707
+ end
2708
+ end
2709
+ end
2710
+ end
2711
+ end
2712
+ end
2713
+ end
2714
+ end
2715
+ end
2716
+ end