google-cloud-asset-v1 0.23.0 → 0.24.0

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