import { isArrayOf, isObject } from '../../utils/types'
import { AnnouncementResponse, isAnnouncementResponse } from '../announcement/types'

type AnnouncementsResponse = {
    list_of_announcements: AnnouncementResponse[],
    Success: boolean
}

const isAnnouncementsResponse = (obj: unknown): obj is AnnouncementsResponse => isObject(obj, {
    'list_of_announcements': obj => isArrayOf<AnnouncementResponse>(obj, isAnnouncementResponse),
    'Success': 'boolean'
})

export type {
    AnnouncementsResponse,
}

export {
    isAnnouncementsResponse,
}
