// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. import Foundation extension Operations { /// A model object public struct Ratings { public let image: String? public let type: String? @DecimalSerialized public private(set) var value: Double? /// Creates an object with the specified parameters /// /// public init(image: String? = nil, type: String? = nil, value: Double? = nil) { self.image = image self.type = type self._value = DecimalSerialized(wrappedValue: value) } } } extension Operations.Ratings: Codable { enum CodingKeys: String, CodingKey { case image case type case value } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.image = try container.decodeIfPresent(String.self, forKey: .image) self.type = try container.decodeIfPresent(String.self, forKey: .type) self._value = try container.decodeIfPresent(DecimalSerialized.self, forKey: .value) ?? DecimalSerialized(wrappedValue: nil) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.image, forKey: .image) try container.encodeIfPresent(self.type, forKey: .type) if self.value != nil { try container.encode(self._value, forKey: .value) } } } extension Operations.Ratings { var valueWrapper: DecimalSerialized { return _value } }