getOrCreateFollows abstract method
Creates or updates multiple follow relationships in a batch operation.
Creates or updates follow relationships for multiple feeds using the provided request data.
Returns both newly created follows and existing follows that were already present.
Example:
final result = await client.getOrCreateFollows(
FollowBatchRequest(
follows: [
FollowRequest(
source: FeedId.user('john').rawValue,
target: FeedId.user('jane').rawValue,
),
FollowRequest(
source: FeedId.user('john').rawValue,
target: FeedId.user('bob').rawValue,
),
],
),
);
switch (result) {
case Success(data: final batchFollowData):
print('Created ${batchFollowData.created.length} new follows');
print('Total follows: ${batchFollowData.follows.length}');
case Failure(error: final error):
print('Failed to get or create follows: $error');
}
Returns a Result containing a BatchFollowData with the follows or an error.
Implementation
Future<Result<BatchFollowData>> getOrCreateFollows(
api.FollowBatchRequest request,
);