ownerships method

Future<PaginatedTwitterLists> ownerships({
  1. String? userId,
  2. String? screenName,
  3. int? count,
  4. String? cursor,
  5. TransformResponse<PaginatedTwitterLists> transform = defaultPaginatedTwitterListsTransform,
})

Returns the lists owned by the specified Twitter user. Private lists will only be shown if the authenticated user is also the owner of the lists.

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.

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-ownerships.

Implementation

Future<PaginatedTwitterLists> ownerships({
  String? userId,
  String? screenName,
  int? count,
  String? cursor,
  TransformResponse<PaginatedTwitterLists> transform =
      defaultPaginatedTwitterListsTransform,
}) async {
  final params = <String, String>{}
    ..addParameter('user_id', userId)
    ..addParameter('screen_name', screenName)
    ..addParameter('count', count)
    ..addParameter('cursor', cursor);

  return client
      .get(Uri.https('api.twitter.com', '1.1/lists/ownerships.json', params))
      .then(transform);
}