/** * グループチャットを新規作成 * @param Room $room * @param MembersCollection $members * @return Room */ public function create(Room $room, MembersCollection $members) { $result = $this->client->post('rooms', ['body' => ['name' => $room->name, 'description' => $room->description, 'members_admin_ids' => implode(',', $members->getAdminIds()), 'members_member_ids' => implode(',', $members->getMemberIds()), 'members_readonly_ids' => implode(',', $members->getReadonlyIds())]])->json(); $room->roomId = $result['room_id']; return $room; }
/** * @param MembersCollection $members */ public function update(MembersCollection $members) { $options = ['body' => ['members_admin_ids' => implode(',', $members->getAdminIds()), 'members_member_ids' => implode(',', $members->getMemberIds()), 'members_readonly_ids' => implode(',', $members->getReadonlyIds())]]; $this->client->put(['rooms/{roomId}/members', ['roomId' => $this->roomId]], $options); }