memberships method
- String? userId,
- String? screenName,
- int? count,
- String? cursor,
- bool? filterToOwnedLists,
- TransformResponse<
PaginatedTwitterLists> transform = defaultPaginatedTwitterListsTransform,
Returns the lists the specified user has been added to. If userId
or
screenName
are not provided, the memberships for the authenticating
user are returned.
userId
The ID of the user for whom to return results.
screenName
The screen name of the user for whom to return results.
count
The amount of results to return per page. Defaults to 20. No
more than 1000 results will ever be returned in a single page.
cursor
Breaks the results into pages. Provide a value of -1
to begin
paging. Provide values as returned in the response body's nextCursor
and previousCursor
attributes to page back and forth in the list.
filterToOwnedLists
When set to true
, will return just lists the
authenticating user owns, and the user represented by userId
or
screenName
is a member of.
transform
Can be used to parse the request. By default, the response is
parsed in an isolate.
Implementation
Future<PaginatedTwitterLists> memberships({
String? userId,
String? screenName,
int? count,
String? cursor,
bool? filterToOwnedLists,
TransformResponse<PaginatedTwitterLists> transform =
defaultPaginatedTwitterListsTransform,
}) async {
final params = <String, String>{}
..addParameter('user_id', userId)
..addParameter('screen_name', screenName)
..addParameter('count', count)
..addParameter('cursor', cursor)
..addParameter('filter_to_owned_lists', filterToOwnedLists);
return client
.get(Uri.https('api.twitter.com', '1.1/lists/memberships.json', params))
.then(transform);
}