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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Clips {
    public var alignedClips: AlignedClips {
        AlignedClips(path: path + "/aligned_clips")
    }

    public struct AlignedClips {
        /// Path: `/api/clips/aligned_clips`
        public let path: String

        /// Get Aligned Clips
        public func get(parameters: GetParameters? = nil) -> Request<GenAPI.AlignedClipsResponseSchema> {
            Request(path: path, method: "GET", query: parameters?.asQuery, id: "studio_api_clips_api_get_aligned_clips")
        }

        public struct GetParameters {
            public var historyClipId: String?
            public var historyEndSeconds: Double?
            public var historyEndSecondsGte: Double?
            public var historyEndSecondsLte: Double?
            public var futureClipId: String?
            public var futureStartSeconds: Double?
            public var futureStartSecondsGte: Double?
            public var futureStartSecondsLte: Double?
            public var windowSeconds: Double?

            public init(historyClipId: String? = nil, historyEndSeconds: Double? = nil, historyEndSecondsGte: Double? = nil, historyEndSecondsLte: Double? = nil, futureClipId: String? = nil, futureStartSeconds: Double? = nil, futureStartSecondsGte: Double? = nil, futureStartSecondsLte: Double? = nil, windowSeconds: Double? = nil) {
                self.historyClipId = historyClipId
                self.historyEndSeconds = historyEndSeconds
                self.historyEndSecondsGte = historyEndSecondsGte
                self.historyEndSecondsLte = historyEndSecondsLte
                self.futureClipId = futureClipId
                self.futureStartSeconds = futureStartSeconds
                self.futureStartSecondsGte = futureStartSecondsGte
                self.futureStartSecondsLte = futureStartSecondsLte
                self.windowSeconds = windowSeconds
            }

            public var asQuery: [(String, String?)] {
                let encoder = URLQueryEncoder()
                encoder.encode(historyClipId, forKey: "history_clip_id")
                encoder.encode(historyEndSeconds, forKey: "history_end_seconds")
                encoder.encode(historyEndSecondsGte, forKey: "history_end_seconds_gte")
                encoder.encode(historyEndSecondsLte, forKey: "history_end_seconds_lte")
                encoder.encode(futureClipId, forKey: "future_clip_id")
                encoder.encode(futureStartSeconds, forKey: "future_start_seconds")
                encoder.encode(futureStartSecondsGte, forKey: "future_start_seconds_gte")
                encoder.encode(futureStartSecondsLte, forKey: "future_start_seconds_lte")
                encoder.encode(windowSeconds, forKey: "window_seconds")
                return encoder.items
            }
        }
    }
}
