/* Options: Date: 2024-12-04 00:38:30 SwiftVersion: 5.0 Version: 6.00 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://resourcelibrary.api.ashcompanies.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: FavoritesRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/favorites", "GET,POST") public class FavoritesRequest : BasicResourceLibraryRequest, IReturn { public typealias Return = ResourceItemsLiteResponse /** * Set it to true if requesting saved resources only from digital library */ // @ApiMember(Description="Set it to true if requesting saved resources only from digital library") public var digitalFitness:Bool? /** * Set it to true if requesting saved resources only from health library */ // @ApiMember(Description="Set it to true if requesting saved resources only from health library") public var healthLibrary:Bool? /** * Set it to true if requesting saved resources only from vptr */ // @ApiMember(Description="Set it to true if requesting saved resources only from vptr") public var vptr:Bool? /** * Set it to true if requesting saved resources only from wellbeing */ // @ApiMember(Description="Set it to true if requesting saved resources only from wellbeing") public var wellbeing:Bool? /** * Set it to true if requesting saved resources only from health */ // @ApiMember(Description="Set it to true if requesting saved resources only from health") public var health:Bool? public var limit:String? public var offset:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case digitalFitness case healthLibrary case vptr case wellbeing case health case limit case offset } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) digitalFitness = try container.decodeIfPresent(Bool.self, forKey: .digitalFitness) healthLibrary = try container.decodeIfPresent(Bool.self, forKey: .healthLibrary) vptr = try container.decodeIfPresent(Bool.self, forKey: .vptr) wellbeing = try container.decodeIfPresent(Bool.self, forKey: .wellbeing) health = try container.decodeIfPresent(Bool.self, forKey: .health) limit = try container.decodeIfPresent(String.self, forKey: .limit) offset = try container.decodeIfPresent(String.self, forKey: .offset) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if digitalFitness != nil { try container.encode(digitalFitness, forKey: .digitalFitness) } if healthLibrary != nil { try container.encode(healthLibrary, forKey: .healthLibrary) } if vptr != nil { try container.encode(vptr, forKey: .vptr) } if wellbeing != nil { try container.encode(wellbeing, forKey: .wellbeing) } if health != nil { try container.encode(health, forKey: .health) } if limit != nil { try container.encode(limit, forKey: .limit) } if offset != nil { try container.encode(offset, forKey: .offset) } } } public class ResourceItemsLiteResponse : IResourceItemsLiteResponse, Codable { public var resourceItems:[ResourceCard] = [] public var meta:Meta? required public init(){} } public class BasicResourceLibraryRequest : Codable { public var resourceLibraryMemberId:Int? required public init(){} } public class Tag : Codable { public var id:String? public var title:String? required public init(){} } public class ResourceCard : Codable { public var id:String? public var title:String? public var Description:String? public var descriptionSummary:String? public var type:String? public var content:String? public var isComplete:Bool? public var isFavorite:Bool? public var isImplicitlyComplete:Bool? public var mediaPath:String? public var isConfirmable:Bool? public var isWcagCompliant:Bool? public var duration:String? public var preview:String? public var calories:Int? public var instructor:String? public var thumbnail:String? public var difficulty:String? public var tags:[Tag] = [] public var subtitles:String? public var screenshots:[ScreenshotItem] = [] public var drmEncrypted:Bool? required public init(){} } public class Meta : Codable { public var resourceCount:Int? public var title:String? required public init(){} } public protocol IResourceItemsLiteResponse { } public class ScreenshotItem : Codable { public var largeFilepathS3:String? public var thumbFilepathS3:String? public var order:Double? public var Description:String? required public init(){} }