mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
49 lines
1.2 KiB
Swift
49 lines
1.2 KiB
Swift
//
|
|
// ResourceContents.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(AnyCodable)
|
|
import AnyCodable
|
|
#endif
|
|
|
|
public struct ResourceContents: Codable, JSONEncodable, Hashable {
|
|
|
|
public var meta: [String: AnyCodable]?
|
|
public var mimeType: String?
|
|
public var text: String
|
|
public var uri: String
|
|
public var blob: String
|
|
|
|
public init(meta: [String: AnyCodable]? = nil, mimeType: String? = nil, text: String, uri: String, blob: String) {
|
|
self.meta = meta
|
|
self.mimeType = mimeType
|
|
self.text = text
|
|
self.uri = uri
|
|
self.blob = blob
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case meta = "_meta"
|
|
case mimeType
|
|
case text
|
|
case uri
|
|
case blob
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(meta, forKey: .meta)
|
|
try container.encodeIfPresent(mimeType, forKey: .mimeType)
|
|
try container.encode(text, forKey: .text)
|
|
try container.encode(uri, forKey: .uri)
|
|
try container.encode(blob, forKey: .blob)
|
|
}
|
|
}
|
|
|