list method

Future<ListAssignmentsResponse> list(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? $fields,
})

Lists assignments.

Only explicitly created assignments will be returned. Example: * Organization organizationA contains two projects, project1 and project2. * Reservation res1 exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: and In this example, ListAssignments will just return the above two assignments for reservation res1, and no expansion/merge will happen. The wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. Note "-" cannot be used for projects nor locations.

Request parameters:

parent - Required. The parent resource name e.g.: projects/myproject/locations/US/reservations/team1-prod Or: projects/myproject/locations/US/reservations/- Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/reservations/\[^/\]+$.

pageSize - The maximum number of items to return per page.

pageToken - The next_page_token value returned from a previous List request, if any.

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

Completes with a ListAssignmentsResponse.

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

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

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