addUsersToChannel

abstract suspend fun addUsersToChannel(    channel: Channel,     type: ChannelUserAffiliationType,     contactsId: List<String>): RainbowResult<Pair<List<ChannelUser>, List<String>>>

Add users to a channel.

This method allows you to add users to the specified channel. The users are added based on their affiliation type. The list of users added successfully and the list of user IDs that failed to be added are returned in the response.

The ChannelUserAffiliationType enum defines the possible affiliation types for users:

  • ChannelUserAffiliationType.OWNER for users with owner privileges.

  • ChannelUserAffiliationType.PUBLISHER for users with publisher privileges.

  • ChannelUserAffiliationType.MEMBER for regular users with member privileges.

  • ChannelUserAffiliationType.NONE for removing an affiliation (this is equivalent to calling deleteUsersFromChannel method).

Return

A RainbowResult containing a pair of lists:

  • A list of ChannelUser objects representing the users successfully added to the channel.

  • A list of String containing the user IDs that failed to be added.

Parameters

channel

The Channel object to which users are being added.

type

The ChannelUserAffiliationType that specifies the affiliation type of the users being added (e.g., OWNER, PUBLISHER, MEMBER, or NONE).

contactsId

A list of String containing the user IDs of the users to be added to the channel.


abstract suspend fun addUsersToChannel(    channel: Channel,     type: ChannelUserAffiliationType,     contacts: ArrayList<IRainbowContact>): RainbowResult<Pair<List<ChannelUser>, List<String>>>

Add users to a channel.

This method allows you to add users to the specified channel based on their affiliation type. The users are added successfully, and the response will include:

  • A list of users that were successfully added.

  • A list of contact IDs that failed to be added.

The ChannelUserAffiliationType enum defines the possible affiliation types for users:

  • ChannelUserAffiliationType.OWNER for users with owner privileges.

  • ChannelUserAffiliationType.PUBLISHER for users with publisher privileges.

  • ChannelUserAffiliationType.MEMBER for regular users with member privileges.

  • ChannelUserAffiliationType.NONE for removing an affiliation, which is equivalent to calling deleteUsersFromChannel method.

Return

A RainbowResult containing a pair of lists:

  • A list of ChannelUser objects representing the users successfully added to the channel.

  • A list of String containing the contact IDs that failed to be added.

Parameters

channel

The Channel object to which users are being added.

type

The ChannelUserAffiliationType that specifies the affiliation type of the users being added (e.g., OWNER, PUBLISHER, MEMBER, or NONE).

contacts

A list of IRainbowContact objects representing the contacts to be added to the channel.