package codex

// CodexConfig contains configuration for the OpenAI Codex / ChatGPT backend.
type CodexConfig struct {
	ID                      int               `yaml:"id,omitempty"`
	Name                    string            `yaml:"name,omitempty"`
	BaseURL                 string            `yaml:"base_url,omitempty"`
	Active                  *bool             `yaml:"active,omitempty"`
	Weight                  float64           `yaml:"weight,omitempty"`
	WeightDiffThreshold     float64           `yaml:"weight_diff_threshold,omitempty"`
	AdaptiveWeights         bool              `yaml:"adaptive_weights,omitempty"`
	AllowedAPIKeys          []string          `yaml:"allowed_api_keys,omitempty"`
	AuthToken               string            `yaml:"auth_token,omitempty"`
	AuthJSONContent         string            `yaml:"auth_json_content,omitempty"`
	AuthJSONPath            string            `yaml:"auth_json_path,omitempty"`
	APIKey                  string            `yaml:"api_key,omitempty"`
	Mode                    string            `yaml:"mode,omitempty"`
	RequiresOAuthBeta       bool              `yaml:"requires_oauth_beta,omitempty"`
	RequiresOAuthBetaLegacy bool              `yaml:"_requires_oauth_beta,omitempty"`
	CustomPrompt            string            `yaml:"custom_prompt,omitempty"`
	CustomPromptModels      []string          `yaml:"custom_prompt_models,omitempty"`
	AuthJSONContents        []string          `yaml:"auth_json_contents,omitempty"`
	AuthJSONPaths           []string          `yaml:"auth_json_paths,omitempty"`
	AuthFiles               []CodexAuthConfig `yaml:"auth_files,omitempty"`
	Fallbacks               []CodexConfig     `yaml:"fallbacks,omitempty"`
}

// CodexAuthConfig is the compact auth-backend shape nested under CodexConfig.
type CodexAuthConfig struct {
	ID                      int      `yaml:"id,omitempty"`
	Name                    string   `yaml:"name,omitempty"`
	Active                  *bool    `yaml:"active,omitempty"`
	Weight                  float64  `yaml:"weight,omitempty"`
	AllowedAPIKeys          []string `yaml:"allowed_api_keys,omitempty"`
	AuthToken               string   `yaml:"auth_token,omitempty"`
	AuthJSONContent         string   `yaml:"auth_json_content,omitempty"`
	AuthJSONPath            string   `yaml:"auth_json_path,omitempty"`
	APIKey                  string   `yaml:"api_key,omitempty"`
	Mode                    string   `yaml:"mode,omitempty"`
	RequiresOAuthBeta       bool     `yaml:"requires_oauth_beta,omitempty"`
	RequiresOAuthBetaLegacy bool     `yaml:"_requires_oauth_beta,omitempty"`
}
