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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Clips {
    public var setAllRemixPermissions: SetAllRemixPermissions {
        SetAllRemixPermissions(path: path + "/set_all_remix_permissions")
    }

    public struct SetAllRemixPermissions {
        /// Path: `/api/clips/set_all_remix_permissions`
        public let path: String

        /// Set All Remix Permissions
        ///
        /// Set remix permissions for all public clips owned by the requesting user.
        /// 
        /// This endpoint efficiently updates the remix permission setting for all of a user's public clips.
        /// It will add or update the can_remix field for all clips regardless of the value being set.
        /// 
        /// Args:
        ///     request: The HTTP request.
        ///     can_remix: Boolean indicating whether to allow remixes.
        ///     batch_size: Number of clips to process in each batch (default: 100).
        /// 
        /// Returns:
        ///     Dict with count of updated clips and status.
        public func post(canRemix: Bool, batchSize: Int? = nil) -> Request<GenAPI.RemixPermissionsUpdateSchema> {
            Request(path: path, method: "POST", query: makePostQuery(canRemix, batchSize), id: "studio_api_clips_api_set_all_remix_permissions")
        }

        private func makePostQuery(_ canRemix: Bool, _ batchSize: Int?) -> [(String, String?)] {
            let encoder = URLQueryEncoder()
            encoder.encode(canRemix, forKey: "can_remix")
            encoder.encode(batchSize, forKey: "batch_size")
            return encoder.items
        }
    }
}
