mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
58 lines
1.7 KiB
Swift
58 lines
1.7 KiB
Swift
//
|
|
// RawResource.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(AnyCodable)
|
|
import AnyCodable
|
|
#endif
|
|
|
|
public struct RawResource: Codable, JSONEncodable, Hashable {
|
|
|
|
public static let sizeRule = NumericRule<Int>(minimum: 0, exclusiveMinimum: false, maximum: nil, exclusiveMaximum: false, multipleOf: nil)
|
|
public var description: String?
|
|
public var icons: [Icon]?
|
|
public var mimeType: String?
|
|
public var name: String
|
|
public var size: Int?
|
|
public var title: String?
|
|
public var uri: String
|
|
|
|
public init(description: String? = nil, icons: [Icon]? = nil, mimeType: String? = nil, name: String, size: Int? = nil, title: String? = nil, uri: String) {
|
|
self.description = description
|
|
self.icons = icons
|
|
self.mimeType = mimeType
|
|
self.name = name
|
|
self.size = size
|
|
self.title = title
|
|
self.uri = uri
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case description
|
|
case icons
|
|
case mimeType
|
|
case name
|
|
case size
|
|
case title
|
|
case uri
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(icons, forKey: .icons)
|
|
try container.encodeIfPresent(mimeType, forKey: .mimeType)
|
|
try container.encode(name, forKey: .name)
|
|
try container.encodeIfPresent(size, forKey: .size)
|
|
try container.encodeIfPresent(title, forKey: .title)
|
|
try container.encode(uri, forKey: .uri)
|
|
}
|
|
}
|
|
|