//
//  TeaserDM.swift
//  WOKA
//
//  Created by MacBook Pro on 24/06/24.
//

import Foundation

// MARK: - TeaserDM
struct TeaserDM: Codable {
    let result: [ResultData]?
    let totalRecords: Int?

    enum CodingKeys: String, CodingKey {
        case result
        case totalRecords = "total_records"
    }
    
    // MARK: - ResultData
    struct ResultData: Codable {
        let id, watchShowsMasterID, seasonMasterID, teaserNumber: Int?
        let serialNumber: Int?
        let teaserTitle, teaserDescription: String?
        let thumbnailPath: String?
        let thumbnailImgURL: String?
        let teaserURL: String?
        let languageMasterID: Int?
        let tagsKeyword, teaserDuration, releaseDate: String?
        let contentMoreDetails: [ContentMoreDetail]?
        let seasonData: SeasonData?
//        let userVideoView: [JSONAny]?

        enum CodingKeys: String, CodingKey {
            case id
            case watchShowsMasterID = "watch_shows_master_id"
            case seasonMasterID = "season_master_id"
            case teaserNumber = "teaser_number"
            case serialNumber = "serial_number"
            case teaserTitle = "teaser_title"
            case teaserDescription = "teaser_description"
            case thumbnailPath = "thumbnail_path"
            case thumbnailImgURL = "thumbnail_img_url"
            case teaserURL = "teaser_url"
            case languageMasterID = "language_master_id"
            case tagsKeyword = "tags_keyword"
            case teaserDuration = "teaser_duration"
            case releaseDate = "release_date"
            case contentMoreDetails = "content_more_details"
            case seasonData = "season_data"
//            case userVideoView = "user_video_view"
        }
    }

    // MARK: - ContentMoreDetail
    struct ContentMoreDetail: Codable {
        let id, contentID, postType, languageMasterID: Int?
        let title, description, tagsKeywords: String?
        let contentHDURL, contentSDURL: String?

        enum CodingKeys: String, CodingKey {
            case id
            case contentID = "content_id"
            case postType = "post_type"
            case languageMasterID = "language_master_id"
            case title, description
            case tagsKeywords = "tags_keywords"
            case contentHDURL = "content_hd_url"
            case contentSDURL = "content_sd_url"
        }
    }

    // MARK: - SeasonData
    struct SeasonData: Codable {
        let id, watchShowsMasterID: Int?
        let seasonNumber: String?

        enum CodingKeys: String, CodingKey {
            case id
            case watchShowsMasterID = "watch_shows_master_id"
            case seasonNumber = "season_number"
        }
    }

}
