-
Notifications
You must be signed in to change notification settings - Fork 9
/
AccountDepositPreValidationResponse.swift
51 lines (41 loc) · 2.18 KB
/
AccountDepositPreValidationResponse.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
//
// AccountDepositPreValidationResponse.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
@available(*, deprecated, renamed: "GatewayAPI.AccountDepositPreValidationResponse")
public typealias AccountDepositPreValidationResponse = GatewayAPI.AccountDepositPreValidationResponse
extension GatewayAPI {
public struct AccountDepositPreValidationResponse: Codable, Hashable {
public private(set) var ledgerState: LedgerState
public private(set) var allowsTryDepositBatch: Bool
/** The fully resolved try_deposit_* ability of each resource (which takes all the inputs into account, including the authorized depositor badge, the default deposit rule and the resource-specific details). */
public private(set) var resourceSpecificBehaviour: [AccountDepositPreValidationResourceSpecificBehaviourItem]?
public private(set) var decidingFactors: AccountDepositPreValidationDecidingFactors
public init(ledgerState: LedgerState, allowsTryDepositBatch: Bool, resourceSpecificBehaviour: [AccountDepositPreValidationResourceSpecificBehaviourItem]? = nil, decidingFactors: AccountDepositPreValidationDecidingFactors) {
self.ledgerState = ledgerState
self.allowsTryDepositBatch = allowsTryDepositBatch
self.resourceSpecificBehaviour = resourceSpecificBehaviour
self.decidingFactors = decidingFactors
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case ledgerState = "ledger_state"
case allowsTryDepositBatch = "allows_try_deposit_batch"
case resourceSpecificBehaviour = "resource_specific_behaviour"
case decidingFactors = "deciding_factors"
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(ledgerState, forKey: .ledgerState)
try container.encode(allowsTryDepositBatch, forKey: .allowsTryDepositBatch)
try container.encodeIfPresent(resourceSpecificBehaviour, forKey: .resourceSpecificBehaviour)
try container.encode(decidingFactors, forKey: .decidingFactors)
}
}
}