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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Clips.WithClipId {
    public var ancestors: Ancestors {
        Ancestors(path: path + "/ancestors")
    }

    public struct Ancestors {
        /// Path: `/api/clips/{clip_id}/ancestors`
        public let path: String

        /// Get Ancestors
        ///
        /// Get all ancestor clips for the given clip ID
        public func get(excludeNonOwnedClips: Bool? = nil) -> Request<GenAPI.AncestorClipsSchema> {
            Request(path: path, method: "GET", query: makeGetQuery(excludeNonOwnedClips), id: "studio_api_clips_api_get_ancestors")
        }

        private func makeGetQuery(_ excludeNonOwnedClips: Bool?) -> [(String, String?)] {
            let encoder = URLQueryEncoder()
            encoder.encode(excludeNonOwnedClips, forKey: "exclude_non_owned_clips")
            return encoder.items
        }
    }
}
