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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Cms {
    public var subscriptionPage: SubscriptionPage {
        SubscriptionPage(path: path + "/subscription-page")
    }

    public struct SubscriptionPage {
        /// Path: `/api/cms/subscription-page`
        public let path: String

        /// Get Subscription Page
        ///
        /// Get subscription page marketing content.
        /// 
        /// This endpoint returns ONLY marketing content (headlines, feature descriptions,
        /// CTA text, etc.). Actual pricing, credit amounts, and user subscription state
        /// should be fetched separately from `/api/billing/info`.
        /// 
        /// Clients should combine both endpoints:
        /// 1. Call `/api/cms/subscription-page` for marketing copy
        /// 2. Call `/api/billing/info` for pricing and user state
        /// 3. Merge the data for rendering
        /// 
        /// Language is determined from the Accept-Language header (defaults to "en").
        /// 
        /// Args:
        ///     platform: Optional platform filter ("web", "ios", "android")
        /// 
        /// Returns:
        ///     SubscriptionPageResponse with translated marketing content
        /// 
        /// Example Response:
        ///     {
        ///       "content": {
        ///         "header": {
        ///           "credits_display_template": {"text": "{credits} créditos"},
        ///           "daily_limit_template": {"text": "{songs} canciones restantes hoy"}
        ///         },
        ///         "plans": {
        ///           "pro": {
        ///             "display_name": {"text": "Pro"},
        ///             "tagline": {"text": "Mejor para creadores regulares"},
        ///             ...
        ///           }
        ///         },
        ///         ...
        ///       },
        ///       "language": "es",
        ///       "platform": "web"
        ///     }
        public func get(platform: String? = nil) -> Request<GenAPI.SubscriptionPageResponse> {
            Request(path: path, method: "GET", query: makeGetQuery(platform), id: "studio_api_cms_api_get_subscription_page")
        }

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