models/communities/UpdateGroupMembersQuery.js

import UserIdList from '../UserIdList.js';

export default class UpdateGroupMembersQuery {
    /**
     * Creates an UpdateGroupMembersQuery.
     * @constructor UpdateGroupMembersQuery
     * @param {string} groupId - Group ID
     * @param {UserIdList} userIdList - User IDs
     */
    constructor(groupId, userIdList) {
        this.groupId = groupId;
        this.userIdList = userIdList;
    }

    /**
    * Create query to add users to a group.
    *
    * @memberof UpdateGroupMembersQuery
    * @param {string} groupId - Group ID
    * @param {UserIdList} userIdList - User IDs
    * @return {UpdateGroupMembersQuery} New instance.
    */
    static create(groupId, userIdList) {
        return new UpdateGroupMembersQuery(groupId, userIdList);
    }

    /**
     * Define role for users.
     *
     * @memberof UpdateGroupMembersQuery
     * @instance
     * @param {number} role - Default User's role.
     * @return {UpdateGroupMembersQuery} Same instance.
     */
    withRole(role) {
        this.role = role;
        return this;
    }

    /**
     * Define status for users.
     *
     * @memberof UpdateGroupMembersQuery
     * @instance
     * @param {number} memberStatus - Default User's status.
     * @return {UpdateGroupMembersQuery} Same instance.
     */
    withMemberStatus(memberStatus) {
        this.status = memberStatus;
        return this;
    }
}