fetchForResourceType method

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

Fetch DataSourceReferences for a given project, location and 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: * data_source * data_source_gcp_resource_info.gcp_resourcename * data_source_backup_config_state * data_source_backup_count * data_source_backup_config_info.last_backup_state * data_source_gcp_resource_info.gcp_resourcename * data_source_gcp_resource_info.type * data_source_gcp_resource_info.location * data_source_gcp_resource_info.cloud_sql_instance_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 DataSourceReferences to return. The service may return fewer than this value. If unspecified, at most 50 DataSourceReferences 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 FetchDataSourceReferencesForResourceType. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to FetchDataSourceReferencesForResourceType 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 FetchDataSourceReferencesForResourceTypeResponse.

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<FetchDataSourceReferencesForResourceTypeResponse>
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') +
      '/dataSourceReferences:fetchForResourceType';

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