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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Billing {
    public var downloadUsage: DownloadUsage {
        DownloadUsage(path: path + "/download-usage")
    }

    public struct DownloadUsage {
        /// Path: `/api/billing/download-usage`
        public let path: String

        /// Get Download Usage
        ///
        /// Get the user's current month download usage and limits, optionally check specific clip ownership
        public func get(clipId: String? = nil) -> Request<GenAPI.DownloadUsageResponse> {
            Request(path: path, method: "GET", query: makeGetQuery(clipId), id: "studio_api_bots_billing_api_get_download_usage")
        }

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