search method

Future<GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse> search(
  1. String scope, {
  2. String? cryptoKey,
  3. int? pageSize,
  4. String? pageToken,
  5. List<String>? resourceTypes,
  6. String? $fields,
})

Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.

Request parameters:

scope - Required. Resource name of the organization. Example: organizations/123 Value must have pattern ^organizations/\[^/\]+$.

cryptoKey - Required. The resource name of the CryptoKey.

pageSize - The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500.

pageToken - A page token, received from a previous KeyTrackingService.SearchProtectedResources call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to KeyTrackingService.SearchProtectedResources must match the call that provided the page token.

resourceTypes - Optional. A list of resource types that this request searches for. If empty, it will search all the trackable resource types. Regular expressions are also supported. For example: * compute.googleapis.com.* snapshots resources whose type starts with compute.googleapis.com. * .*Image snapshots resources whose type ends with Image. * .*Image.* snapshots resources whose type contains Image. See RE2 for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse>
    search(
  core.String scope, {
  core.String? cryptoKey,
  core.int? pageSize,
  core.String? pageToken,
  core.List<core.String>? resourceTypes,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (cryptoKey != null) 'cryptoKey': [cryptoKey],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (resourceTypes != null) 'resourceTypes': resourceTypes,
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$scope') + '/protectedResources:search';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return GoogleCloudKmsInventoryV1SearchProtectedResourcesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}