google-cloud-asset-v1 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,13 +238,14 @@ module Google
238
238
  # Exports assets with time and resource types to a given Cloud Storage
239
239
  # location/BigQuery table. For Cloud Storage location destinations, the
240
240
  # output format is newline-delimited JSON. Each line represents a
241
- # {::Google::Cloud::Asset::V1::Asset google.cloud.asset.v1.Asset} in the JSON format; for BigQuery table
242
- # destinations, the output table stores the fields in asset Protobuf as
243
- # columns. This API implements the {::Google::Longrunning::Operation google.longrunning.Operation} API,
244
- # which allows you to keep track of the export. We recommend intervals of at
245
- # least 2 seconds with exponential retry to poll the export operation result.
246
- # For regular-size resource parent, the export operation usually finishes
247
- # within 5 minutes.
241
+ # {::Google::Cloud::Asset::V1::Asset google.cloud.asset.v1.Asset} in the JSON
242
+ # format; for BigQuery table destinations, the output table stores the fields
243
+ # in asset Protobuf as columns. This API implements the
244
+ # {::Google::Longrunning::Operation google.longrunning.Operation} API, which
245
+ # allows you to keep track of the export. We recommend intervals of at least
246
+ # 2 seconds with exponential retry to poll the export operation result. For
247
+ # regular-size resource parent, the export operation usually finishes within
248
+ # 5 minutes.
248
249
  #
249
250
  # @overload export_assets(request, options = nil)
250
251
  # Pass arguments to `export_assets` via a request object, either of type
@@ -295,7 +296,8 @@ module Google
295
296
  # Asset content type. If not specified, no content but the asset name will be
296
297
  # returned.
297
298
  # @param output_config [::Google::Cloud::Asset::V1::OutputConfig, ::Hash]
298
- # Required. Output configuration indicating where the results will be output to.
299
+ # Required. Output configuration indicating where the results will be output
300
+ # to.
299
301
  # @param relationship_types [::Array<::String>]
300
302
  # A list of relationship types to export, for example:
301
303
  # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
@@ -333,14 +335,14 @@ module Google
333
335
  # # Call the export_assets method.
334
336
  # result = client.export_assets request
335
337
  #
336
- # # The returned object is of type Gapic::Operation. You can use this
337
- # # object to check the status of an operation, cancel it, or wait
338
- # # for results. Here is how to block until completion:
338
+ # # The returned object is of type Gapic::Operation. You can use it to
339
+ # # check the status of an operation, cancel it, or wait for results.
340
+ # # Here is how to wait for a response.
339
341
  # result.wait_until_done! timeout: 60
340
342
  # if result.response?
341
343
  # p result.response
342
344
  # else
343
- # puts "Error!"
345
+ # puts "No response received."
344
346
  # end
345
347
  #
346
348
  def export_assets request, options = nil
@@ -405,11 +407,11 @@ module Google
405
407
  # the default parameter values, pass an empty Hash as a request object (see above).
406
408
  #
407
409
  # @param parent [::String]
408
- # Required. Name of the organization, folder, or project the assets belong to. Format:
409
- # "organizations/[organization-number]" (such as "organizations/123"),
410
- # "projects/[project-id]" (such as "projects/my-project-id"),
411
- # "projects/[project-number]" (such as "projects/12345"), or
412
- # "folders/[folder-number]" (such as "folders/12345").
410
+ # Required. Name of the organization, folder, or project the assets belong
411
+ # to. Format: "organizations/[organization-number]" (such as
412
+ # "organizations/123"), "projects/[project-id]" (such as
413
+ # "projects/my-project-id"), "projects/[project-number]" (such as
414
+ # "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").
413
415
  # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
414
416
  # Timestamp to take an asset snapshot. This can only be set to a timestamp
415
417
  # between the current time and the current time minus 35 days (inclusive).
@@ -482,13 +484,11 @@ module Google
482
484
  # # Call the list_assets method.
483
485
  # result = client.list_assets request
484
486
  #
485
- # # The returned object is of type Gapic::PagedEnumerable. You can
486
- # # iterate over all elements by calling #each, and the enumerable
487
- # # will lazily make API calls to fetch subsequent pages. Other
488
- # # methods are also available for managing paging directly.
489
- # result.each do |response|
487
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
488
+ # # over elements, and API calls will be issued to fetch pages as needed.
489
+ # result.each do |item|
490
490
  # # Each element is of type ::Google::Cloud::Asset::V1::Asset.
491
- # p response
491
+ # p item
492
492
  # end
493
493
  #
494
494
  def list_assets request, options = nil
@@ -690,9 +690,8 @@ module Google
690
690
  # Required. This is the client-assigned asset feed identifier and it needs to
691
691
  # be unique under a specific parent project/folder/organization.
692
692
  # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
693
- # Required. The feed details. The field `name` must be empty and it will be generated
694
- # in the format of:
695
- # projects/project_number/feeds/feed_id
693
+ # Required. The feed details. The field `name` must be empty and it will be
694
+ # generated in the format of: projects/project_number/feeds/feed_id
696
695
  # folders/folder_number/feeds/feed_id
697
696
  # organizations/organization_number/feeds/feed_id
698
697
  #
@@ -954,8 +953,8 @@ module Google
954
953
  # the default parameter values, pass an empty Hash as a request object (see above).
955
954
  #
956
955
  # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
957
- # Required. The new values of feed details. It must match an existing feed and the
958
- # field `name` must be in the format of:
956
+ # Required. The new values of feed details. It must match an existing feed
957
+ # and the field `name` must be in the format of:
959
958
  # projects/project_number/feeds/feed_id or
960
959
  # folders/folder_number/feeds/feed_id or
961
960
  # organizations/organization_number/feeds/feed_id.
@@ -1117,8 +1116,8 @@ module Google
1117
1116
  end
1118
1117
 
1119
1118
  ##
1120
- # Searches all Cloud resources within the specified scope, such as a project,
1121
- # folder, or organization. The caller must be granted the
1119
+ # Searches all Google Cloud resources within the specified scope, such as a
1120
+ # project, folder, or organization. The caller must be granted the
1122
1121
  # `cloudasset.assets.searchAllResources` permission on the desired scope,
1123
1122
  # otherwise the request will be rejected.
1124
1123
  #
@@ -1138,8 +1137,9 @@ module Google
1138
1137
  # the default parameter values, pass an empty Hash as a request object (see above).
1139
1138
  #
1140
1139
  # @param scope [::String]
1141
- # Required. A scope can be a project, a folder, or an organization. The search is
1142
- # limited to the resources within the `scope`. The caller must be granted the
1140
+ # Required. A scope can be a project, a folder, or an organization. The
1141
+ # search is limited to the resources within the `scope`. The caller must be
1142
+ # granted the
1143
1143
  # [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1144
1144
  # permission on the desired scope.
1145
1145
  #
@@ -1157,54 +1157,54 @@ module Google
1157
1157
  #
1158
1158
  # Examples:
1159
1159
  #
1160
- # * `name:Important` to find Cloud resources whose name contains
1160
+ # * `name:Important` to find Google Cloud resources whose name contains
1161
1161
  # "Important" as a word.
1162
- # * `name=Important` to find the Cloud resource whose name is exactly
1162
+ # * `name=Important` to find the Google Cloud resource whose name is exactly
1163
1163
  # "Important".
1164
- # * `displayName:Impor*` to find Cloud resources whose display name
1164
+ # * `displayName:Impor*` to find Google Cloud resources whose display name
1165
1165
  # contains "Impor" as a prefix of any word in the field.
1166
- # * `location:us-west*` to find Cloud resources whose location contains both
1167
- # "us" and "west" as prefixes.
1168
- # * `labels:prod` to find Cloud resources whose labels contain "prod" as
1169
- # a key or value.
1170
- # * `labels.env:prod` to find Cloud resources that have a label "env"
1166
+ # * `location:us-west*` to find Google Cloud resources whose location
1167
+ # contains both "us" and "west" as prefixes.
1168
+ # * `labels:prod` to find Google Cloud resources whose labels contain "prod"
1169
+ # as a key or value.
1170
+ # * `labels.env:prod` to find Google Cloud resources that have a label "env"
1171
1171
  # and its value is "prod".
1172
- # * `labels.env:*` to find Cloud resources that have a label "env".
1173
- # * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
1174
- # encryption key whose name contains "key" as a word. This field is
1175
- # deprecated. Please use the `kmsKeys` field to retrieve KMS key
1176
- # information.
1177
- # * `kmsKeys:key` to find Cloud resources encrypted with customer-managed
1178
- # encryption keys whose name contains the word "key".
1179
- # * `relationships:instance-group-1` to find Cloud resources that have
1172
+ # * `labels.env:*` to find Google Cloud resources that have a label "env".
1173
+ # * `kmsKey:key` to find Google Cloud resources encrypted with a
1174
+ # customer-managed encryption key whose name contains "key" as a word. This
1175
+ # field is deprecated. Please use the `kmsKeys` field to retrieve Cloud KMS
1176
+ # key information.
1177
+ # * `kmsKeys:key` to find Google Cloud resources encrypted with
1178
+ # customer-managed encryption keys whose name contains the word "key".
1179
+ # * `relationships:instance-group-1` to find Google Cloud resources that have
1180
1180
  # relationships with "instance-group-1" in the related resource name.
1181
- # * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that
1182
- # have relationships of type "INSTANCE_TO_INSTANCEGROUP".
1181
+ # * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine
1182
+ # instances that have relationships of type "INSTANCE_TO_INSTANCEGROUP".
1183
1183
  # * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
1184
- # compute instances that have relationships with "instance-group-1" in the
1185
- # compute instance group resource name, for relationship type
1184
+ # Compute Engine instances that have relationships with "instance-group-1"
1185
+ # in the Compute Engine instance group resource name, for relationship type
1186
1186
  # "INSTANCE_TO_INSTANCEGROUP".
1187
- # * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
1188
- # word.
1189
- # * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
1187
+ # * `state:ACTIVE` to find Google Cloud resources whose state contains
1190
1188
  # "ACTIVE" as a word.
1191
- # * `createTime<1609459200` to find Cloud resources that were created before
1192
- # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1189
+ # * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't
1190
+ # contain "ACTIVE" as a word.
1191
+ # * `createTime<1609459200` to find Google Cloud resources that were created
1192
+ # before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1193
1193
  # "2021-01-01 00:00:00 UTC" in seconds.
1194
- # * `updateTime>1609459200` to find Cloud resources that were updated after
1195
- # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1194
+ # * `updateTime>1609459200` to find Google Cloud resources that were updated
1195
+ # after "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
1196
1196
  # "2021-01-01 00:00:00 UTC" in seconds.
1197
- # * `Important` to find Cloud resources that contain "Important" as a word
1198
- # in any of the searchable fields.
1199
- # * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any
1197
+ # * `Important` to find Google Cloud resources that contain "Important" as a
1200
1198
  # word in any of the searchable fields.
1201
- # * `Important location:(us-west1 OR global)` to find Cloud
1199
+ # * `Impor*` to find Google Cloud resources that contain "Impor" as a prefix
1200
+ # of any word in any of the searchable fields.
1201
+ # * `Important location:(us-west1 OR global)` to find Google Cloud
1202
1202
  # resources that contain "Important" as a word in any of the searchable
1203
1203
  # fields and are also located in the "us-west1" region or the "global"
1204
1204
  # location.
1205
1205
  # @param asset_types [::Array<::String>]
1206
- # Optional. A list of asset types that this request searches for. If empty, it will
1207
- # search all the [searchable asset
1206
+ # Optional. A list of asset types that this request searches for. If empty,
1207
+ # it will search all the [searchable asset
1208
1208
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1209
1209
  #
1210
1210
  # Regular expressions are also supported. For example:
@@ -1218,19 +1218,20 @@ module Google
1218
1218
  # regular expression syntax. If the regular expression does not match any
1219
1219
  # supported asset type, an INVALID_ARGUMENT error will be returned.
1220
1220
  # @param page_size [::Integer]
1221
- # Optional. The page size for search result pagination. Page size is capped at 500 even
1222
- # if a larger value is given. If set to zero, server will pick an appropriate
1223
- # default. Returned results may be fewer than requested. When this happens,
1224
- # there could be more results as long as `next_page_token` is returned.
1221
+ # Optional. The page size for search result pagination. Page size is capped
1222
+ # at 500 even if a larger value is given. If set to zero, server will pick an
1223
+ # appropriate default. Returned results may be fewer than requested. When
1224
+ # this happens, there could be more results as long as `next_page_token` is
1225
+ # returned.
1225
1226
  # @param page_token [::String]
1226
- # Optional. If present, then retrieve the next batch of results from the preceding call
1227
- # to this method. `page_token` must be the value of `next_page_token` from
1228
- # the previous response. The values of all other method parameters, must be
1229
- # identical to those in the previous call.
1227
+ # Optional. If present, then retrieve the next batch of results from the
1228
+ # preceding call to this method. `page_token` must be the value of
1229
+ # `next_page_token` from the previous response. The values of all other
1230
+ # method parameters, must be identical to those in the previous call.
1230
1231
  # @param order_by [::String]
1231
- # Optional. A comma-separated list of fields specifying the sorting order of the
1232
- # results. The default order is ascending. Add " DESC" after the field name
1233
- # to indicate descending order. Redundant space characters are ignored.
1232
+ # Optional. A comma-separated list of fields specifying the sorting order of
1233
+ # the results. The default order is ascending. Add " DESC" after the field
1234
+ # name to indicate descending order. Redundant space characters are ignored.
1234
1235
  # Example: "location DESC, name".
1235
1236
  # Only singular primitive fields in the response are sortable:
1236
1237
  #
@@ -1250,10 +1251,10 @@ module Google
1250
1251
  # `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g.,
1251
1252
  # `additionalAttributes`) are not supported.
1252
1253
  # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
1253
- # Optional. A comma-separated list of fields specifying which fields to be returned in
1254
- # ResourceSearchResult. Only '*' or combination of top level fields can be
1255
- # specified. Field names of both snake_case and camelCase are supported.
1256
- # Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
1254
+ # Optional. A comma-separated list of fields specifying which fields to be
1255
+ # returned in ResourceSearchResult. Only '*' or combination of top level
1256
+ # fields can be specified. Field names of both snake_case and camelCase are
1257
+ # supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
1257
1258
  #
1258
1259
  # The read_mask paths must be valid field paths listed but not limited to
1259
1260
  # (both snake_case and camelCase are supported):
@@ -1270,7 +1271,7 @@ module Google
1270
1271
  # * labels
1271
1272
  # * networkTags
1272
1273
  # * kmsKey (This field is deprecated. Please use the `kmsKeys` field to
1273
- # retrieve KMS key information.)
1274
+ # retrieve Cloud KMS key information.)
1274
1275
  # * kmsKeys
1275
1276
  # * createTime
1276
1277
  # * updateTime
@@ -1304,13 +1305,11 @@ module Google
1304
1305
  # # Call the search_all_resources method.
1305
1306
  # result = client.search_all_resources request
1306
1307
  #
1307
- # # The returned object is of type Gapic::PagedEnumerable. You can
1308
- # # iterate over all elements by calling #each, and the enumerable
1309
- # # will lazily make API calls to fetch subsequent pages. Other
1310
- # # methods are also available for managing paging directly.
1311
- # result.each do |response|
1308
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1309
+ # # over elements, and API calls will be issued to fetch pages as needed.
1310
+ # result.each do |item|
1312
1311
  # # Each element is of type ::Google::Cloud::Asset::V1::ResourceSearchResult.
1313
- # p response
1312
+ # p item
1314
1313
  # end
1315
1314
  #
1316
1315
  def search_all_resources request, options = nil
@@ -1377,9 +1376,9 @@ module Google
1377
1376
  # the default parameter values, pass an empty Hash as a request object (see above).
1378
1377
  #
1379
1378
  # @param scope [::String]
1380
- # Required. A scope can be a project, a folder, or an organization. The search is
1381
- # limited to the IAM policies within the `scope`. The caller must be granted
1382
- # the
1379
+ # Required. A scope can be a project, a folder, or an organization. The
1380
+ # search is limited to the IAM policies within the `scope`. The caller must
1381
+ # be granted the
1383
1382
  # [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1384
1383
  # permission on the desired scope.
1385
1384
  #
@@ -1394,8 +1393,8 @@ module Google
1394
1393
  # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
1395
1394
  # for more information. If not specified or empty, it will search all the
1396
1395
  # IAM policies within the specified `scope`. Note that the query string is
1397
- # compared against each Cloud IAM policy binding, including its principals,
1398
- # roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
1396
+ # compared against each IAM policy binding, including its principals,
1397
+ # roles, and IAM conditions. The returned IAM policies will only
1399
1398
  # contain the bindings that match your query. To learn more about the IAM
1400
1399
  # policy structure, see the [IAM policy
1401
1400
  # documentation](https://cloud.google.com/iam/help/allow-policies/structure).
@@ -1433,18 +1432,20 @@ module Google
1433
1432
  # * `memberTypes:user` to find IAM policy bindings that contain the
1434
1433
  # principal type "user".
1435
1434
  # @param page_size [::Integer]
1436
- # Optional. The page size for search result pagination. Page size is capped at 500 even
1437
- # if a larger value is given. If set to zero, server will pick an appropriate
1438
- # default. Returned results may be fewer than requested. When this happens,
1439
- # there could be more results as long as `next_page_token` is returned.
1435
+ # Optional. The page size for search result pagination. Page size is capped
1436
+ # at 500 even if a larger value is given. If set to zero, server will pick an
1437
+ # appropriate default. Returned results may be fewer than requested. When
1438
+ # this happens, there could be more results as long as `next_page_token` is
1439
+ # returned.
1440
1440
  # @param page_token [::String]
1441
- # Optional. If present, retrieve the next batch of results from the preceding call to
1442
- # this method. `page_token` must be the value of `next_page_token` from the
1443
- # previous response. The values of all other method parameters must be
1444
- # identical to those in the previous call.
1441
+ # Optional. If present, retrieve the next batch of results from the preceding
1442
+ # call to this method. `page_token` must be the value of `next_page_token`
1443
+ # from the previous response. The values of all other method parameters must
1444
+ # be identical to those in the previous call.
1445
1445
  # @param asset_types [::Array<::String>]
1446
- # Optional. A list of asset types that the IAM policies are attached to. If empty, it
1447
- # will search the IAM policies that are attached to all the [searchable asset
1446
+ # Optional. A list of asset types that the IAM policies are attached to. If
1447
+ # empty, it will search the IAM policies that are attached to all the
1448
+ # [searchable asset
1448
1449
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
1449
1450
  #
1450
1451
  # Regular expressions are also supported. For example:
@@ -1460,9 +1461,9 @@ module Google
1460
1461
  # regular expression syntax. If the regular expression does not match any
1461
1462
  # supported asset type, an INVALID_ARGUMENT error will be returned.
1462
1463
  # @param order_by [::String]
1463
- # Optional. A comma-separated list of fields specifying the sorting order of the
1464
- # results. The default order is ascending. Add " DESC" after the field name
1465
- # to indicate descending order. Redundant space characters are ignored.
1464
+ # Optional. A comma-separated list of fields specifying the sorting order of
1465
+ # the results. The default order is ascending. Add " DESC" after the field
1466
+ # name to indicate descending order. Redundant space characters are ignored.
1466
1467
  # Example: "assetType DESC, resource".
1467
1468
  # Only singular primitive fields in the response are sortable:
1468
1469
  # * resource
@@ -1491,13 +1492,11 @@ module Google
1491
1492
  # # Call the search_all_iam_policies method.
1492
1493
  # result = client.search_all_iam_policies request
1493
1494
  #
1494
- # # The returned object is of type Gapic::PagedEnumerable. You can
1495
- # # iterate over all elements by calling #each, and the enumerable
1496
- # # will lazily make API calls to fetch subsequent pages. Other
1497
- # # methods are also available for managing paging directly.
1498
- # result.each do |response|
1495
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1496
+ # # over elements, and API calls will be issued to fetch pages as needed.
1497
+ # result.each do |item|
1499
1498
  # # Each element is of type ::Google::Cloud::Asset::V1::IamPolicySearchResult.
1500
- # p response
1499
+ # p item
1501
1500
  # end
1502
1501
  #
1503
1502
  def search_all_iam_policies request, options = nil
@@ -1581,7 +1580,8 @@ module Google
1581
1580
  # 0 or empty string, etc., because we use proto3, which doesn't support field
1582
1581
  # presence yet.
1583
1582
  # @param execution_timeout [::Google::Protobuf::Duration, ::Hash]
1584
- # Optional. Amount of time executable has to complete. See JSON representation of
1583
+ # Optional. Amount of time executable has to complete. See JSON
1584
+ # representation of
1585
1585
  # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json).
1586
1586
  #
1587
1587
  # If this field is set with a value less than the RPC deadline, and the
@@ -1661,11 +1661,12 @@ module Google
1661
1661
  # accesses on which resources, and writes the analysis results to a Google
1662
1662
  # Cloud Storage or a BigQuery destination. For Cloud Storage destination, the
1663
1663
  # output format is the JSON format that represents a
1664
- # {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse AnalyzeIamPolicyResponse}. This method implements the
1665
- # {::Google::Longrunning::Operation google.longrunning.Operation}, which allows you to track the operation
1666
- # status. We recommend intervals of at least 2 seconds with exponential
1667
- # backoff retry to poll the operation result. The metadata contains the
1668
- # metadata for the long-running operation.
1664
+ # {::Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse AnalyzeIamPolicyResponse}.
1665
+ # This method implements the
1666
+ # {::Google::Longrunning::Operation google.longrunning.Operation}, which allows
1667
+ # you to track the operation status. We recommend intervals of at least 2
1668
+ # seconds with exponential backoff retry to poll the operation result. The
1669
+ # metadata contains the metadata for the long-running operation.
1669
1670
  #
1670
1671
  # @overload analyze_iam_policy_longrunning(request, options = nil)
1671
1672
  # Pass arguments to `analyze_iam_policy_longrunning` via a request object, either of type
@@ -1702,7 +1703,8 @@ module Google
1702
1703
  # 0 or empty string, etc., because we use proto3, which doesn't support field
1703
1704
  # presence yet.
1704
1705
  # @param output_config [::Google::Cloud::Asset::V1::IamPolicyAnalysisOutputConfig, ::Hash]
1705
- # Required. Output configuration indicating where the results will be output to.
1706
+ # Required. Output configuration indicating where the results will be output
1707
+ # to.
1706
1708
  #
1707
1709
  # @yield [response, operation] Access the result along with the RPC operation
1708
1710
  # @yieldparam response [::Gapic::Operation]
@@ -1724,14 +1726,14 @@ module Google
1724
1726
  # # Call the analyze_iam_policy_longrunning method.
1725
1727
  # result = client.analyze_iam_policy_longrunning request
1726
1728
  #
1727
- # # The returned object is of type Gapic::Operation. You can use this
1728
- # # object to check the status of an operation, cancel it, or wait
1729
- # # for results. Here is how to block until completion:
1729
+ # # The returned object is of type Gapic::Operation. You can use it to
1730
+ # # check the status of an operation, cancel it, or wait for results.
1731
+ # # Here is how to wait for a response.
1730
1732
  # result.wait_until_done! timeout: 60
1731
1733
  # if result.response?
1732
1734
  # p result.response
1733
1735
  # else
1734
- # puts "Error!"
1736
+ # puts "No response received."
1735
1737
  # end
1736
1738
  #
1737
1739
  def analyze_iam_policy_longrunning request, options = nil
@@ -1800,14 +1802,14 @@ module Google
1800
1802
  #
1801
1803
  # @param resource [::String]
1802
1804
  # Required. Name of the resource to perform the analysis against.
1803
- # Only GCP Project are supported as of today. Hence, this can only be Project
1804
- # ID (such as "projects/my-project-id") or a Project Number (such as
1805
- # "projects/12345").
1805
+ # Only Google Cloud projects are supported as of today. Hence, this can only
1806
+ # be a project ID (such as "projects/my-project-id") or a project number
1807
+ # (such as "projects/12345").
1806
1808
  # @param destination_parent [::String]
1807
- # Required. Name of the GCP Folder or Organization to reparent the target
1808
- # resource. The analysis will be performed against hypothetically moving the
1809
- # resource to this specified desitination parent. This can only be a Folder
1810
- # number (such as "folders/123") or an Organization number (such as
1809
+ # Required. Name of the Google Cloud folder or organization to reparent the
1810
+ # target resource. The analysis will be performed against hypothetically
1811
+ # moving the resource to this specified desitination parent. This can only be
1812
+ # a folder number (such as "folders/123") or an organization number (such as
1811
1813
  # "organizations/123").
1812
1814
  # @param view [::Google::Cloud::Asset::V1::AnalyzeMoveRequest::AnalysisView]
1813
1815
  # Analysis view indicating what information should be included in the
@@ -1919,11 +1921,11 @@ module Google
1919
1921
  # Optional. A SQL statement that's compatible with [BigQuery Standard
1920
1922
  # SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
1921
1923
  # @param job_reference [::String]
1922
- # Optional. Reference to the query job, which is from the `QueryAssetsResponse` of
1923
- # previous `QueryAssets` call.
1924
+ # Optional. Reference to the query job, which is from the
1925
+ # `QueryAssetsResponse` of previous `QueryAssets` call.
1924
1926
  # @param page_size [::Integer]
1925
- # Optional. The maximum number of rows to return in the results. Responses are limited
1926
- # to 10 MB and 1000 rows.
1927
+ # Optional. The maximum number of rows to return in the results. Responses
1928
+ # are limited to 10 MB and 1000 rows.
1927
1929
  #
1928
1930
  # By default, the maximum row count is 1000. When the byte or row count limit
1929
1931
  # is reached, the rest of the query results will be paginated.
@@ -1934,10 +1936,11 @@ module Google
1934
1936
  #
1935
1937
  # The field will be ignored when [output_config] is specified.
1936
1938
  # @param timeout [::Google::Protobuf::Duration, ::Hash]
1937
- # Optional. Specifies the maximum amount of time that the client is willing to wait
1938
- # for the query to complete. By default, this limit is 5 min for the first
1939
- # query, and 1 minute for the following queries. If the query is complete,
1940
- # the `done` field in the `QueryAssetsResponse` is true, otherwise false.
1939
+ # Optional. Specifies the maximum amount of time that the client is willing
1940
+ # to wait for the query to complete. By default, this limit is 5 min for the
1941
+ # first query, and 1 minute for the following queries. If the query is
1942
+ # complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
1943
+ # false.
1941
1944
  #
1942
1945
  # Like BigQuery [jobs.query
1943
1946
  # API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
@@ -1947,11 +1950,12 @@ module Google
1947
1950
  #
1948
1951
  # The field will be ignored when [output_config] is specified.
1949
1952
  # @param read_time_window [::Google::Cloud::Asset::V1::TimeWindow, ::Hash]
1950
- # Optional. [start_time] is required. [start_time] must be less than [end_time]
1951
- # Defaults [end_time] to now if [start_time] is set and [end_time] isn't.
1952
- # Maximum permitted time range is 7 days.
1953
+ # Optional. [start_time] is required. [start_time] must be less than
1954
+ # [end_time] Defaults [end_time] to now if [start_time] is set and
1955
+ # [end_time] isn't. Maximum permitted time range is 7 days.
1953
1956
  # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1954
- # Optional. Queries cloud assets as they appeared at the specified point in time.
1957
+ # Optional. Queries cloud assets as they appeared at the specified point in
1958
+ # time.
1955
1959
  # @param output_config [::Google::Cloud::Asset::V1::QueryAssetsOutputConfig, ::Hash]
1956
1960
  # Optional. Destination where the query results will be saved.
1957
1961
  #
@@ -2046,21 +2050,21 @@ module Google
2046
2050
  # the default parameter values, pass an empty Hash as a request object (see above).
2047
2051
  #
2048
2052
  # @param parent [::String]
2049
- # Required. The name of the project/folder/organization where this saved_query
2050
- # should be created in. It can only be an organization number (such as
2051
- # "organizations/123"), a folder number (such as "folders/123"), a project ID
2052
- # (such as "projects/my-project-id")", or a project number (such as
2053
- # "projects/12345").
2053
+ # Required. The name of the project/folder/organization where this
2054
+ # saved_query should be created in. It can only be an organization number
2055
+ # (such as "organizations/123"), a folder number (such as "folders/123"), a
2056
+ # project ID (such as "projects/my-project-id")", or a project number (such
2057
+ # as "projects/12345").
2054
2058
  # @param saved_query [::Google::Cloud::Asset::V1::SavedQuery, ::Hash]
2055
- # Required. The saved_query details. The `name` field must be empty as it will be
2056
- # generated based on the parent and saved_query_id.
2059
+ # Required. The saved_query details. The `name` field must be empty as it
2060
+ # will be generated based on the parent and saved_query_id.
2057
2061
  # @param saved_query_id [::String]
2058
- # Required. The ID to use for the saved query, which must be unique in the specified
2059
- # parent. It will become the final component of the saved query's resource
2060
- # name.
2062
+ # Required. The ID to use for the saved query, which must be unique in the
2063
+ # specified parent. It will become the final component of the saved query's
2064
+ # resource name.
2061
2065
  #
2062
2066
  # This value should be 4-63 characters, and valid characters
2063
- # are /[a-z][0-9]-/.
2067
+ # are `[a-z][0-9]-`.
2064
2068
  #
2065
2069
  # Notice that this field is required in the saved query creation, and the
2066
2070
  # `name` field of the `saved_query` will be ignored.
@@ -2237,8 +2241,8 @@ module Google
2237
2241
  # the default parameter values, pass an empty Hash as a request object (see above).
2238
2242
  #
2239
2243
  # @param parent [::String]
2240
- # Required. The parent project/folder/organization whose savedQueries are to be
2241
- # listed. It can only be using project/folder/organization number (such as
2244
+ # Required. The parent project/folder/organization whose savedQueries are to
2245
+ # be listed. It can only be using project/folder/organization number (such as
2242
2246
  # "folders/12345")", or a project ID (such as "projects/my-project-id").
2243
2247
  # @param filter [::String]
2244
2248
  # Optional. The expression to filter resources.
@@ -2249,8 +2253,9 @@ module Google
2249
2253
  #
2250
2254
  # See https://google.aip.dev/160 for more information on the grammar.
2251
2255
  # @param page_size [::Integer]
2252
- # Optional. The maximum number of saved queries to return per page. The service may
2253
- # return fewer than this value. If unspecified, at most 50 will be returned.
2256
+ # Optional. The maximum number of saved queries to return per page. The
2257
+ # service may return fewer than this value. If unspecified, at most 50 will
2258
+ # be returned.
2254
2259
  # The maximum value is 1000; values above 1000 will be coerced to 1000.
2255
2260
  # @param page_token [::String]
2256
2261
  # Optional. A page token, received from a previous `ListSavedQueries` call.
@@ -2279,13 +2284,11 @@ module Google
2279
2284
  # # Call the list_saved_queries method.
2280
2285
  # result = client.list_saved_queries request
2281
2286
  #
2282
- # # The returned object is of type Gapic::PagedEnumerable. You can
2283
- # # iterate over all elements by calling #each, and the enumerable
2284
- # # will lazily make API calls to fetch subsequent pages. Other
2285
- # # methods are also available for managing paging directly.
2286
- # result.each do |response|
2287
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2288
+ # # over elements, and API calls will be issued to fetch pages as needed.
2289
+ # result.each do |item|
2287
2290
  # # Each element is of type ::Google::Cloud::Asset::V1::SavedQuery.
2288
- # p response
2291
+ # p item
2289
2292
  # end
2290
2293
  #
2291
2294
  def list_saved_queries request, options = nil
@@ -2443,7 +2446,8 @@ module Google
2443
2446
  # the default parameter values, pass an empty Hash as a request object (see above).
2444
2447
  #
2445
2448
  # @param name [::String]
2446
- # Required. The name of the saved query to delete. It must be in the format of:
2449
+ # Required. The name of the saved query to delete. It must be in the format
2450
+ # of:
2447
2451
  #
2448
2452
  # * projects/project_number/savedQueries/saved_query_id
2449
2453
  # * folders/folder_number/savedQueries/saved_query_id
@@ -2614,6 +2618,368 @@ module Google
2614
2618
  raise ::Google::Cloud::Error.from_error(e)
2615
2619
  end
2616
2620
 
2621
+ ##
2622
+ # Analyzes organization policies under a scope.
2623
+ #
2624
+ # @overload analyze_org_policies(request, options = nil)
2625
+ # Pass arguments to `analyze_org_policies` via a request object, either of type
2626
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest} or an equivalent Hash.
2627
+ #
2628
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest, ::Hash]
2629
+ # A request object representing the call parameters. Required. To specify no
2630
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2631
+ # @param options [::Gapic::CallOptions, ::Hash]
2632
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2633
+ #
2634
+ # @overload analyze_org_policies(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2635
+ # Pass arguments to `analyze_org_policies` via keyword arguments. Note that at
2636
+ # least one keyword argument is required. To specify no parameters, or to keep all
2637
+ # the default parameter values, pass an empty Hash as a request object (see above).
2638
+ #
2639
+ # @param scope [::String]
2640
+ # Required. The organization to scope the request. Only organization
2641
+ # policies within the scope will be analyzed.
2642
+ #
2643
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2644
+ # @param constraint [::String]
2645
+ # Required. The name of the constraint to analyze organization policies for.
2646
+ # The response only contains analyzed organization policies for the provided
2647
+ # constraint.
2648
+ # @param filter [::String]
2649
+ # The expression to filter
2650
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}.
2651
+ # The only supported field is `consolidated_policy.attached_resource`, and
2652
+ # the only supported operator is `=`.
2653
+ #
2654
+ # Example:
2655
+ # consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001"
2656
+ # will return the org policy results of"folders/001".
2657
+ # @param page_size [::Integer]
2658
+ # The maximum number of items to return per page. If unspecified,
2659
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse#org_policy_results AnalyzeOrgPoliciesResponse.org_policy_results}
2660
+ # will contain 20 items with a maximum of 200.
2661
+ # @param page_token [::String]
2662
+ # The pagination token to retrieve the next page.
2663
+ #
2664
+ # @yield [response, operation] Access the result along with the RPC operation
2665
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
2666
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2667
+ #
2668
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult>]
2669
+ #
2670
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2671
+ #
2672
+ # @example Basic example
2673
+ # require "google/cloud/asset/v1"
2674
+ #
2675
+ # # Create a client object. The client can be reused for multiple calls.
2676
+ # client = Google::Cloud::Asset::V1::AssetService::Client.new
2677
+ #
2678
+ # # Create a request. To set request fields, pass in keyword arguments.
2679
+ # request = Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest.new
2680
+ #
2681
+ # # Call the analyze_org_policies method.
2682
+ # result = client.analyze_org_policies request
2683
+ #
2684
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2685
+ # # over elements, and API calls will be issued to fetch pages as needed.
2686
+ # result.each do |item|
2687
+ # # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesResponse::OrgPolicyResult.
2688
+ # p item
2689
+ # end
2690
+ #
2691
+ def analyze_org_policies request, options = nil
2692
+ raise ::ArgumentError, "request must be provided" if request.nil?
2693
+
2694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPoliciesRequest
2695
+
2696
+ # Converts hash and nil to an options object
2697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2698
+
2699
+ # Customize the options with defaults
2700
+ metadata = @config.rpcs.analyze_org_policies.metadata.to_h
2701
+
2702
+ # Set x-goog-api-client and x-goog-user-project headers
2703
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2705
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
2706
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2707
+
2708
+ header_params = {}
2709
+ if request.scope
2710
+ header_params["scope"] = request.scope
2711
+ end
2712
+
2713
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2714
+ metadata[:"x-goog-request-params"] ||= request_params_header
2715
+
2716
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policies.timeout,
2717
+ metadata: metadata,
2718
+ retry_policy: @config.rpcs.analyze_org_policies.retry_policy
2719
+
2720
+ options.apply_defaults timeout: @config.timeout,
2721
+ metadata: @config.metadata,
2722
+ retry_policy: @config.retry_policy
2723
+
2724
+ @asset_service_stub.call_rpc :analyze_org_policies, request, options: options do |response, operation|
2725
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, request, response, operation, options
2726
+ yield response, operation if block_given?
2727
+ return response
2728
+ end
2729
+ rescue ::GRPC::BadStatus => e
2730
+ raise ::Google::Cloud::Error.from_error(e)
2731
+ end
2732
+
2733
+ ##
2734
+ # Analyzes organization policies governed containers (projects, folders or
2735
+ # organization) under a scope.
2736
+ #
2737
+ # @overload analyze_org_policy_governed_containers(request, options = nil)
2738
+ # Pass arguments to `analyze_org_policy_governed_containers` via a request object, either of type
2739
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest} or an equivalent Hash.
2740
+ #
2741
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest, ::Hash]
2742
+ # A request object representing the call parameters. Required. To specify no
2743
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2744
+ # @param options [::Gapic::CallOptions, ::Hash]
2745
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2746
+ #
2747
+ # @overload analyze_org_policy_governed_containers(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2748
+ # Pass arguments to `analyze_org_policy_governed_containers` via keyword arguments. Note that at
2749
+ # least one keyword argument is required. To specify no parameters, or to keep all
2750
+ # the default parameter values, pass an empty Hash as a request object (see above).
2751
+ #
2752
+ # @param scope [::String]
2753
+ # Required. The organization to scope the request. Only organization
2754
+ # policies within the scope will be analyzed. The output containers will
2755
+ # also be limited to the ones governed by those in-scope organization
2756
+ # policies.
2757
+ #
2758
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2759
+ # @param constraint [::String]
2760
+ # Required. The name of the constraint to analyze governed containers for.
2761
+ # The analysis only contains organization policies for the provided
2762
+ # constraint.
2763
+ # @param filter [::String]
2764
+ # The expression to filter the governed containers in result.
2765
+ # The only supported field is `parent`, and the only supported operator is
2766
+ # `=`.
2767
+ #
2768
+ # Example:
2769
+ # parent="//cloudresourcemanager.googleapis.com/folders/001" will return all
2770
+ # containers under "folders/001".
2771
+ # @param page_size [::Integer]
2772
+ # The maximum number of items to return per page. If unspecified,
2773
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse#governed_containers AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}
2774
+ # will contain 100 items with a maximum of 200.
2775
+ # @param page_token [::String]
2776
+ # The pagination token to retrieve the next page.
2777
+ #
2778
+ # @yield [response, operation] Access the result along with the RPC operation
2779
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
2780
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2781
+ #
2782
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer>]
2783
+ #
2784
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2785
+ #
2786
+ # @example Basic example
2787
+ # require "google/cloud/asset/v1"
2788
+ #
2789
+ # # Create a client object. The client can be reused for multiple calls.
2790
+ # client = Google::Cloud::Asset::V1::AssetService::Client.new
2791
+ #
2792
+ # # Create a request. To set request fields, pass in keyword arguments.
2793
+ # request = Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest.new
2794
+ #
2795
+ # # Call the analyze_org_policy_governed_containers method.
2796
+ # result = client.analyze_org_policy_governed_containers request
2797
+ #
2798
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2799
+ # # over elements, and API calls will be issued to fetch pages as needed.
2800
+ # result.each do |item|
2801
+ # # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer.
2802
+ # p item
2803
+ # end
2804
+ #
2805
+ def analyze_org_policy_governed_containers request, options = nil
2806
+ raise ::ArgumentError, "request must be provided" if request.nil?
2807
+
2808
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedContainersRequest
2809
+
2810
+ # Converts hash and nil to an options object
2811
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2812
+
2813
+ # Customize the options with defaults
2814
+ metadata = @config.rpcs.analyze_org_policy_governed_containers.metadata.to_h
2815
+
2816
+ # Set x-goog-api-client and x-goog-user-project headers
2817
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2819
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
2820
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2821
+
2822
+ header_params = {}
2823
+ if request.scope
2824
+ header_params["scope"] = request.scope
2825
+ end
2826
+
2827
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2828
+ metadata[:"x-goog-request-params"] ||= request_params_header
2829
+
2830
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_containers.timeout,
2831
+ metadata: metadata,
2832
+ retry_policy: @config.rpcs.analyze_org_policy_governed_containers.retry_policy
2833
+
2834
+ options.apply_defaults timeout: @config.timeout,
2835
+ metadata: @config.metadata,
2836
+ retry_policy: @config.retry_policy
2837
+
2838
+ @asset_service_stub.call_rpc :analyze_org_policy_governed_containers, request, options: options do |response, operation|
2839
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, request, response, operation, options
2840
+ yield response, operation if block_given?
2841
+ return response
2842
+ end
2843
+ rescue ::GRPC::BadStatus => e
2844
+ raise ::Google::Cloud::Error.from_error(e)
2845
+ end
2846
+
2847
+ ##
2848
+ # Analyzes organization policies governed assets (Google Cloud resources or
2849
+ # policies) under a scope. This RPC supports custom constraints and the
2850
+ # following 10 canned constraints:
2851
+ #
2852
+ # * storage.uniformBucketLevelAccess
2853
+ # * iam.disableServiceAccountKeyCreation
2854
+ # * iam.allowedPolicyMemberDomains
2855
+ # * compute.vmExternalIpAccess
2856
+ # * appengine.enforceServiceAccountActAsCheck
2857
+ # * gcp.resourceLocations
2858
+ # * compute.trustedImageProjects
2859
+ # * compute.skipDefaultNetworkCreation
2860
+ # * compute.requireOsLogin
2861
+ # * compute.disableNestedVirtualization
2862
+ #
2863
+ # This RPC only returns either resources of types supported by [searchable
2864
+ # asset
2865
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types),
2866
+ # or IAM policies.
2867
+ #
2868
+ # @overload analyze_org_policy_governed_assets(request, options = nil)
2869
+ # Pass arguments to `analyze_org_policy_governed_assets` via a request object, either of type
2870
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest} or an equivalent Hash.
2871
+ #
2872
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest, ::Hash]
2873
+ # A request object representing the call parameters. Required. To specify no
2874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2875
+ # @param options [::Gapic::CallOptions, ::Hash]
2876
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2877
+ #
2878
+ # @overload analyze_org_policy_governed_assets(scope: nil, constraint: nil, filter: nil, page_size: nil, page_token: nil)
2879
+ # Pass arguments to `analyze_org_policy_governed_assets` via keyword arguments. Note that at
2880
+ # least one keyword argument is required. To specify no parameters, or to keep all
2881
+ # the default parameter values, pass an empty Hash as a request object (see above).
2882
+ #
2883
+ # @param scope [::String]
2884
+ # Required. The organization to scope the request. Only organization
2885
+ # policies within the scope will be analyzed. The output assets will
2886
+ # also be limited to the ones governed by those in-scope organization
2887
+ # policies.
2888
+ #
2889
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2890
+ # @param constraint [::String]
2891
+ # Required. The name of the constraint to analyze governed assets for. The
2892
+ # analysis only contains analyzed organization policies for the provided
2893
+ # constraint.
2894
+ # @param filter [::String]
2895
+ # The expression to filter the governed assets in result. The only supported
2896
+ # fields for governed resources are `governed_resource.project` and
2897
+ # `governed_resource.folders`. The only supported fields for governed iam
2898
+ # policies are `governed_iam_policy.project` and
2899
+ # `governed_iam_policy.folders`. The only supported operator is `=`.
2900
+ #
2901
+ # Example 1: governed_resource.project="projects/12345678" filter will return
2902
+ # all governed resources under projects/12345678 including the project
2903
+ # ifself, if applicable.
2904
+ #
2905
+ # Example 2: governed_iam_policy.folders="folders/12345678" filter will
2906
+ # return all governed iam policies under folders/12345678, if applicable.
2907
+ # @param page_size [::Integer]
2908
+ # The maximum number of items to return per page. If unspecified,
2909
+ # {::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse#governed_assets AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}
2910
+ # will contain 100 items with a maximum of 200.
2911
+ # @param page_token [::String]
2912
+ # The pagination token to retrieve the next page.
2913
+ #
2914
+ # @yield [response, operation] Access the result along with the RPC operation
2915
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
2916
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2917
+ #
2918
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset>]
2919
+ #
2920
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2921
+ #
2922
+ # @example Basic example
2923
+ # require "google/cloud/asset/v1"
2924
+ #
2925
+ # # Create a client object. The client can be reused for multiple calls.
2926
+ # client = Google::Cloud::Asset::V1::AssetService::Client.new
2927
+ #
2928
+ # # Create a request. To set request fields, pass in keyword arguments.
2929
+ # request = Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest.new
2930
+ #
2931
+ # # Call the analyze_org_policy_governed_assets method.
2932
+ # result = client.analyze_org_policy_governed_assets request
2933
+ #
2934
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2935
+ # # over elements, and API calls will be issued to fetch pages as needed.
2936
+ # result.each do |item|
2937
+ # # Each element is of type ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset.
2938
+ # p item
2939
+ # end
2940
+ #
2941
+ def analyze_org_policy_governed_assets request, options = nil
2942
+ raise ::ArgumentError, "request must be provided" if request.nil?
2943
+
2944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeOrgPolicyGovernedAssetsRequest
2945
+
2946
+ # Converts hash and nil to an options object
2947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2948
+
2949
+ # Customize the options with defaults
2950
+ metadata = @config.rpcs.analyze_org_policy_governed_assets.metadata.to_h
2951
+
2952
+ # Set x-goog-api-client and x-goog-user-project headers
2953
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2955
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
2956
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2957
+
2958
+ header_params = {}
2959
+ if request.scope
2960
+ header_params["scope"] = request.scope
2961
+ end
2962
+
2963
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2964
+ metadata[:"x-goog-request-params"] ||= request_params_header
2965
+
2966
+ options.apply_defaults timeout: @config.rpcs.analyze_org_policy_governed_assets.timeout,
2967
+ metadata: metadata,
2968
+ retry_policy: @config.rpcs.analyze_org_policy_governed_assets.retry_policy
2969
+
2970
+ options.apply_defaults timeout: @config.timeout,
2971
+ metadata: @config.metadata,
2972
+ retry_policy: @config.retry_policy
2973
+
2974
+ @asset_service_stub.call_rpc :analyze_org_policy_governed_assets, request, options: options do |response, operation|
2975
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, request, response, operation, options
2976
+ yield response, operation if block_given?
2977
+ return response
2978
+ end
2979
+ rescue ::GRPC::BadStatus => e
2980
+ raise ::Google::Cloud::Error.from_error(e)
2981
+ end
2982
+
2617
2983
  ##
2618
2984
  # Configuration class for the AssetService API.
2619
2985
  #
@@ -2849,6 +3215,21 @@ module Google
2849
3215
  # @return [::Gapic::Config::Method]
2850
3216
  #
2851
3217
  attr_reader :batch_get_effective_iam_policies
3218
+ ##
3219
+ # RPC-specific configuration for `analyze_org_policies`
3220
+ # @return [::Gapic::Config::Method]
3221
+ #
3222
+ attr_reader :analyze_org_policies
3223
+ ##
3224
+ # RPC-specific configuration for `analyze_org_policy_governed_containers`
3225
+ # @return [::Gapic::Config::Method]
3226
+ #
3227
+ attr_reader :analyze_org_policy_governed_containers
3228
+ ##
3229
+ # RPC-specific configuration for `analyze_org_policy_governed_assets`
3230
+ # @return [::Gapic::Config::Method]
3231
+ #
3232
+ attr_reader :analyze_org_policy_governed_assets
2852
3233
 
2853
3234
  # @private
2854
3235
  def initialize parent_rpcs = nil
@@ -2892,6 +3273,12 @@ module Google
2892
3273
  @delete_saved_query = ::Gapic::Config::Method.new delete_saved_query_config
2893
3274
  batch_get_effective_iam_policies_config = parent_rpcs.batch_get_effective_iam_policies if parent_rpcs.respond_to? :batch_get_effective_iam_policies
2894
3275
  @batch_get_effective_iam_policies = ::Gapic::Config::Method.new batch_get_effective_iam_policies_config
3276
+ analyze_org_policies_config = parent_rpcs.analyze_org_policies if parent_rpcs.respond_to? :analyze_org_policies
3277
+ @analyze_org_policies = ::Gapic::Config::Method.new analyze_org_policies_config
3278
+ analyze_org_policy_governed_containers_config = parent_rpcs.analyze_org_policy_governed_containers if parent_rpcs.respond_to? :analyze_org_policy_governed_containers
3279
+ @analyze_org_policy_governed_containers = ::Gapic::Config::Method.new analyze_org_policy_governed_containers_config
3280
+ analyze_org_policy_governed_assets_config = parent_rpcs.analyze_org_policy_governed_assets if parent_rpcs.respond_to? :analyze_org_policy_governed_assets
3281
+ @analyze_org_policy_governed_assets = ::Gapic::Config::Method.new analyze_org_policy_governed_assets_config
2895
3282
 
2896
3283
  yield self if block_given?
2897
3284
  end