list method
Lists users that are accessible to the current user.
If two users have user roles on the same partner or advertiser, they can access each other. This method has unique authentication requirements. Read the prerequisites in our [Managing Users guide](/display-video/api/guides/users/overview#prerequisites) before using this method. The "Try this method" feature does not work for this method.
Request parameters:
filter
- Allows filtering by user fields. Supported syntax: * Filter
expressions are made up of one or more restrictions. * Restrictions can be
combined by the logical operator `AND`. * A restriction has the form of
`{field} {operator} {value}`. * The
`budget.budget_segments.date_range.end_date` field must use the `LESS
THAN (<)` operator. * The `displayName and `email` field must use the
`HAS (:)` operator. * All other fields must use the `EQUALS (=)`
operator. Supported fields: * `assignedUserRole.advertiserId` *
`assignedUserRole.entityType` * This is synthetic field of
`AssignedUserRole` used for filtering. Identifies the type of entity to
which the user role is assigned. Valid values are `Partner` and
`Advertiser`. * `assignedUserRole.parentPartnerId` * This is a
synthetic field of `AssignedUserRole` used for filtering. Identifies the
parent partner of the entity to which the user role is assigned. *
`assignedUserRole.partnerId` * `assignedUserRole.userRole` *
`displayName` * `email` Examples: * The user with `displayName`
containing "foo": `displayName:"foo"` * The user with `email`
containing "bar": `email:"bar"` * All users with standard user roles:
`assignedUserRole.userRole="STANDARD"` * All users with user roles for
partner 123: `assignedUserRole.partnerId="123"` * All users with user
roles for advertiser 123: `assignedUserRole.advertiserId="123"` * All
users with partner level user roles: `entityType="PARTNER"` * All users
with user roles for partner 123 and advertisers under partner 123:
`parentPartnerId="123"` The length of this field should be no more than
500 characters. Reference our [filter `LIST`
requests](/display-video/api/guides/how-tos/filters) guide for more
information.
orderBy
- Field by which to sort the list. Acceptable values are: *
displayName
(default) The default sorting order is ascending. To specify
descending order for a field, a suffix "desc" should be added to the field
name. For example, displayName desc
.
pageSize
- Requested page size. Must be between 1
and 200
. If
unspecified will default to 100
.
pageToken
- A token identifying a page of results the server should
return. Typically, this is the value of next_page_token returned from the
previous call to ListUsers
method. If not specified, the first page of
results will be returned.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListUsersResponse.
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<ListUsersResponse> list({
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
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 ($fields != null) 'fields': [$fields],
};
const url_ = 'v2/users';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListUsersResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}