memberships method

Future<PaginatedTwitterLists> memberships({
  1. String? userId,
  2. String? screenName,
  3. int? count,
  4. String? cursor,
  5. bool? filterToOwnedLists,
  6. 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.

See https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships.

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);
}