45 lines · 1.3 KB · Swift
RawDownload
import Foundation public enum MiniMaxAPIRegion: String, CaseIterable, Sendable {    case global    case chinaMainland = "cn"     private static let codingPlanPath = "user-center/payment/coding-plan"    private static let codingPlanQuery = "cycle_type=3"    private static let remainsPath = "v1/api/openplatform/coding_plan/remains"     public var displayName: String {        switch self {        case .global:            "Global (platform.minimax.io)"        case .chinaMainland:            "China mainland (platform.minimaxi.com)"        }    }     public var baseURLString: String {        switch self {        case .global:            "https://platform.minimax.io"        case .chinaMainland:            "https://platform.minimaxi.com"        }    }     public var codingPlanURL: URL {        var components = URLComponents(string: self.baseURLString)!        components.path = "/" + Self.codingPlanPath        components.query = Self.codingPlanQuery        return components.url!    }     public var codingPlanRefererURL: URL {        var components = URLComponents(string: self.baseURLString)!        components.path = "/" + Self.codingPlanPath        return components.url!    }     public var remainsURL: URL {        URL(string: self.baseURLString)!.appendingPathComponent(Self.remainsPath)    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t