import Foundation
import GenAPI

public struct BillingPeriodToggleResponse: Codable, Equatable {
    public var annualLabel: LocalizedTextResponse
    public var discountBadge: ColoredBadgeResponse
    public var monthlyLabel: LocalizedTextResponse

    public init(annualLabel: LocalizedTextResponse, discountBadge: ColoredBadgeResponse, monthlyLabel: LocalizedTextResponse) {
        self.annualLabel = annualLabel
        self.discountBadge = discountBadge
        self.monthlyLabel = monthlyLabel
    }

    init(_ remote: GenAPI.BillingPeriodToggleResponse) {
        self.annualLabel = LocalizedTextResponse(remote.annualLabel)
        self.discountBadge = ColoredBadgeResponse(remote.discountBadge)
        self.monthlyLabel = LocalizedTextResponse(remote.monthlyLabel)
    }
}

public struct ColoredBadgeResponse: Codable, Equatable {
    public var backgroundColor: String
    public var text: String
    public var textColor: String

    public init(backgroundColor: String, text: String, textColor: String) {
        self.backgroundColor = backgroundColor
        self.text = text
        self.textColor = textColor
    }

    init(_ remote: GenAPI.ColoredBadgeResponse) {
        self.backgroundColor = remote.backgroundColor
        self.text = remote.text
        self.textColor = remote.textColor
    }
}
