-
Notifications
You must be signed in to change notification settings - Fork 9
/
ProgrammaticScryptoSborValueU8.swift
52 lines (42 loc) · 1.86 KB
/
ProgrammaticScryptoSborValueU8.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// ProgrammaticScryptoSborValueU8.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
@available(*, deprecated, renamed: "GatewayAPI.ProgrammaticScryptoSborValueU8")
public typealias ProgrammaticScryptoSborValueU8 = GatewayAPI.ProgrammaticScryptoSborValueU8
extension GatewayAPI {
public struct ProgrammaticScryptoSborValueU8: Codable, Hashable {
public private(set) var kind: ProgrammaticScryptoSborValueKind
/** The name of the type of this value. This is only output when a schema is present and the type has a name. This property is ignored when the value is used as an input to the API. */
public private(set) var typeName: String?
/** The name of the field which hosts this value. This property is only included if this value is a child of a `Tuple` or `Enum` with named fields. This property is ignored when the value is used as an input to the API. */
public private(set) var fieldName: String?
public private(set) var value: String
public init(kind: ProgrammaticScryptoSborValueKind, typeName: String? = nil, fieldName: String? = nil, value: String) {
self.kind = kind
self.typeName = typeName
self.fieldName = fieldName
self.value = value
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case kind
case typeName = "type_name"
case fieldName = "field_name"
case value
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(kind, forKey: .kind)
try container.encodeIfPresent(typeName, forKey: .typeName)
try container.encodeIfPresent(fieldName, forKey: .fieldName)
try container.encode(value, forKey: .value)
}
}
}