mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
67 lines
2.3 KiB
Swift
67 lines
2.3 KiB
Swift
//
|
|
// ExtensionConfigOneOf5.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(AnyCodable)
|
|
import AnyCodable
|
|
#endif
|
|
|
|
/** Inline Python code that will be executed using uvx */
|
|
public struct ExtensionConfigOneOf5: Codable, JSONEncodable, Hashable {
|
|
|
|
public enum ModelType: String, Codable, CaseIterable {
|
|
case inlinePython = "inline_python"
|
|
}
|
|
public static let timeoutRule = NumericRule<Int64>(minimum: 0, exclusiveMinimum: false, maximum: nil, exclusiveMaximum: false, multipleOf: nil)
|
|
public var availableTools: [String]?
|
|
/** The Python code to execute */
|
|
public var code: String
|
|
/** Python package dependencies required by this extension */
|
|
public var dependencies: [String]?
|
|
/** Description of what the extension does */
|
|
public var description: String?
|
|
/** The name used to identify this extension */
|
|
public var name: String
|
|
/** Timeout in seconds */
|
|
public var timeout: Int64?
|
|
public var type: ModelType
|
|
|
|
public init(availableTools: [String]? = nil, code: String, dependencies: [String]? = nil, description: String? = nil, name: String, timeout: Int64? = nil, type: ModelType) {
|
|
self.availableTools = availableTools
|
|
self.code = code
|
|
self.dependencies = dependencies
|
|
self.description = description
|
|
self.name = name
|
|
self.timeout = timeout
|
|
self.type = type
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case availableTools = "available_tools"
|
|
case code
|
|
case dependencies
|
|
case description
|
|
case name
|
|
case timeout
|
|
case type
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(availableTools, forKey: .availableTools)
|
|
try container.encode(code, forKey: .code)
|
|
try container.encodeIfPresent(dependencies, forKey: .dependencies)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encode(name, forKey: .name)
|
|
try container.encodeIfPresent(timeout, forKey: .timeout)
|
|
try container.encode(type, forKey: .type)
|
|
}
|
|
}
|
|
|