//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//

import Foundation

public struct IBSummary: APIModel {

    public let amount: Double?

    public let currency: String?

    public let isNull: Bool?

    public let timestamp: Int?

    public let value: String?

    public init(amount: Double? = nil, currency: String? = nil, isNull: Bool? = nil, timestamp: Int? = nil, value: String? = nil) {
        self.amount = amount
        self.currency = currency
        self.isNull = isNull
        self.timestamp = timestamp
        self.value = value
    }

    public init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: StringCodingKey.self)

        amount = try container.decodeIfPresent("amount")
        currency = try container.decodeIfPresent("currency")
        isNull = try container.decodeIfPresent("isNull")
        timestamp = try container.decodeIfPresent("timestamp")
        value = try container.decodeIfPresent("value")
    }

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: StringCodingKey.self)

        try container.encodeIfPresent(amount, forKey: "amount")
        try container.encodeIfPresent(currency, forKey: "currency")
        try container.encodeIfPresent(isNull, forKey: "isNull")
        try container.encodeIfPresent(timestamp, forKey: "timestamp")
        try container.encodeIfPresent(value, forKey: "value")
    }

}
