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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Clips {
    public var children: Children {
        Children(path: path + "/children")
    }

    public struct Children {
        /// Path: `/api/clips/children`
        public let path: String

        /// Get Children
        ///
        /// Find child clips for the given clip ID
        public func get(parameters: GetParameters) -> Request<GenAPI.ChildClipsSchema> {
            Request(path: path, method: "GET", query: parameters.asQuery, id: "studio_api_clips_api_get_children")
        }

        public struct GetParameters {
            public var clipId: String
            public var followConcatPaths: Bool?
            public var descendFromRoots: Bool?
            public var excludeNonOwnedClips: Bool?

            public init(clipId: String, followConcatPaths: Bool? = nil, descendFromRoots: Bool? = nil, excludeNonOwnedClips: Bool? = nil) {
                self.clipId = clipId
                self.followConcatPaths = followConcatPaths
                self.descendFromRoots = descendFromRoots
                self.excludeNonOwnedClips = excludeNonOwnedClips
            }

            public var asQuery: [(String, String?)] {
                let encoder = URLQueryEncoder()
                encoder.encode(clipId, forKey: "clip_id")
                encoder.encode(followConcatPaths, forKey: "follow_concat_paths")
                encoder.encode(descendFromRoots, forKey: "descend_from_roots")
                encoder.encode(excludeNonOwnedClips, forKey: "exclude_non_owned_clips")
                return encoder.items
            }
        }
    }
}
