fetchForResourceType method
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 Google Cloud 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>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'resourceType': ?resourceType == null ? null : [resourceType],
'fields': ?$fields == null ? null : [$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>,
);
}