mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
55 lines
1.8 KiB
Swift
55 lines
1.8 KiB
Swift
//
|
|
// ConfigKey.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(AnyCodable)
|
|
import AnyCodable
|
|
#endif
|
|
|
|
/** Configuration key metadata for provider setup */
|
|
public struct ConfigKey: Codable, JSONEncodable, Hashable {
|
|
|
|
/** Optional default value for the key */
|
|
public var _default: String?
|
|
/** The name of the configuration key (e.g., \"API_KEY\") */
|
|
public var name: String
|
|
/** Whether this key should be configured using OAuth device code flow When true, the provider's configure_oauth() method will be called instead of prompting for manual input */
|
|
public var oauthFlow: Bool
|
|
/** Whether this key is required for the provider to function */
|
|
public var _required: Bool
|
|
/** Whether this key should be stored securely (e.g., in keychain) */
|
|
public var secret: Bool
|
|
|
|
public init(_default: String? = nil, name: String, oauthFlow: Bool, _required: Bool, secret: Bool) {
|
|
self._default = _default
|
|
self.name = name
|
|
self.oauthFlow = oauthFlow
|
|
self._required = _required
|
|
self.secret = secret
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case _default = "default"
|
|
case name
|
|
case oauthFlow = "oauth_flow"
|
|
case _required = "required"
|
|
case secret
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(_default, forKey: ._default)
|
|
try container.encode(name, forKey: .name)
|
|
try container.encode(oauthFlow, forKey: .oauthFlow)
|
|
try container.encode(_required, forKey: ._required)
|
|
try container.encode(secret, forKey: .secret)
|
|
}
|
|
}
|
|
|