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

import Foundation
import Get
import URLQueryEncoder

extension Paths.V2.External.Oauth.IntegrationPlaylist {
    public var clips: Clips {
        Clips(path: path + "/clips")
    }

    public struct Clips {
        /// Path: `/api/v2/external/oauth/integration-playlist/clips`
        public let path: String

        /// Get Integration Playlist Clips Via Oauth
        ///
        /// Retrieve clips from the user's integration-specific playlist via OAuth.
        /// 
        /// Returns up to 100 most recently created clips.
        /// Metadata is excluded by default unless `include_metadata=true` is passed.
        public func get(includeMetadata: Bool? = nil) -> Request<[GenAPI.ExternalClipSchema]> {
            Request(path: path, method: "GET", query: makeGetQuery(includeMetadata), id: "studio_api_bots_external_api_get_integration_playlist_clips_via_oauth")
        }

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