// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import Get
import URLQueryEncoder

extension Paths.Notification {
    public var v2: V2 {
        V2(path: path + "/v2")
    }

    public struct V2 {
        /// Path: `/api/notification/v2`
        public let path: String

        /// Get Notifications V2
        ///
        /// Fetch the notifications.
        public func get(afterDatetimeUtc: Date? = nil, beforeDatetimeUtc: Date? = nil) -> Request<GenAPI.UserNotificationV2Schema> {
            Request(path: path, method: "GET", query: makeGetQuery(afterDatetimeUtc, beforeDatetimeUtc), id: "studio_api_bots_notification_api_get_notifications_v2")
        }

        private func makeGetQuery(_ afterDatetimeUtc: Date?, _ beforeDatetimeUtc: Date?) -> [(String, String?)] {
            let encoder = URLQueryEncoder()
            encoder.encode(afterDatetimeUtc, forKey: "after_datetime_utc")
            encoder.encode(beforeDatetimeUtc, forKey: "before_datetime_utc")
            return encoder.items
        }
    }
}
