AddToMany adds an activity to multiple feeds at once.
(ctx context.Context, activity Activity, feeds ...Feed)
| 168 | |
| 169 | // AddToMany adds an activity to multiple feeds at once. |
| 170 | func (c *Client) AddToMany(ctx context.Context, activity Activity, feeds ...Feed) error { |
| 171 | endpoint := c.makeEndpoint("feed/add_to_many/") |
| 172 | ids := make([]string, len(feeds)) |
| 173 | for i := range feeds { |
| 174 | ids[i] = feeds[i].ID() |
| 175 | } |
| 176 | req := AddToManyRequest{ |
| 177 | Activity: activity, |
| 178 | FeedIDs: ids, |
| 179 | } |
| 180 | _, err := c.post(ctx, endpoint, req, c.authenticator.feedAuth(resFeed, nil)) |
| 181 | return err |
| 182 | } |
| 183 | |
| 184 | // FollowMany creates multiple follows at once. |
| 185 | func (c *Client) FollowMany(ctx context.Context, relationships []FollowRelationship, opts ...FollowManyOption) error { |