/* Options: Date: 2025-05-10 02:44:09 SwiftVersion: 5.0 Version: 8.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://active-ewebservice.biz/aeservices30/api //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SearchInventoryRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack /** * SearchInventoryRequires active-e Inventory Service */ // @Route("/SearchInventory", "POST, GET") // @DataContract public class SearchInventoryRequest : BaseSecureRequest, IReturn { public typealias Return = SearchInventoryResponse /** * If sent, only items from the passed location will be returned */ // @DataMember // @ApiMember(DataType="integer", Description="If sent, only items from the passed location will be returned", Format="int32", Name="LocFk") public var locFk:Int? /** * For Internal Use Only */ // @DataMember // @ApiMember(DataType="integer", Description="For Internal Use Only", Format="int32", Name="MfgFk") public var mfgFk:Int? /** * For Internal Use Only */ // @DataMember // @ApiMember(DataType="integer", Description="For Internal Use Only", Format="int32", Name="CatFk") public var catFk:Int? /** * For Internal Use Only */ // @DataMember // @ApiMember(DataType="integer", Description="For Internal Use Only", Format="int32", Name="SubFk") public var subFk:Int? /** * For Internal Use Only */ // @DataMember // @ApiMember(DataType="integer", Description="For Internal Use Only", Format="int32", Name="SelFk") public var selFk:Int? /** * If sent, only items from the passed category# will be returned */ // @DataMember // @ApiMember(DataType="integer", Description="If sent, only items from the passed category# will be returned", Format="int32", Name="Cat") public var cat:Int? /** * If sent, only items from the passed subcategory# will be returned. Must be used in conjunction with the Cat parameter. */ // @DataMember // @ApiMember(DataType="integer", Description="If sent, only items from the passed subcategory# will be returned. Must be used in conjunction with the Cat parameter.", Format="int32", Name="Sub") public var sub:Int? /** * If sent, only items with the passed selection code will be returned */ // @DataMember // @ApiMember(Description="If sent, only items with the passed selection code will be returned", Name="SelectionCode") public var selectionCode:String /** * If sent, only items with the passed mfg code will be returned */ // @DataMember // @ApiMember(Description="If sent, only items with the passed mfg code will be returned", Name="Mfg") public var mfg:String /** * Serialized Items will be included in the search results */ // @DataMember // @ApiMember(DataType="boolean", Description="Serialized Items will be included in the search results", Name="IncludeSerials") public var includeSerials:Bool? /** * Media Items will be included in the search results */ // @DataMember // @ApiMember(DataType="boolean", Description="Media Items will be included in the search results", Name="IncludeMedia") public var includeMedia:Bool? /** * Non-Serialized, Non-Media Items will be included in the search results */ // @DataMember // @ApiMember(DataType="boolean", Description="Non-Serialized, Non-Media Items will be included in the search results", Name="IncludeAccessories") public var includeAccessories:Bool? /** * Package Deal Items will be included in the search results */ // @DataMember // @ApiMember(DataType="boolean", Description="Package Deal Items will be included in the search results", Name="IncludePackages") public var includePackages:Bool? /** * The string to be searched for */ // @DataMember // @ApiMember(Description="The string to be searched for", Name="SearchStr") public var searchStr:String /** * If set, only items with the exact model contained in the search string will be returned */ // @DataMember // @ApiMember(DataType="boolean", Description="If set, only items with the exact model contained in the search string will be returned", Name="ExactModel") public var exactModel:Bool? /** * The Starting Offse */ // @DataMember // @ApiMember(DataType="integer", Description="The Starting Offse", Format="int64", Name="StartOffset") public var startOffset:Int? /** * The # of records to be returned */ // @DataMember // @ApiMember(DataType="integer", Description="The # of records to be returned", Format="int64", Name="RecordCount") public var recordCount:Int? /** * If set, Icon Image Urls will be included in the result, if available */ // @DataMember // @ApiMember(DataType="boolean", Description="If set, Icon Image Urls will be included in the result, if available", Name="IncludeIconImage") public var includeIconImage:Bool? /** * If sent, only items from the passed category IDs will be returned */ // @DataMember // @ApiMember(Description="If sent, only items from the passed category IDs will be returned", Name="CatIdList") public var catIdList:[Int] = [] /** * If sent, only items from the passed subcategory IDs will be returned */ // @DataMember // @ApiMember(Description="If sent, only items from the passed subcategory IDs will be returned", Name="SubIdList") public var subIdList:[Int] = [] /** * If sent, only items from the passed mfg IDs will be returned */ // @DataMember // @ApiMember(Description="If sent, only items from the passed mfg IDs will be returned", Name="MfgIdList") public var mfgIdList:[Int] = [] /** * If sent, only items from the passed selection code IDs will be returned */ // @DataMember // @ApiMember(Description="If sent, only items from the passed selection code IDs will be returned", Name="SelIdList") public var selIdList:[Int] = [] /** * Deleted Items will be included in the search results */ // @DataMember // @ApiMember(DataType="boolean", Description="Deleted Items will be included in the search results", Name="IncludeDeleted") public var includeDeleted:Bool? /** * If sent, only inventory changed on or after this date/time will be included */ // @DataMember // @ApiMember(DataType="string", Description="If sent, only inventory changed on or after this date/time will be included", Format="date", Name="ChangedDate", ParameterType="query") public var changedDate:Date? /** * Package Deal Line Items will be included */ // @DataMember // @ApiMember(DataType="boolean", Description="Package Deal Line Items will be included", Name="IncludePackageLineItems") public var includePackageLineItems:Bool? /** * If set, the InventoryDetails object for each item will also be returned. This is much slower. */ // @DataMember // @ApiMember(DataType="boolean", Description="If set, the InventoryDetails object for each item will also be returned. This is much slower.", Name="IncludeDetails") public var includeDetails:Bool? /** * If sent, only items with an Available Quantity greater then or equal to the sent value will be returned. Use of this parameter requires that the LocFk parameter also be sent. */ // @DataMember // @ApiMember(DataType="integer", Description="If sent, only items with an Available Quantity greater then or equal to the sent value will be returned. Use of this parameter requires that the LocFk parameter also be sent.", Format="int32", Name="MinimumAvailableQuantity") public var minimumAvailableQuantity:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case locFk case mfgFk case catFk case subFk case selFk case cat case sub case selectionCode case mfg case includeSerials case includeMedia case includeAccessories case includePackages case searchStr case exactModel case startOffset case recordCount case includeIconImage case catIdList case subIdList case mfgIdList case selIdList case includeDeleted case changedDate case includePackageLineItems case includeDetails case minimumAvailableQuantity } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) locFk = try container.decodeIfPresent(Int.self, forKey: .locFk) mfgFk = try container.decodeIfPresent(Int.self, forKey: .mfgFk) catFk = try container.decodeIfPresent(Int.self, forKey: .catFk) subFk = try container.decodeIfPresent(Int.self, forKey: .subFk) selFk = try container.decodeIfPresent(Int.self, forKey: .selFk) cat = try container.decodeIfPresent(Int.self, forKey: .cat) sub = try container.decodeIfPresent(Int.self, forKey: .sub) selectionCode = try container.decodeIfPresent(String.self, forKey: .selectionCode) mfg = try container.decodeIfPresent(String.self, forKey: .mfg) includeSerials = try container.decodeIfPresent(Bool.self, forKey: .includeSerials) includeMedia = try container.decodeIfPresent(Bool.self, forKey: .includeMedia) includeAccessories = try container.decodeIfPresent(Bool.self, forKey: .includeAccessories) includePackages = try container.decodeIfPresent(Bool.self, forKey: .includePackages) searchStr = try container.decodeIfPresent(String.self, forKey: .searchStr) exactModel = try container.decodeIfPresent(Bool.self, forKey: .exactModel) startOffset = try container.decodeIfPresent(Int.self, forKey: .startOffset) recordCount = try container.decodeIfPresent(Int.self, forKey: .recordCount) includeIconImage = try container.decodeIfPresent(Bool.self, forKey: .includeIconImage) catIdList = try container.decodeIfPresent([Int].self, forKey: .catIdList) ?? [] subIdList = try container.decodeIfPresent([Int].self, forKey: .subIdList) ?? [] mfgIdList = try container.decodeIfPresent([Int].self, forKey: .mfgIdList) ?? [] selIdList = try container.decodeIfPresent([Int].self, forKey: .selIdList) ?? [] includeDeleted = try container.decodeIfPresent(Bool.self, forKey: .includeDeleted) changedDate = try container.decodeIfPresent(Date.self, forKey: .changedDate) includePackageLineItems = try container.decodeIfPresent(Bool.self, forKey: .includePackageLineItems) includeDetails = try container.decodeIfPresent(Bool.self, forKey: .includeDetails) minimumAvailableQuantity = try container.decodeIfPresent(Int.self, forKey: .minimumAvailableQuantity) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if locFk != nil { try container.encode(locFk, forKey: .locFk) } if mfgFk != nil { try container.encode(mfgFk, forKey: .mfgFk) } if catFk != nil { try container.encode(catFk, forKey: .catFk) } if subFk != nil { try container.encode(subFk, forKey: .subFk) } if selFk != nil { try container.encode(selFk, forKey: .selFk) } if cat != nil { try container.encode(cat, forKey: .cat) } if sub != nil { try container.encode(sub, forKey: .sub) } if selectionCode != nil { try container.encode(selectionCode, forKey: .selectionCode) } if mfg != nil { try container.encode(mfg, forKey: .mfg) } if includeSerials != nil { try container.encode(includeSerials, forKey: .includeSerials) } if includeMedia != nil { try container.encode(includeMedia, forKey: .includeMedia) } if includeAccessories != nil { try container.encode(includeAccessories, forKey: .includeAccessories) } if includePackages != nil { try container.encode(includePackages, forKey: .includePackages) } if searchStr != nil { try container.encode(searchStr, forKey: .searchStr) } if exactModel != nil { try container.encode(exactModel, forKey: .exactModel) } if startOffset != nil { try container.encode(startOffset, forKey: .startOffset) } if recordCount != nil { try container.encode(recordCount, forKey: .recordCount) } if includeIconImage != nil { try container.encode(includeIconImage, forKey: .includeIconImage) } if catIdList.count > 0 { try container.encode(catIdList, forKey: .catIdList) } if subIdList.count > 0 { try container.encode(subIdList, forKey: .subIdList) } if mfgIdList.count > 0 { try container.encode(mfgIdList, forKey: .mfgIdList) } if selIdList.count > 0 { try container.encode(selIdList, forKey: .selIdList) } if includeDeleted != nil { try container.encode(includeDeleted, forKey: .includeDeleted) } if changedDate != nil { try container.encode(changedDate, forKey: .changedDate) } if includePackageLineItems != nil { try container.encode(includePackageLineItems, forKey: .includePackageLineItems) } if includeDetails != nil { try container.encode(includeDetails, forKey: .includeDetails) } if minimumAvailableQuantity != nil { try container.encode(minimumAvailableQuantity, forKey: .minimumAvailableQuantity) } } } // @DataContract public class SearchInventoryResponse : BaseResponse { // @DataMember public var startOffset:Int // @DataMember public var recordCount:Int // @DataMember public var remainingRecords:Int // @DataMember public var totalRecords:Int // @DataMember // @ApiMember(Name="Records", ParameterType="body") public var records:[SearchInventoryApiResult] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case startOffset case recordCount case remainingRecords case totalRecords case records } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) startOffset = try container.decodeIfPresent(Int.self, forKey: .startOffset) recordCount = try container.decodeIfPresent(Int.self, forKey: .recordCount) remainingRecords = try container.decodeIfPresent(Int.self, forKey: .remainingRecords) totalRecords = try container.decodeIfPresent(Int.self, forKey: .totalRecords) records = try container.decodeIfPresent([SearchInventoryApiResult].self, forKey: .records) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if startOffset != nil { try container.encode(startOffset, forKey: .startOffset) } if recordCount != nil { try container.encode(recordCount, forKey: .recordCount) } if remainingRecords != nil { try container.encode(remainingRecords, forKey: .remainingRecords) } if totalRecords != nil { try container.encode(totalRecords, forKey: .totalRecords) } if records.count > 0 { try container.encode(records, forKey: .records) } } } // @DataContract public class BaseRequest : Codable { /** * This is your AIM API Key provided by Tri-Tech */ // @DataMember // @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header") public var apiKey:String // @DataMember // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header") public var oAuthToken:String required public init(){} } // @DataContract public class BaseSecureRequest : BaseRequest { /** * */ // @DataMember // @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header") public var token:String /** * */ // @DataMember // @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header") public var deviceId:String /** * */ // @DataMember // @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header") public var appId:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case token case deviceId case appId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) token = try container.decodeIfPresent(String.self, forKey: .token) deviceId = try container.decodeIfPresent(String.self, forKey: .deviceId) appId = try container.decodeIfPresent(String.self, forKey: .appId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if token != nil { try container.encode(token, forKey: .token) } if deviceId != nil { try container.encode(deviceId, forKey: .deviceId) } if appId != nil { try container.encode(appId, forKey: .appId) } } } // @DataContract public class LocationInfo : Codable { // @DataMember public var id:Int // @DataMember public var desc:String // @DataMember public var shortDesc:String // @DataMember public var region:String // @DataMember public var latitude:Double // @DataMember public var longitude:Double // @DataMember public var inStorePickup:String // @DataMember public var active:Bool // @DataMember public var cashSaleAcct:Int? required public init(){} } // @DataContract public class ImageInfo : Codable { // @DataMember public var url:String // @DataMember public var imageStream:String // @DataMember public var imageSize:String // @DataMember public var errorMessage:String // @DataMember public var uriPk:Int? required public init(){} } // @DataContract public class InventoryDetailByVariant : Codable { // @DataMember public var skuPk:Int // @DataMember public var sku:String // @DataMember public var vendorCost:Double? // @DataMember public var vendorName:String // @DataMember public var attributes:[InventoryDetailAttribute] = [] // @DataMember public var locationDetails:[InventoryDetailByLocation] = [] // @DataMember public var images:[ImageInfo] = [] // @DataMember public var hasImages:Bool // @DataMember public var barcodes:[String] = [] required public init(){} } // @DataContract public class AddOnDetail : Codable { // @DataMember public var sadPk:Int // @DataMember public var skuPk:Int // @DataMember public var catPk:Int // @DataMember public var subPk:Int // @DataMember public var item:String // @DataMember public var Description:String // @DataMember public var price:Double required public init(){} } // @DataContract public class ActiveEInfo : Codable { // @DataMember public var dimension:String // @DataMember public var webDescription:String // @DataMember public var summary:String // @DataMember public var seTitle:String // @DataMember public var seDescription:String // @DataMember public var seKeywords:String // @DataMember public var seAltText:String // @DataMember public var seHtmlFreeText:String // @DataMember public var unpublished:Bool // @DataMember public var freeShipping:Bool // @DataMember public var isFeatured:Bool // @DataMember public var webCategoryIds:[Int] = [] required public init(){} } // @DataContract public class SearchInventoryApiResult : SearchInventoryResultSet { // @DataMember public var detail:InventoryDetail // @DataMember public var iconImage:ImageInfo // @DataMember public var customerPrice:Double required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case detail case iconImage case customerPrice } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) detail = try container.decodeIfPresent(InventoryDetail.self, forKey: .detail) iconImage = try container.decodeIfPresent(ImageInfo.self, forKey: .iconImage) customerPrice = try container.decodeIfPresent(Double.self, forKey: .customerPrice) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if detail != nil { try container.encode(detail, forKey: .detail) } if iconImage != nil { try container.encode(iconImage, forKey: .iconImage) } if customerPrice != nil { try container.encode(customerPrice, forKey: .customerPrice) } } } // @DataContract public class BindableObject : Codable { required public init(){} } // @DataContract public class InventoryDetailAttribute : Codable { // @DataMember public var name:String // @DataMember public var value:String // @DataMember public var priority:Int /** * 1 is 'Don't Send to Web', 2 is 'Guided Navigation' */ // @DataMember // @ApiMember(DataType="int", Description="1 is 'Don't Send to Web', 2 is 'Guided Navigation'", Name="WebType", ParameterType="query") public var webType:Int required public init(){} } // @DataContract public class InventoryDetailByLocation : Codable { // @DataMember public var saqPk:Int // @DataMember public var locationInfo:LocationInfo // @DataMember public var serials:[InventoryDetailBySerial] = [] // @DataMember public var substitutes:[InventoryDetailSubstitute] = [] // @DataMember public var retail:Double // @DataMember public var ourPrice:Double // @DataMember public var salePrice:Double? // @DataMember public var saleInfo:String // @DataMember public var priceA:Double // @DataMember public var priceB:Double // @DataMember public var priceC:Double // @DataMember public var minPrice:Double // @DataMember public var activeEPrice:Double // @DataMember public var customerPrice:Double // @DataMember public var allowPriceChange:Bool // @DataMember public var qty:Double // @DataMember public var qtyAvail:Double // @DataMember public var activeeHoldbackQty:Double // @DataMember public var reorderMin:Int // @DataMember public var reorderMax:Int // @DataMember public var averageCost:Double? // @DataMember public var weightedCost:Double? // @DataMember public var locator:String // @DataMember public var selectionCode:String // @DataMember public var selectionCodeDescription:String // @DataMember public var spiff:Double // @DataMember public var currentSpotCheckQty:Double? // @DataMember public var qtyOut:Double // @DataMember public var qtyOnOrder:Double // @DataMember public var availableForSTR:Double required public init(){} } // @DataContract public class InventoryDetail : Codable { // @DataMember public var sadPk:Int // @DataMember public var invType:String // @DataMember public var model:String // @DataMember public var Description:String // @DataMember public var mfg:String // @DataMember public var category:Int // @DataMember public var categoryDescription:String // @DataMember public var subCategory:Int // @DataMember public var subCategoryDescription:String // @DataMember public var selectionCode:String // @DataMember public var selectionCodeDescription:String // @DataMember public var sellSerialsOnline:Bool // @DataMember public var notes:String // @DataMember public var images:[ImageInfo] = [] // @DataMember public var hasImages:Bool // @DataMember public var variantDetails:[InventoryDetailByVariant] = [] // @DataMember public var addOns:[AddOnDetail] = [] // @DataMember public var activeEInfo:ActiveEInfo // @DataMember public var weight:Double // @DataMember public var unit:String required public init(){} } // @DataContract public class SearchInventoryResultSet : BindableObject, IAIMInventoryRecord { // @DataMember public var pk:Int // @DataMember public var Description:String // @DataMember public var inventoryType:String // @DataMember public var manufacturer:String // @DataMember public var model:String // @DataMember public var category:Double? // @DataMember public var categoryDescription:String // @DataMember public var subCategory:Double? // @DataMember public var subCategoryDescription:String // @DataMember public var selectionCode:String // @DataMember public var selectionCodeDescription:String // @DataMember public var sku:String // @DataMember public var mpn:String // @DataMember public var discontinued:Bool? // @DataMember public var attribute1:String // @DataMember public var attribute2:String // @DataMember public var attribute3:String // @DataMember public var attribute4:String // @DataMember public var attribute5:String // @DataMember public var attribute6:String // @DataMember public var attribute7:String // @DataMember public var attribute8:String // @DataMember public var attribute9:String // @DataMember public var attribute10:String // @DataMember public var attribute11:String // @DataMember public var attribute12:String // @DataMember public var attribute13:String // @DataMember public var attribute14:String // @DataMember public var attribute15:String // @DataMember public var attribute16:String // @DataMember public var attribute17:String // @DataMember public var attribute18:String // @DataMember public var attribute19:String // @DataMember public var attribute20:String // @DataMember public var computerQuantity:Double // @DataMember public var ourPrice:Double // @DataMember public var retailPrice:Double // @DataMember public var activeePrice:Double // @DataMember public var priceA:Double // @DataMember public var priceB:Double // @DataMember public var priceC:Double // @DataMember public var minPrice:Double // @DataMember public var availableQuantity:Double // @DataMember public var isMedia:Bool // @DataMember public var isPackage:Bool // @DataMember public var hasImage:Bool // @DataMember public var searchTerm:String // @DataMember public var keywords:String // @DataMember public var keywordsOrigin:String // @DataMember public var deleted:Bool // @DataMember public var timeStamp:Date required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case pk case Description case inventoryType case manufacturer case model case category case categoryDescription case subCategory case subCategoryDescription case selectionCode case selectionCodeDescription case sku case mpn case discontinued case attribute1 case attribute2 case attribute3 case attribute4 case attribute5 case attribute6 case attribute7 case attribute8 case attribute9 case attribute10 case attribute11 case attribute12 case attribute13 case attribute14 case attribute15 case attribute16 case attribute17 case attribute18 case attribute19 case attribute20 case computerQuantity case ourPrice case retailPrice case activeePrice case priceA case priceB case priceC case minPrice case availableQuantity case isMedia case isPackage case hasImage case searchTerm case keywords case keywordsOrigin case deleted case timeStamp } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) pk = try container.decodeIfPresent(Int.self, forKey: .pk) Description = try container.decodeIfPresent(String.self, forKey: .Description) inventoryType = try container.decodeIfPresent(String.self, forKey: .inventoryType) manufacturer = try container.decodeIfPresent(String.self, forKey: .manufacturer) model = try container.decodeIfPresent(String.self, forKey: .model) category = try container.decodeIfPresent(Double.self, forKey: .category) categoryDescription = try container.decodeIfPresent(String.self, forKey: .categoryDescription) subCategory = try container.decodeIfPresent(Double.self, forKey: .subCategory) subCategoryDescription = try container.decodeIfPresent(String.self, forKey: .subCategoryDescription) selectionCode = try container.decodeIfPresent(String.self, forKey: .selectionCode) selectionCodeDescription = try container.decodeIfPresent(String.self, forKey: .selectionCodeDescription) sku = try container.decodeIfPresent(String.self, forKey: .sku) mpn = try container.decodeIfPresent(String.self, forKey: .mpn) discontinued = try container.decodeIfPresent(Bool.self, forKey: .discontinued) attribute1 = try container.decodeIfPresent(String.self, forKey: .attribute1) attribute2 = try container.decodeIfPresent(String.self, forKey: .attribute2) attribute3 = try container.decodeIfPresent(String.self, forKey: .attribute3) attribute4 = try container.decodeIfPresent(String.self, forKey: .attribute4) attribute5 = try container.decodeIfPresent(String.self, forKey: .attribute5) attribute6 = try container.decodeIfPresent(String.self, forKey: .attribute6) attribute7 = try container.decodeIfPresent(String.self, forKey: .attribute7) attribute8 = try container.decodeIfPresent(String.self, forKey: .attribute8) attribute9 = try container.decodeIfPresent(String.self, forKey: .attribute9) attribute10 = try container.decodeIfPresent(String.self, forKey: .attribute10) attribute11 = try container.decodeIfPresent(String.self, forKey: .attribute11) attribute12 = try container.decodeIfPresent(String.self, forKey: .attribute12) attribute13 = try container.decodeIfPresent(String.self, forKey: .attribute13) attribute14 = try container.decodeIfPresent(String.self, forKey: .attribute14) attribute15 = try container.decodeIfPresent(String.self, forKey: .attribute15) attribute16 = try container.decodeIfPresent(String.self, forKey: .attribute16) attribute17 = try container.decodeIfPresent(String.self, forKey: .attribute17) attribute18 = try container.decodeIfPresent(String.self, forKey: .attribute18) attribute19 = try container.decodeIfPresent(String.self, forKey: .attribute19) attribute20 = try container.decodeIfPresent(String.self, forKey: .attribute20) computerQuantity = try container.decodeIfPresent(Double.self, forKey: .computerQuantity) ourPrice = try container.decodeIfPresent(Double.self, forKey: .ourPrice) retailPrice = try container.decodeIfPresent(Double.self, forKey: .retailPrice) activeePrice = try container.decodeIfPresent(Double.self, forKey: .activeePrice) priceA = try container.decodeIfPresent(Double.self, forKey: .priceA) priceB = try container.decodeIfPresent(Double.self, forKey: .priceB) priceC = try container.decodeIfPresent(Double.self, forKey: .priceC) minPrice = try container.decodeIfPresent(Double.self, forKey: .minPrice) availableQuantity = try container.decodeIfPresent(Double.self, forKey: .availableQuantity) isMedia = try container.decodeIfPresent(Bool.self, forKey: .isMedia) isPackage = try container.decodeIfPresent(Bool.self, forKey: .isPackage) hasImage = try container.decodeIfPresent(Bool.self, forKey: .hasImage) searchTerm = try container.decodeIfPresent(String.self, forKey: .searchTerm) keywords = try container.decodeIfPresent(String.self, forKey: .keywords) keywordsOrigin = try container.decodeIfPresent(String.self, forKey: .keywordsOrigin) deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted) timeStamp = try container.decodeIfPresent(Date.self, forKey: .timeStamp) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if pk != nil { try container.encode(pk, forKey: .pk) } if Description != nil { try container.encode(Description, forKey: .Description) } if inventoryType != nil { try container.encode(inventoryType, forKey: .inventoryType) } if manufacturer != nil { try container.encode(manufacturer, forKey: .manufacturer) } if model != nil { try container.encode(model, forKey: .model) } if category != nil { try container.encode(category, forKey: .category) } if categoryDescription != nil { try container.encode(categoryDescription, forKey: .categoryDescription) } if subCategory != nil { try container.encode(subCategory, forKey: .subCategory) } if subCategoryDescription != nil { try container.encode(subCategoryDescription, forKey: .subCategoryDescription) } if selectionCode != nil { try container.encode(selectionCode, forKey: .selectionCode) } if selectionCodeDescription != nil { try container.encode(selectionCodeDescription, forKey: .selectionCodeDescription) } if sku != nil { try container.encode(sku, forKey: .sku) } if mpn != nil { try container.encode(mpn, forKey: .mpn) } if discontinued != nil { try container.encode(discontinued, forKey: .discontinued) } if attribute1 != nil { try container.encode(attribute1, forKey: .attribute1) } if attribute2 != nil { try container.encode(attribute2, forKey: .attribute2) } if attribute3 != nil { try container.encode(attribute3, forKey: .attribute3) } if attribute4 != nil { try container.encode(attribute4, forKey: .attribute4) } if attribute5 != nil { try container.encode(attribute5, forKey: .attribute5) } if attribute6 != nil { try container.encode(attribute6, forKey: .attribute6) } if attribute7 != nil { try container.encode(attribute7, forKey: .attribute7) } if attribute8 != nil { try container.encode(attribute8, forKey: .attribute8) } if attribute9 != nil { try container.encode(attribute9, forKey: .attribute9) } if attribute10 != nil { try container.encode(attribute10, forKey: .attribute10) } if attribute11 != nil { try container.encode(attribute11, forKey: .attribute11) } if attribute12 != nil { try container.encode(attribute12, forKey: .attribute12) } if attribute13 != nil { try container.encode(attribute13, forKey: .attribute13) } if attribute14 != nil { try container.encode(attribute14, forKey: .attribute14) } if attribute15 != nil { try container.encode(attribute15, forKey: .attribute15) } if attribute16 != nil { try container.encode(attribute16, forKey: .attribute16) } if attribute17 != nil { try container.encode(attribute17, forKey: .attribute17) } if attribute18 != nil { try container.encode(attribute18, forKey: .attribute18) } if attribute19 != nil { try container.encode(attribute19, forKey: .attribute19) } if attribute20 != nil { try container.encode(attribute20, forKey: .attribute20) } if computerQuantity != nil { try container.encode(computerQuantity, forKey: .computerQuantity) } if ourPrice != nil { try container.encode(ourPrice, forKey: .ourPrice) } if retailPrice != nil { try container.encode(retailPrice, forKey: .retailPrice) } if activeePrice != nil { try container.encode(activeePrice, forKey: .activeePrice) } if priceA != nil { try container.encode(priceA, forKey: .priceA) } if priceB != nil { try container.encode(priceB, forKey: .priceB) } if priceC != nil { try container.encode(priceC, forKey: .priceC) } if minPrice != nil { try container.encode(minPrice, forKey: .minPrice) } if availableQuantity != nil { try container.encode(availableQuantity, forKey: .availableQuantity) } if isMedia != nil { try container.encode(isMedia, forKey: .isMedia) } if isPackage != nil { try container.encode(isPackage, forKey: .isPackage) } if hasImage != nil { try container.encode(hasImage, forKey: .hasImage) } if searchTerm != nil { try container.encode(searchTerm, forKey: .searchTerm) } if keywords != nil { try container.encode(keywords, forKey: .keywords) } if keywordsOrigin != nil { try container.encode(keywordsOrigin, forKey: .keywordsOrigin) } if deleted != nil { try container.encode(deleted, forKey: .deleted) } if timeStamp != nil { try container.encode(timeStamp, forKey: .timeStamp) } } } public protocol IAIMInventoryRecord { var longDesc:String { get set } var invDesc_Cat:Int { get set } var invDesc_Sub:Int { get set } var invDesc_Mfg:String { get set } var invDesc_Model:String { get set } var invDesc_Desc:String { get set } var invDesc_CatDesc:String { get set } var invDesc_SubDesc:String { get set } var invDesc_Locator:String { get set } var invDesc_StockNum:String { get set } var invDesc_SelDesc:String { get set } var invDesc_Sku:String { get set } var invDesc_SelCode:String { get set } var invDesc_Mpn:String { get set } var invDesc_Att1:String { get set } var invDesc_Att2:String { get set } var invDesc_Att3:String { get set } var invDesc_Att4:String { get set } var invDesc_Att5:String { get set } var invDesc_Att6:String { get set } } // @DataContract public class InventoryDetailBySerial : Codable { // @DataMember public var sasPk:Int // @DataMember public var serial:String // @DataMember public var retail:Double // @DataMember public var ourPrice:Double // @DataMember public var salePrice:Double? // @DataMember public var status:String // @DataMember public var saleInfo:String // @DataMember public var priceA:Double // @DataMember public var priceB:Double // @DataMember public var priceC:Double // @DataMember public var minPrice:Double // @DataMember public var activeEPrice:Double // @DataMember public var allowPriceChange:Bool // @DataMember public var cost:Double? // @DataMember public var weightedCost:Double? // @DataMember public var notes:String // @DataMember public var attributes:[InventoryDetailAttribute] = [] // @DataMember public var images:[ImageInfo] = [] // @DataMember public var hasImages:Bool // @DataMember public var isActiveeHoldback:Bool // @DataMember public var customerAcct:Int? // @DataMember public var availableForSTR:Bool required public init(){} } // @DataContract public class InventoryDetailSubstitute : Codable { // @DataMember public var model:String // @DataMember public var sku:String // @DataMember public var mfg:String // @DataMember public var Description:String // @DataMember public var price:Double // @DataMember public var availableQty:Double required public init(){} } // @DataContract public class BaseResponse : Codable { /** * */ // @DataMember // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body") public var status:BaseResponseResult required public init(){} }