fetchForResourceType method

Future<FetchBackupPlanAssociationsForResourceTypeResponse> fetchForResourceType(
  1. String parent, {
  2. String? filter,
  3. String? orderBy,
  4. int? pageSize,
  5. String? pageToken,
  6. String? resourceType,
  7. String? $fields,
})

List BackupPlanAssociations for a given resource type.

Request parameters:

parent - Required. The parent resource name. Format: projects/{project}/locations/{location} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

filter - Optional. A filter expression that filters the results fetched in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. Supported fields: * resource * backup_plan * state * data_source * cloud_sql_instance_backup_plan_association_properties.instance_create_time

orderBy - Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields: * name

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

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

resourceType - Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance

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

Completes with a FetchBackupPlanAssociationsForResourceTypeResponse.

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<FetchBackupPlanAssociationsForResourceTypeResponse>
fetchForResourceType(
  core.String parent, {
  core.String? filter,
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? resourceType,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (resourceType != null) 'resourceType': [resourceType],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' +
      core.Uri.encodeFull('$parent') +
      '/backupPlanAssociations:fetchForResourceType';

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