// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. import Foundation extension Operations { /// A model object public struct Activity { public let cancellable: Bool? public let context: Operations.Context? @DecimalSerialized public private(set) var progress: Double? public let subtitle: String? public let title: String? public let type: String? @DecimalSerialized public private(set) var userID: Double? public let uuid: String? /// Creates an object with the specified parameters /// /// public init(cancellable: Bool? = nil, context: Operations.Context? = nil, progress: Double? = nil, subtitle: String? = nil, title: String? = nil, type: String? = nil, userID: Double? = nil, uuid: String? = nil) { self.cancellable = cancellable self.context = context self._progress = DecimalSerialized(wrappedValue: progress) self.subtitle = subtitle self.title = title self.type = type self._userID = DecimalSerialized(wrappedValue: userID) self.uuid = uuid } } } extension Operations.Activity: Codable { enum CodingKeys: String, CodingKey { case cancellable case context = "Context" case progress case subtitle case title case type case userID case uuid } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.cancellable = try container.decodeIfPresent(Bool.self, forKey: .cancellable) self.context = try container.decodeIfPresent(Operations.Context.self, forKey: .context) self._progress = try container.decodeIfPresent(DecimalSerialized.self, forKey: .progress) ?? DecimalSerialized(wrappedValue: nil) self.subtitle = try container.decodeIfPresent(String.self, forKey: .subtitle) self.title = try container.decodeIfPresent(String.self, forKey: .title) self.type = try container.decodeIfPresent(String.self, forKey: .type) self._userID = try container.decodeIfPresent(DecimalSerialized.self, forKey: .userID) ?? DecimalSerialized(wrappedValue: nil) self.uuid = try container.decodeIfPresent(String.self, forKey: .uuid) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.cancellable, forKey: .cancellable) try container.encodeIfPresent(self.context, forKey: .context) if self.progress != nil { try container.encode(self._progress, forKey: .progress) } try container.encodeIfPresent(self.subtitle, forKey: .subtitle) try container.encodeIfPresent(self.title, forKey: .title) try container.encodeIfPresent(self.type, forKey: .type) if self.userID != nil { try container.encode(self._userID, forKey: .userID) } try container.encodeIfPresent(self.uuid, forKey: .uuid) } } extension Operations.Activity { var userIDWrapper: DecimalSerialized { return _userID } var progressWrapper: DecimalSerialized { return _progress } }