list method
Retrieves a paginated list of all roleAssignments.
Request parameters:
customer
- The unique ID for the customer's Google Workspace account. In
case of a multi-domain account, to fetch all groups for a customer, use
this field instead of domain
. You can also use the my_customer
alias
to represent your account's customerId
. The customerId
is also
returned as part of the [Users](/admin-sdk/directory/v1/reference/users)
resource. You must provide either the customer
or the domain
parameter.
includeIndirectRoleAssignments
- When set to true
, fetches indirect
role assignments (i.e. role assignment via a group) as well as direct
ones. Defaults to false
. You must specify user_key
or the indirect
role assignments will not be included.
maxResults
- Maximum number of results to return.
Value must be between "1" and "200".
pageToken
- Token to specify the next page in the list.
roleId
- Immutable ID of a role. If included in the request, returns
only role assignments containing this role ID.
userKey
- The primary email address, alias email address, or unique user
or group ID. If included in the request, returns role assignments only for
this user or group.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a RoleAssignments.
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<RoleAssignments> list(
core.String customer, {
core.bool? includeIndirectRoleAssignments,
core.int? maxResults,
core.String? pageToken,
core.String? roleId,
core.String? userKey,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (includeIndirectRoleAssignments != null)
'includeIndirectRoleAssignments': ['${includeIndirectRoleAssignments}'],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (roleId != null) 'roleId': [roleId],
if (userKey != null) 'userKey': [userKey],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'admin/directory/v1/customer/' +
commons.escapeVariable('$customer') +
'/roleassignments';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return RoleAssignments.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}