searchAssignments method

  1. @Deprecated('Not supported. Member documentation may have more information.')
Future<SearchAssignmentsResponse> searchAssignments(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? query,
  5. String? $fields,
})

Deprecated: Looks up assignments for a specified resource for a particular region.

If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is projects / * /locations / * , instead of projects / * /locations / * reservations / * . Note "-" cannot be used for projects nor locations.

Request parameters:

parent - Required. The resource name of the admin project(containing project and location), e.g.: projects/myproject/locations/US. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

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

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

query - Please specify resource name as assignee in the query. Examples:

  • assignee=projects/myproject * assignee=folders/123 * assignee=organizations/456

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

Completes with a SearchAssignmentsResponse.

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

@core.Deprecated(
  'Not supported. Member documentation may have more information.',
)
async.Future<SearchAssignmentsResponse> searchAssignments(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

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

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