// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. import Foundation extension Operations { /// A model object public struct StatisticsResources { public let at: Int? @DecimalSerialized public private(set) var hostCpuUtilization: Double? @DecimalSerialized public private(set) var hostMemoryUtilization: Double? @DecimalSerialized public private(set) var processCpuUtilization: Double? @DecimalSerialized public private(set) var processMemoryUtilization: Double? public let timespan: Int? /// Creates an object with the specified parameters /// /// public init(at: Int? = nil, hostCpuUtilization: Double? = nil, hostMemoryUtilization: Double? = nil, processCpuUtilization: Double? = nil, processMemoryUtilization: Double? = nil, timespan: Int? = nil) { self.at = at self._hostCpuUtilization = DecimalSerialized(wrappedValue: hostCpuUtilization) self._hostMemoryUtilization = DecimalSerialized(wrappedValue: hostMemoryUtilization) self._processCpuUtilization = DecimalSerialized(wrappedValue: processCpuUtilization) self._processMemoryUtilization = DecimalSerialized(wrappedValue: processMemoryUtilization) self.timespan = timespan } }} extension Operations.StatisticsResources: Codable { enum CodingKeys: String, CodingKey { case at case hostCpuUtilization case hostMemoryUtilization case processCpuUtilization case processMemoryUtilization case timespan } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.at = try container.decodeIfPresent(Int.self, forKey: .at) self._hostCpuUtilization = try container.decodeIfPresent(DecimalSerialized.self, forKey: .hostCpuUtilization) ?? DecimalSerialized(wrappedValue: nil) self._hostMemoryUtilization = try container.decodeIfPresent(DecimalSerialized.self, forKey: .hostMemoryUtilization) ?? DecimalSerialized(wrappedValue: nil) self._processCpuUtilization = try container.decodeIfPresent(DecimalSerialized.self, forKey: .processCpuUtilization) ?? DecimalSerialized(wrappedValue: nil) self._processMemoryUtilization = try container.decodeIfPresent(DecimalSerialized.self, forKey: .processMemoryUtilization) ?? DecimalSerialized(wrappedValue: nil) self.timespan = try container.decodeIfPresent(Int.self, forKey: .timespan) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.at, forKey: .at) if self.hostCpuUtilization != nil { try container.encode(self._hostCpuUtilization, forKey: .hostCpuUtilization) } if self.hostMemoryUtilization != nil { try container.encode(self._hostMemoryUtilization, forKey: .hostMemoryUtilization) } if self.processCpuUtilization != nil { try container.encode(self._processCpuUtilization, forKey: .processCpuUtilization) } if self.processMemoryUtilization != nil { try container.encode(self._processMemoryUtilization, forKey: .processMemoryUtilization) } try container.encodeIfPresent(self.timespan, forKey: .timespan) } } extension Operations.StatisticsResources { var hostCpuUtilizationWrapper: DecimalSerialized { return _hostCpuUtilization } var processCpuUtilizationWrapper: DecimalSerialized { return _processCpuUtilization } var hostMemoryUtilizationWrapper: DecimalSerialized { return _hostMemoryUtilization } var processMemoryUtilizationWrapper: DecimalSerialized { return _processMemoryUtilization } }